Skip to content

fix(#1345): answer IAM Identity Center's permission set through a projection, with dates as epoch seconds - #1357

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/1345-sso-projection
Oct 3, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
fix/1345-sso-projection

Conversation

@scttfrdmn

Copy link
Copy Markdown
Owner

This is the last of ten PRs in #756's 3-line block.

Fixes #1345

The leak and the dates

createPermissionSet and describePermissionSet answered {"PermissionSet": ps}, the persisted
SSOPermissionSet. A consumer therefore read:

ListInstances had the same date defect on InstanceMetadata.CreatedDate, which I verified today
against API_ListInstances. #1345 named only the permission set, so this PR goes one member further
and says so.

The fix

  • The new emulator/sso_wire.go holds ssoPermissionSetOut, with all six of
    API_PermissionSet's members and CreatedDate as EpochSeconds.
  • ListInstances' map now renders EpochSeconds(inst.CreatedDate).

The stored records are unchanged. SSOInstance and SSOAccountAssignment were already built
member by member and are cited as projected.

Why this test compares names exactly, not folded

Every other wire test folds case. Here a fold is wrong:

  • CreateAccountAssignment and ListAccountAssignments publish AccountId, the account an
    assignment targets, which is the service's own data.
  • The bookkeeping member is AccountID, the owning account.

They differ only in case. The control below shows the shared folded walk would fail on the published
member.

The citation

emulator/sso_wire_test.go drives all twelve routed operations in one ordered flow: instance,
permission set, managed policy, then assignment. It is cited for all three records and reads each
record's AccountID back first. After the walk, it requires the permission set to carry no
InstanceArn, and pins CreatedDate at 1700000000.000 on a frozen clock in all three responses
that carry it.

Negative controls (each run, then restored)

Corruption Failed
describePermissionSet reverted to the record exactly /DescribePermissionSet, with $.PermissionSet.AccountID
ListInstances' date back to time.Time the epoch assertion
the shared folded walk in place of the exact one /ListAccountAssignments falsely fails on the published AccountId, which is why the comparison is exact

DeleteAccountAssignment's status object carries only RequestId and Status, which is a #1199-style
member gap. It is anchored on AccountAssignmentDeletionStatus and left as is.

The ratchet

before: 319 declared, 270 projected across 111 records, 9 internal across 6 records, 40 still reachable
after:  319 declared, 273 projected across 114 records, 9 internal across 6 records, 37 still reachable

Verification

All of these pass:

  • make lint: 0 issues.
  • make test: race, -count=1.
  • docs-reference-check docs-versions version-check discarded-unmarshal-check wire-bookkeeping-check operation-catalog-check operation-docs-check.

#756 stays open. This PR closes only #1345, whose three criteria are met.

…jection, with dates as epoch seconds

createPermissionSet and describePermissionSet handed the persisted
SSOPermissionSet to the caller, so a consumer read the owning AccountID (#756)
and InstanceArn, which API_PermissionSet does not publish. CreatedDate rendered
as an RFC3339 string there and in ListInstances, where awsJson1_1 publishes a
number, so a typed SDK could decode neither.

The permission set now answers emulator/sso_wire.go's ssoPermissionSetOut, and
both dates render EpochSeconds. #1345 named the permission set's date;
ListInstances' had the same defect and is fixed here too. Stored records are
unchanged.

emulator/sso_wire_test.go drives all twelve routed operations and is cited for
all three records. It compares member names exactly, because the assignment
operations publish AccountId, the target, which a case fold would mistake for
the bookkeeping AccountID. check-wire-bookkeeping goes from 270 projected across
111 records to 273 across 114, and from 40 still reachable to 37.

Fixes #1345
@codecov

codecov Bot commented Oct 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn merged commit 2a740b5 into main Oct 3, 2026
18 checks passed
@scttfrdmn
scttfrdmn deleted the fix/1345-sso-projection branch October 3, 2026 04:21
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.

sso: PermissionSet.CreatedDate is an RFC3339 string, so CreatePermissionSet and DescribePermissionSet cannot be decoded

1 participant