MCPcopy Create free account
hub / github.com/bytebase/bytebase / redactQueryResponse

Function redactQueryResponse

backend/api/v1/audit.go:748–770  ·  view source on GitHub ↗
(r *v1pb.QueryResponse)

Source from the content-addressed store, hash-verified

746}
747
748func redactQueryResponse(r *v1pb.QueryResponse) *v1pb.QueryResponse {
749 if r == nil {
750 return nil
751 }
752 n := &v1pb.QueryResponse{
753 Results: nil,
754 AppliedAccessGrant: r.AppliedAccessGrant,
755 }
756 for _, result := range r.Results {
757 n.Results = append(n.Results, &v1pb.QueryResult{
758 ColumnNames: result.ColumnNames,
759 ColumnTypeNames: result.ColumnTypeNames,
760 Rows: nil, // Redacted
761 RowsCount: result.RowsCount,
762 Error: result.Error,
763 Latency: result.Latency,
764 Statement: result.Statement,
765 DetailedError: result.DetailedError,
766 Masked: redactMaskingReasons(result.Masked), // Redact icon data
767 })
768 }
769 return n
770}
771
772func redactMaskingReasons(reasons []*v1pb.MaskingReason) []*v1pb.MaskingReason {
773 if reasons == nil {

Callers 1

getResponseStringFunction · 0.85

Calls 1

redactMaskingReasonsFunction · 0.85

Tested by

no test coverage detected