Skip to content

Redact whole-env manifest diff as a map, not a scalar string - #5746

Merged
kathap merged 1 commit into
mainfrom
fix-manifest-env-diff-redaction-cli-panic
Dec 3, 2026
Merged

kathap merged 1 commit into
mainfrom
fix-manifest-env-diff-redaction-cli-panic

Conversation

@kathap

@kathap kathap commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

The cf CLI's redactDiff type-asserts map[string]interface{} on diffs whose path ends in /env; a scalar redaction string panics it (cf push --redact-env). Emit a map for the whole-env node instead.

  • A short explanation of the proposed change:
    When generating a manifest diff, Cloud Controller redacts sensitive keys (env, credentials, cnb-credentials) by replacing the diff value with the scalar string [PRIVATE DATA HIDDEN]. For a diff that targets the whole env node (path ending in /env), this now emits a map ({ "keys" => "[PRIVATE DATA HIDDEN]" }) instead of the scalar string.

  • An explanation of the use cases your change solves
    cf push --redact-env crashes against any Cloud Controller on CAPI ≥ 1.253.0 (the nfs-broker errand adds this flag automatically, so its deploy fails too).
    The CF CLI expects the env part of a manifest diff to be a map. Since Improve redaction of sensitive manifest values #5712, the server started sending a plain string ([PRIVATE DATA HIDDEN]) for it, so the CLI panics. In BOSH errands this shows up as the confusing error Response exceeded maximum allowed length.
    This change sends env back as a map, so the CLI stops crashing

  • Links to any other associated PRs
    Improve redaction of sensitive manifest values #5712

  • I have reviewed the contributing guide

  • I have viewed, signed, and submitted the Contributor License Agreement

  • I have made this pull request to the main branch

  • I have run all the unit tests using bundle exec rake

  • I have run CF Acceptance Tests

The cf CLI's redactDiff type-asserts map[string]interface{} on diffs
whose path ends in /env; a scalar redaction string panics it
(cf push --redact-env against CAPI >= 1.253.0). Emit a map for the
whole-env node instead.
@jochenehret

Copy link
Copy Markdown
Contributor

Note: CF CLI versions v8.7.9 through v8.19.1 are affected.

@kathap
kathap merged commit b571bbc into main Dec 3, 2026
12 checks passed
ari-wg-gitbot added a commit to cloudfoundry/capi-release that referenced this pull request Dec 3, 2026
Changes in cloud_controller_ng:

- Redact whole-env manifest diff as a map, not a scalar string
    PR: cloudfoundry/cloud_controller_ng#5746
    Author: Katharina Przybill <30441792+kathap@users.noreply.github.com>
@moleske
moleske deleted the fix-manifest-env-diff-redaction-cli-panic branch December 3, 2026 16:35
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