Files
floci/docs
Priamo Germosen 4eea01741f feat(sts): dispatch GetAccessKeyInfo, the account an access key id belongs to (#6121)
GetAccessKeyInfo answered UnsupportedOperation 400. It takes one member and
answers one: "when you pass an access key ID to this operation, it returns the
ID of the AWS account to which the keys belong", and it models no errors at all,
so the whole operation is that lookup plus the shape of its input.

The lookup is not the one authentication uses. resolveAccountId takes only an
active long-term key and a live session, because that is what a request may be
signed with, where this operation is explicit about the opposite: "this
operation does not indicate the state of the access key. The key might be
active, inactive, or deleted". So findAccountForAccessKeyId answers from what is
stored whatever state it is in, a long-term key through the account that holds
it and an ASIA key through the session that minted it, which is the split the
page draws between AKIA as "long-term credentials for an IAM user or the AWS
account root user" and ASIA as "temporary credentials that are created using AWS
STS operations". Both long-term lookups read one scan now, the authentication
one keeping the Active filter over what the new one answers whole, so the guard
and the scan are written once.

The id is read against accessKeyIdType first, 16 to 128 characters of [\w],
which the reference glosses as "any upper- or lowercase letter or digit", so a
malformed id answers for its own shape rather than for a key that could not
exist. The violation is rendered the way the one recorded IAM rendering Floci
already follows renders it, the member in lower camel case and the offending
value quoted beside it; the older STS operations name the parameter as written
instead, which is drift of its own rather than something to copy here. An absent
member and a present empty one are different answers as well: only the absent
one reads as null, where AccessKeyId= is a value that fails the minimum and is
quoted as the empty string it is, which is what IAM answers for an empty
RoleName over this same wire.

One answer is chosen rather than read. The operation models no error for a key
that is not there, and the page says only that "providing a deleted access key
might return an error that the key doesn't exist", so a well-formed id this
emulator never issued answers InvalidParameterValue, the published common error
closest to that sentence. docs/services/sts.md records it as a deviation rather
than a recorded behaviour, since nothing says what AWS answers for an id it
never issued.

Enforcement is untouched on purpose. The "No permissions are required" note
appears on GetCallerIdentity and GetSessionToken and on no other page in the
reference, and sts:GetAccessKeyInfo is in the service authorization reference, so
this one is authorized like any other action rather than exempted the way
GetCallerIdentity is.

Ten tests. Five over the wire: a long-term key answering the account that holds
it, an inactive key still answering it, a session key answering the account its
session belongs to, four shapes refused ahead of any lookup, and a well-formed
id nobody holds. Five on the handler: the account answered and the
authentication path not consulted, the absent, short, long and malformed ids, a
present blank id read as a value rather than an absence, and the refusal for a
key the service does not hold. Docs carry the action, a
section on what it does and does not say about the key, and the matrix row at 9.
2026-10-21 18:37:12 -05:00
..
2026-03-15 17:43:56 -05:00