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.go and its tests move as they are. redactSecrets, redactJSON and redactedMarker become redact.Secrets, redact.JSON and redact.Marker.
  • redactSessionData stays in audit/sync, next to its caller in sync.go, because it works on the sync command's session data.
  • The two tests that run the sync command (TestGoalFromText_RedactsBeforeShortening and TestRunSync_RedactsSecretsBeforeUpload) move to sync_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/...

Merge request reports

Loading
Loading