MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / redactInPlace

Method redactInPlace

rest/config.go:1272–1289  ·  view source on GitHub ↗

redactInPlace modifies the given config to redact the fields inside it.

(ctx context.Context)

Source from the content-addressed store, hash-verified

1270
1271// redactInPlace modifies the given config to redact the fields inside it.
1272func (config *DbConfig) redactInPlace(ctx context.Context) error {
1273
1274 if config.Password != "" {
1275 config.Password = base.RedactedStr
1276 }
1277
1278 for i := range config.Users {
1279 if config.Users[i].Password != nil && *config.Users[i].Password != "" {
1280 config.Users[i].Password = base.Ptr(base.RedactedStr)
1281 }
1282 }
1283
1284 for i, _ := range config.Replications {
1285 config.Replications[i] = config.Replications[i].Redacted(ctx)
1286 }
1287
1288 return nil
1289}
1290
1291func redactConfigAsStr(ctx context.Context, dbConfig string) (string, error) {
1292 var config map[string]*json.RawMessage

Callers 2

RedactedMethod · 0.95
RedactedMethod · 0.80

Calls 2

PtrFunction · 0.92
RedactedMethod · 0.45

Tested by

no test coverage detected