Skip to content

fix(iam): entity shapes over- and under-report documented members #807

Closed

Description

@scttfrdmn

What

Substrate's IAM entity shapes both over- and under-report members the IAM API reference
documents, independently of tags (#796, which covers Tags only).

Over-reported. ListUsers and ListRoles render PermissionsBoundary
(emulator/iam_xml.go:90-96, :168-174), which AWS's own note on those operations excludes
verbatim (https://docs.aws.amazon.com/IAM/latest/APIReference/API_ListRoles.html):

IAM resource-listing operations return a subset of the available attributes for the resource. This
operation does not return the following attributes, even though they are an attribute of the
returned object: PermissionsBoundary, RoleLastUsed, Tags. To view all of the information for a
role, see GetRole.

A consumer reading a boundary off a list response gets one here and nothing on AWS — a divergence in
the direction where substrate is more generous than the service.

Under-reported.

  • IAMUser.PasswordLastUsed exists on the record (emulator/iam_types.go:26) and is never
    rendered; AWS's User type documents it.
  • RoleLastUsed is neither stored nor rendered; AWS's Role type documents it, and GetRole
    returns it.
  • iamPolicyXMLFields (iam_xml.go:236-262) omits Description, IsAttachable and
    PermissionsBoundaryUsageCount, all documented on AWS's Policy type — and substrate stores
    Description and IsAttachable already (iam_types.go:60, :63).

Why now

#796's work splits iamUserXMLFields and iamRoleXMLFields by shape — single-entity versus listing
— precisely because the same AWS note that excludes Tags from the list shapes also excludes
PermissionsBoundary. Once that split exists, dropping the boundary from the list shapes is a
one-line change in a helper that will already be under test. Filed rather than folded so it gets its
own compatibility note: a consumer reading PermissionsBoundary off ListUsers today stops
getting it.

Found while surveying the IAM response shapes for #796 during v0.112.0 planning.

Acceptance criteria

  • ListUsers and ListRoles no longer render PermissionsBoundary, with AWS's note cited
  • PasswordLastUsed is rendered where AWS documents it, from the field already stored
  • Description, IsAttachable and PermissionsBoundaryUsageCount are decided for the policy
    shape — rendered from what is stored, or stated as unmodelled with the reason
  • RoleLastUsed is decided the same way: modelled (it needs a write on every role use, which is
    a design question) or documented as out of scope
  • docs/services.md records which members each IAM shape reports and which AWS omits by design

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: iamtype: bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions