redactInPlace modifies the given config to redact the fields inside it.
(ctx context.Context)
| 1270 | |
| 1271 | // redactInPlace modifies the given config to redact the fields inside it. |
| 1272 | func (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 | |
| 1291 | func redactConfigAsStr(ctx context.Context, dbConfig string) (string, error) { |
| 1292 | var config map[string]*json.RawMessage |