Loading
refactor(minder): share secret redaction across glab minder commands
Description
Moves the secret redaction that glab minder audit sync applies before uploading out of the audit/sync command into a shared package, internal/commands/govern/internal/redact, so other glab minder commands can redact with the same rules. No behaviour changes.
redact.goand its tests move as they are.redactSecrets,redactJSONandredactedMarkerbecomeredact.Secrets,redact.JSONandredact.Marker.redactSessionDatastays inaudit/sync, next to its caller insync.go, because it works on the sync command's session data.- The two tests that run the sync command (
TestGoalFromText_RedactsBeforeShorteningandTestRunSync_RedactsSecretsBeforeUpload) move tosync_test.go.
Related to https://gitlab.com/gitlab-org/gitlab/-/work_items/634679
How has this been tested?
The existing tests move with the code, and the same 331 tests pass in the two packages as before.
go test ./internal/commands/govern/...