Skip to content

feat(cp): IdentityMismatch reconcile check (ADR #19 slice 3) - #22

Closed
brettchien wants to merge 0 commit into
feat/fleet-binding-switch-slice2from
feat/identity-mismatch-slice3
Closed

feat(cp): IdentityMismatch reconcile check (ADR #19 slice 3)#22
brettchien wants to merge 0 commit into
feat/fleet-binding-switch-slice2from
feat/identity-mismatch-slice3

Conversation

@brettchien

Copy link
Copy Markdown
Contributor

Drafted by Orca (ecs-claude) — flagging authorship (shared GitHub identity).

Third slice of ADR #19 — the reconcile step that closes the declare → switch → observe → reconcile loop. Stacked on #21 (slice-2); base will retarget to main when #21 merges.

What:

  • studio-cpprincipal_matches(expected, actual): the read-only IdentityMismatch check. A warning signal, never an authz gate (ADR-2 authz stays deferred). Handles the STS assumed-role vs IAM role shape (expected …:role/R matches actual …:assumed-role/R/SESSION) and a trailing * wildcard. A static user/… never satisfies a role expectation — exactly the fallback we want flagged. Unit-tested, including the incident case (role expected, user/brett.chien resolved → mismatch) and wrong-account.
  • oab-mcpruntime_context now reports expected_principal and identity_matches (null when the binding declares no expectation).

Effect: with a binding's expected_principal set, runtime_context flags on sight when the resolved identity isn't the intended one — today's deploy_list incident would have tripped it (identity_matches: false).

Scope: reconcile is observe-only — it reports, it does not block. Enforcement is out of scope by design (ADR-2). Assume-role credential form is the next slice (its AssumeRoleProvider API is version-sensitive and there's no existing pattern in-repo to mirror, so I'm landing it isolated to keep CI churn off this one).

Verification: CI on this PR; new unit test covers the matcher. Local full builds OOM on aws-sdk-ec2 per the ci.yml note.

Relates to #19, stacks on #21.

🤖 Generated with Claude Code

@brettchien
brettchien force-pushed the feat/fleet-binding-switch-slice2 branch from 5ce48c8 to 8151cf1 Compare August 13, 2026 05:30
@brettchien
brettchien force-pushed the feat/identity-mismatch-slice3 branch from 473ac37 to 29ee9c6 Compare August 13, 2026 05:30
@brettchien brettchien closed this Aug 13, 2026
@brettchien
brettchien force-pushed the feat/identity-mismatch-slice3 branch from 29ee9c6 to 5d0937b Compare August 13, 2026 05:34
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