Skip to content

feat(export): extend --redact-secrets coverage for application keys#46

Merged
fmenesesg merged 1 commit into
mainfrom
feat/extend-redact-secrets
Jun 15, 2026
Merged

feat(export): extend --redact-secrets coverage for application keys#46
fmenesesg merged 1 commit into
mainfrom
feat/extend-redact-secrets

Conversation

@hugomelendez

Copy link
Copy Markdown
Collaborator

Proposed change

Extend --redact-secrets to close credential gaps in shared exports: redact provider_verification_key, client_id, and app_id; strip embedded credentials from OIDC issuer URLs while keeping host/path visible; fail export when cleartext remains after redaction.

Type of change

  • New feature

RHCL checklist

  • Tests added or updated (go test ./...)
  • CI does not introduce -DskipTests without justification
  • No secrets in diff (tokens, kubeconfigs, OIDC secrets)
  • rhcl-ai docs updated if export/import contract changes
  • PR description and docs in English

Test plan

  • go test ./internal/export/...
  • go test ./... (coverage 80.7%)
  • TestExportRedactSecrets — extended keys, issuer strip, auth flags preserved
  • TestExportWithoutRedactPreservesSecrets — opt-in default (no flag)
  • TestVerifyNoCleartextSecretsFailsWithPath — gate fails with path-qualified error

Additional information

  • Related: SDD change extend-redact-secrets

Add provider_verification_key, client_id, and app_id redaction; strip
embedded credentials from OIDC issuer URLs while keeping host/path visible;
fail export when cleartext remains after redaction. Preserve auth_* proxy
flags and document the contract in README and TC-EXP-003.

Co-authored-by: Cursor <cursoragent@cursor.com>

@fmenesesg fmenesesg left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review summary

Solid extension of --redact-secrets — closes realistic gaps for shared exports without changing the opt-in default.

What works well

  • Redacts provider_verification_key, client_id, and app_id in JSON/YAML artifacts
  • Strips embedded credentials from issuer_endpoint / oidc_issuer_endpoint while preserving host/path
  • Preserves auth-mode proxy flags (auth_user_key, auth_app_id, auth_app_key)
  • Post-redaction gate (VerifyNoCleartextSecrets) fails export with a path-qualified error before manifest.json is written
  • Good test coverage: opt-in default preserved, end-to-end export path, unit tests for JSON/YAML, README + TC-EXP-003 updated

Verified locally: go test ./... — 165 tests pass.

Nit (non-blocking): YAML issuer URLs wrapped in quotes are not stripped by stripURLUserinfo (quotes break url.Parse), but the verify gate still detects userinfo and fails the export — safe fail-closed behavior. Consider trimming quotes in a follow-up if toolbox YAML commonly uses quoted issuers.

Behavior note for team: exports with --redact-secrets may now fail where they previously completed with residual cleartext — intentional and desirable for shared artifacts.

Approve — ready to merge.

@fmenesesg fmenesesg merged commit 8c02aa7 into main Jun 15, 2026
1 check passed
@fmenesesg fmenesesg deleted the feat/extend-redact-secrets branch June 15, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants