Skip to content

fix: use the IdP secret the operator already owns - #31

Merged
Robobc merged 1 commit into
docs/entra-id-federationfrom
fix/byo-idp-secret-name
Aug 19, 2026
Merged

fix: use the IdP secret the operator already owns#31
Robobc merged 1 commit into
docs/entra-id-federationfrom
fix/byo-idp-secret-name

Conversation

@Robobc

@Robobc Robobc commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Stacked on #30 — merge that one first and this retargets to main automatically.

What

Naming a Secrets Manager secret you already own is the path an enterprise actually wants: "our IdP secret is already in Secrets Manager, here is its name, don't ask us for it." It looked supported — identity.client_secret_name in platform.yaml, or IDP_CLIENT_SECRET_NAME — but it never worked:

  • prompt_idp probed only <prefix>-idp-client-secret, so a configured name was never found and the participant was asked to paste the value anyway.
  • upsert_idp_secret then reassigned the name to its own prefixed one, storing a second copy and leaving the operator's secret unused.

Both now fall back to the prefixed name only when nothing is configured. Rotating a value into a bring-your-own secret writes to that secret instead of forking it.

Check

Check (l) in scripts/check-deploy-config.sh covers both halves — the describe-secret probe must target the configured name, and the rotation must not mention the prefixed one. Against the old deploy.sh it fails with:

FAIL: configured secret name not probed: secretsmanager describe-secret
      --secret-id check-prefix-idp-client-secret --region us-east-1

Also: the demo script documented a command that cannot work

workshop-simulation/DEMO_SCRIPT.md told readers to deploy with -c idp_client_secret=$IDP_CLIENT_SECRET. The auth stack rejects that context key outright ("no longer supported"), so the documented command fails — and it taught exactly the leaky pattern the secret-name design exists to avoid, since context values land in cdk.context.json, process listings, and the synthesized template. Replaced with the two real steps and a note that run-workshop.sh does both for you.

Verified

  • scripts/check-deploy-config.sh: 15 checks green; check (l) fails against the pre-fix script.
  • shellcheck: back to the 2 pre-existing deploy.sh findings, nothing new.

No AWS deploy needed for this one — the behaviour is in the CLI argument the script builds, which is what the check asserts on.

Naming an existing Secrets Manager secret is the path an enterprise actually
wants — "our secret is already there, here is its name, do not ask us for it" —
and it looked supported (identity.client_secret_name in platform.yaml, or
IDP_CLIENT_SECRET_NAME). It was not:

  - prompt_idp probed only <prefix>-idp-client-secret, so a configured name was
    never found, the participant was asked to paste the value anyway, and
  - upsert_idp_secret then reassigned IDP_CLIENT_SECRET_NAME to its own prefixed
    name, storing a second copy and leaving the operator's secret unused.

Both now default to the prefixed name only when none is configured. Rotating a
value into a bring-your-own secret writes to that secret instead of forking it.

Check (l) in check-deploy-config.sh covers both halves: the describe-secret
probe must target the configured name, and the rotation must not mention the
prefixed one. Against the old deploy.sh it fails with
"configured secret name not probed: ... --secret-id check-prefix-idp-client-secret".

Also fixes the demo script, which told readers to pass the secret as
`-c idp_client_secret=...`. The stack rejects that key outright ("no longer
supported"), so the documented command could not work — and it taught the leaky
pattern the secret-name design exists to avoid. Replaced with the two real
steps, plus a note that run-workshop.sh does them for you.

Verified: full check-deploy-config.sh run green (15 checks); shellcheck back to
the 2 pre-existing deploy.sh findings, nothing new.
@Robobc
Robobc merged commit 3ad2e3c into docs/entra-id-federation Aug 19, 2026
1 check failed
@Robobc
Robobc deleted the fix/byo-idp-secret-name branch August 19, 2026 22:41
Robobc added a commit that referenced this pull request Aug 22, 2026
fix: use the IdP secret the operator already owns (re-land of #31)
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.

1 participant