Repository navigation
test(#756): pin IAM's projections and record them - #1346
Merged
Merged
Conversation
IAMRole and IAMUser declare ever_tagged and IAMAccessKey declares AccountId, all ,omitempty, and none reaches a response: every IAM response is marshaled from an XML struct declared for its operation. So IAM was already projected and lacked only the citation. emulator/iam_wire_test.go drives every operation that answers one of the three records, including those that render it nested (GetGroup, the instance-profile reads, GetAccountAuthorizationDetails). Each reads its member back from the stored record before asserting absence; the role and user are tagged first, since only a tag write sets ever_tagged. check-wire-bookkeeping goes from 243 projected across 100 records to 246 across 103, and from 67 still reachable to 64. #756 stays open.
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 first of ten PRs in #756's 3-line block. IAM turns out to be citation only: no
production code changes.
IAM is already projected
The three records each declare one bookkeeping member, and all three members are
,omitempty:IAMRole.EverTaggedandIAMUser.EverTagged, asever_tagged.IAMAccessKey.AccountID, asAccountId. An access key's ID is what determines the account, so theaccount cannot be in its state key (iam: state keys are account-blind, so an entity resolves by name across accounts #737).
None reaches a body. IAM speaks the query protocol, every response is marshaled from an XML struct
declared for its operation, and no XML-tagged field is typed as one of these records.
What the new test asserts
emulator/iam_wire_test.gouses the sharedwireAssertNoMemberXMLand drives every operation thatanswers one of the records, including those that render it nested:
IAMRoleIAMUserIAMAccessKeyEvery member is
,omitempty, so each would be absent for free from a record that did not holdit. Each test therefore proves the record holds it first:
ever_tagged: trueis read back. Only a tag write sets it(fix(tagging): GetResources reports untagged resources, which AWS omits #938, fix(#756): render EFS responses from the published shape #1304).
AccountIdis read back.CreateAccessKeywrites it on every key.The tests find each record's key by listing the namespace rather than building it, so they do not
depend on the account the test server resolves to.
Negative controls (each run, then restored;
iam_xml.goverified diff-free)ever_taggedintoGetRole,EverTaggedintoGetUserandAccountIdintoListAccessKeys, throughiamXMLResponse. Exactly three failures, one per test,each on that operation.
TagRoleremoved, the role test fails at theever_taggedread-back.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.