Repository navigation
fix(#1345): answer IAM Identity Center's permission set through a projection, with dates as epoch seconds - #1357
Merged
Merged
Conversation
…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 Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
4 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the last of ten PRs in #756's 3-line block.
Fixes #1345
The leak and the dates
createPermissionSetanddescribePermissionSetanswered{"PermissionSet": ps}, the persistedSSOPermissionSet. A consumer therefore read:AccountID(emulator: substrate bookkeeping fields render as response members AWS does not publish #756);InstanceArn, whichAPI_PermissionSetdoes not publish, because the request names theinstance;
CreatedDateas an RFC3339 string, whereAPI_DescribePermissionSetpublishes"CreatedDate": numberunderawsJson1_1(sso: PermissionSet.CreatedDate is an RFC3339 string, so CreatePermissionSet and DescribePermissionSet cannot be decoded #1345).ListInstanceshad the same date defect onInstanceMetadata.CreatedDate, which I verified todayagainst
API_ListInstances. #1345 named only the permission set, so this PR goes one member furtherand says so.
The fix
emulator/sso_wire.goholdsssoPermissionSetOut, with all six ofAPI_PermissionSet's members andCreatedDateasEpochSeconds.ListInstances' map now rendersEpochSeconds(inst.CreatedDate).The stored records are unchanged.
SSOInstanceandSSOAccountAssignmentwere already builtmember 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:
CreateAccountAssignmentandListAccountAssignmentspublishAccountId, the account anassignment targets, which is the service's own data.
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.godrives 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
AccountIDback first. After the walk, it requires the permission set to carry noInstanceArn, and pinsCreatedDateat1700000000.000on a frozen clock in all three responsesthat carry it.
Negative controls (each run, then restored)
describePermissionSetreverted to the record/DescribePermissionSet, with$.PermissionSet.AccountIDListInstances' date back totime.Time/ListAccountAssignmentsfalsely fails on the publishedAccountId, which is why the comparison is exactDeleteAccountAssignment's status object carries onlyRequestIdandStatus, which is a #1199-stylemember gap. It is anchored on
AccountAssignmentDeletionStatusand left as is.The ratchet
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.