Files
floci/docs
Priamo Germosen 4c55ec6b77 feat(sts): vend a signed web identity token for the calling identity (#6517)
GetWebIdentityToken is the last operation the pinned STS model publishes and
Floci did not dispatch, which takes STS to 11 of 11. It answers "a signed JSON
Web Token (JWT) that represents the calling Amazon Web Services identity",
signed by STS and verifiable against the keys the issuer publishes.

The issuer is IAM's. Outbound web identity federation mints one issuer URL per
account, so the token names it as iss and the operation reads the switch behind
it: while the feature is off the answer is
OutboundWebIdentityFederationDisabledException, not the FeatureDisabled the IAM
getter answers. SessionDurationEscalationException is the other refusal with a
published trigger, for a caller on temporary credentials asking for a token
that would outlive its own session, "beyond what was granted when the session
was originally created". JWTPayloadSizeExceededException is modelled and
nothing published says what the maximum payload is, so no size is invented here
to refuse a request with.

A temporary credential with no live session behind it is refused as expired
rather than read as a caller that cannot be identified. IamEnforcementFilter
answers ExpiredTokenException for one and it never reaches the operation, but
with enforcement off, or in the window between that check and this one, the
session lookup comes back empty and the caller would fall to the account root
ARN this file hands an unresolvable caller, as GetCallerIdentity does. A token
is not a request: its subject is signed and outlives the call, so a session
already gone does not get one that speaks for the account, while an unknown
long-term key keeps the stand-in. The filter's wording is shared rather than
copied a second time.

The declared constraints are read ahead of all of it, as #6402 put them
elsewhere in this package: Audience required and 1 to 10 members of 1 to 1000
characters, SigningAlgorithm required at a fixed length of 5, DurationSeconds
60 to 3600 defaulting to 300, and Tags at most 50 with its keys and values held
to their own lengths and pattern. A member sent empty is a member that is
present, breaking its length rather than reading as absent, and a list member's
violation names the index the request sent rather than the number it reads as,
which is what #6478 settled.

The claim layout is the IAM User Guide's. The standard OIDC claims sit at the
top level, iss, aud, sub, iat, exp and jti, with the caller's ARN as the
subject, and the custom claims are nested under the https://sts.amazonaws.com/
namespace the guide names: aws_account for the account the token was asked for,
source_region for the region it was asked from, and the request's tags under
request_tags. "All these claims may not be present in a token at the same
time", so the organization, principal tag and session context claims the guide
also lists are left out rather than invented, and request_tags is absent from a
token whose request named none. The nesting is also what keeps a tag off a
claim STS sets, a tag named exp being a key under request_tags rather than the
claim that chooses the token's lifetime.

Two answers are readings and docs/services/sts.md says so. The model publishes
no enum for SigningAlgorithm, only the fixed length, so a five-character value
that is neither RS256 nor ES384 is answered with this package's enum violation
over the two values the reference names. The global endpoint refusal borrows
the wording AWS publishes for AssumeRoot, the note for this operation giving
none of its own.

Signing goes through a new core.common helper rather than a third copy of the
assembly: Cognito and EKS each already sign a JWT, and EksOidcService moves
onto it here. ES384 signs through the JDK's P1363 variant, so the signature is
the raw R || S pair JWS defines rather than the DER sequence a default ECDSA
signer returns. Each account's key is minted on first use per algorithm and
stored, so a restart does not invalidate a token already handed out.

Eleven tests over the wire, including the claim set with the namespaced
account and region, both signature shapes by their exact lengths, the tags
arriving under request_tags rather than as claims of their own, the ceiling the
caller's own session puts on a token, the refusal for a session already gone,
and the constraints read while the feature is off.
Beside them, a unit test verifies a minted token against the public half of the
stored key for both algorithms, a length being no evidence of what was signed,
and holds that one token's signature does not verify over another's claims; and
the handler test takes the session ceiling to its own boundary on a fixed clock,
where a token ending exactly with the session is issued, one ending a second
later is refused, and nothing is minted on the refusal.

What is not here is the other half: nothing publishes the verification key yet,
so the discovery documents the issuer URL would host are not served, and the
docs say that plainly.
2026-10-25 21:15:35 -05:00
..
2026-03-15 17:43:56 -05:00