Skip to content

test(#756): pin IAM's projections and record them - #1346

Merged
scttfrdmn merged 1 commit into
mainfrom
test/756-iam-wire-projections
Oct 3, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
test/756-iam-wire-projections

Conversation

@scttfrdmn

Copy link
Copy Markdown
Owner

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:

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.go uses the shared wireAssertNoMemberXML and drives every operation that
answers one of the records
, including those that render it nested:

Record Operations
IAMRole CreateRole, TagRole, GetRole, ListRoles, ListRoleTags, UpdateAssumeRolePolicy, AddRoleToInstanceProfile, GetInstanceProfile, ListInstanceProfiles, GetAccountAuthorizationDetails, RemoveRoleFromInstanceProfile, UntagRole, DeleteRole; plus CreateServiceLinkedRole, which mints a role too
IAMUser CreateUser, TagUser, GetUser, ListUsers, ListUserTags, AddUserToGroup, GetGroup, ListGroupsForUser, GetAccountAuthorizationDetails, RemoveUserFromGroup, UntagUser, DeleteUser
IAMAccessKey CreateAccessKey, ListAccessKeys, DeleteAccessKey

Every member is ,omitempty, so each would be absent for free from a record that did not hold
it.
Each test therefore proves the record holds it first:

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.go verified diff-free)

  1. Per-record isolation. I injected ever_tagged into GetRole, EverTagged into GetUser and
    AccountId into ListAccessKeys, through iamXMLResponse. Exactly three failures, one per test,
    each on that operation.
  2. The vacuity guard. With TagRole removed, the role test fails at the ever_tagged read-back.

The ratchet

before: 319 declared, 243 projected across 100 records, 9 internal across 6 records, 67 still reachable
after:  319 declared, 246 projected across 103 records, 9 internal across 6 records, 64 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.

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

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 7ddcefb into main Oct 3, 2026
18 checks passed
@scttfrdmn
scttfrdmn deleted the test/756-iam-wire-projections branch October 3, 2026 02:38
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