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

Function redactAdminExecuteResponse

backend/api/v1/audit.go:721–746  ·  view source on GitHub ↗
(r *v1pb.AdminExecuteResponse)

Source from the content-addressed store, hash-verified

719}
720
721func redactAdminExecuteResponse(r *v1pb.AdminExecuteResponse) *v1pb.AdminExecuteResponse {
722 if r == nil {
723 return nil
724 }
725 n := &v1pb.AdminExecuteResponse{
726 Results: nil,
727 }
728 for _, result := range r.Results {
729 if result == nil {
730 n.Results = append(n.Results, &v1pb.QueryResult{})
731 continue
732 }
733 n.Results = append(n.Results, &v1pb.QueryResult{
734 ColumnNames: result.ColumnNames,
735 ColumnTypeNames: result.ColumnTypeNames,
736 Rows: nil, // Redacted
737 Error: result.Error,
738 Latency: result.Latency,
739 Statement: result.Statement,
740 DetailedError: result.DetailedError,
741 Masked: redactMaskingReasons(result.Masked), // Redact icon data
742 })
743 }
744
745 return n
746}
747
748func redactQueryResponse(r *v1pb.QueryResponse) *v1pb.QueryResponse {
749 if r == nil {

Callers 1

getResponseStringFunction · 0.85

Calls 1

redactMaskingReasonsFunction · 0.85

Tested by

no test coverage detected