Repository navigation
feat(iam): report the members AWS documents per entity shape (#807) - #821
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Substrate's IAM entity shapes both over- and under-reported members the IAM API reference
documents, independently of tags (#796 covered
Tagsonly). This makes each shape report what AWSdocuments for that shape, reusing the single-entity/list split #796 built.
Over-reported.
ListUsersandListRolesrenderedPermissionsBoundary, which AWS's note onboth operations excludes by name — in the same sentence that excludes
Tags:That is a divergence in the direction where the emulator is more generous than the service, so a
consumer could write an assertion against a list response that AWS never satisfies and only find
out against real IAM. The boundary moves into a single-entity-only helper beside
iamEntityTagsXML. The users nested in aGetGroupresponse and the roles nested in aninstance-profile shape are list shapes too and carry no boundary for the same reason — neither
GetGroup's norGetInstanceProfile's sample response renders one.Under-reported.
IsAttachableandDescriptionhave been stored sinceCreatePolicyand werenever rendered, so a consumer setting a description could not read it back at all.
IsAttachablereaches both policy shapes (AWS's
Policytype documents it with no operation restriction, andListPolicies' sample renders it on every member);Descriptionis single-entity-only, and thereAWS says so about the member itself: "This element is included in the response to the GetPolicy
operation. It is not included in the response to the ListPolicies operation."
PasswordLastUsedreaches both user shapes per "This value is returned only in the GetUser and ListUsers
operations" — the issue had this one backwards. Nothing assigns it, since no password operation is
modeled, so it is omitted in every ordinary run, which is what AWS reports for a user who never
signed in with a password.
Two members stay unmodeled, each filed with its cost rather than guessed at:
PermissionsBoundaryUsageCount(#815) needs either a scan of every user and role per policy read —making
ListPoliciesO(policies × entities) — or a counter across the four boundary operationsplus the entity deletes that drop a boundary implicitly, which must agree with a count rebuilt by
replay.
RoleLastUsed(#816) needsAssumeRoleto write an IAM record, substrate's first write ona path whose purpose is not to mutate, plus a nested response type and the request's region.
Tests
New
emulator/iam_shape_members_test.go, asserting against raw XML rather than a decoded map:a map cannot tell an absent member from an empty one, since both are the zero value. Each absence
assertion also anchors on an element that must be present, so it cannot pass against a listing that
returned nothing. Against
mainthe three new-behaviour tests fail (ListUsers/ListRolesreporta boundary; no
IsAttachable,DescriptionorPasswordLastUsedanywhere).Compatibility
ListUsersandListRolesstop reportingPermissionsBoundary; the policy shapes start reportingIsAttachable,GetPolicystarts reportingDescription, and the user shapes gainPasswordLastUsed(always omitted in practice). A consumer asserting an exact member set on any ofthose responses sees the change.
Verification
gofmt/go build/go vet/golangci-lintclean;make testandGOTOOLCHAIN=go1.26.6 make testpass; coverage holds at the baseline (emulator 83.7%, total 83.1%); docs reference, version and
authz-reference checks pass;
npm --prefix docs run buildand the e2e suite pass.Closes #807