Skip to content

STS ​

Parity grade: A · SDK aws-sdk-go-v2/service/sts@v1.51.4 · last audited 2026-10-11 (0c0472570)

Category: Identity & Access · View PARITY.md on GitHub · All Services

In-memory STS: caller identity, role assumption, session tokens, federation.

Quick start ​

bash
export AWS_ENDPOINT_URL=http://localhost:8000

aws sts get-caller-identity
aws sts assume-role --role-arn arn:aws:iam::000000000000:role/MyRole \
    --role-session-name my-session
aws sts get-session-token --duration-seconds 7200
aws sts get-federation-token --name my-federated-user
aws sts assume-role-with-web-identity \
    --role-arn arn:aws:iam::000000000000:role/WebIdentityRole \
    --role-session-name wi-session --web-identity-token "$JWT"
aws sts assume-role-with-saml \
    --role-arn arn:aws:iam::000000000000:role/SAMLRole \
    --principal-arn arn:aws:iam::000000000000:saml-provider/MyIdP \
    --saml-assertion dGVzdA==

Supported operations ​

AssumeRole, AssumeRoleWithSAML, AssumeRoleWithWebIdentity, AssumeRoot, GetCallerIdentity, GetSessionToken, GetFederationToken, GetAccessKeyInfo, DecodeAuthorizationMessage, GetDelegatedAccessToken, GetWebIdentityToken.

Behaviour ​

  • Responses use the configured account (--account-id / ACCOUNT_ID, default 000000000000) and region (--region / REGION, default us-east-1).
  • Issued credentials are accepted by Gopherstack and are not valid on real AWS.
  • RoleArn and RoleSessionName are validated as on AWS (session name 2-64 characters of [\w+=,.@:-]). Duration limits are checked per operation.
  • The role's trust policy is evaluated when the caller's ARN is known and the role has a trust policy. Otherwise the call is allowed. ExternalId and MFA conditions are checked.
  • Web-identity tokens are checked against registered OIDC providers.
  • A background janitor evicts expired sessions every STS_JANITOR_INTERVAL (default 30s).
  • GET /dashboard/api/sts/metrics returns session counts, sweep counters and per-operation call counts.

Differences from AWS ​

WARNING

MFA codes are not validated. SerialNumber and TokenCode must both be present and well-formed, but any code satisfies aws:MultiFactorAuthPresent.

  • Inline and managed session policies are validated and counted towards the packed-policy limit, but are not enforced.
  • JWTPayloadSizeExceededException is not raised: no documented size limit exists to enforce.

Parity & Coverage ​

MetricValue
PARITY entries audited11 (11 ok)
Feature families3 (3 ok)
Known gapsnone
Structural gaps (can't be emulated)1
Deferred items1
Resource leaksclean

Structural Gaps ​

These do not block an A grade — no implementation could produce real data here because the underlying data source cannot exist in an emulator.

  • JWTPayloadSizeExceededException has no numeric threshold in the SDK doc strings, validators or any AWS page checked (gopherstack-yewt); without a documented limit it cannot be enforced.

Deferred Items ​

  • SESSION-POLICY EVALUATION: session Policy/PolicyArns are validated for shape/size (MalformedPolicyDocument, PackedPolicyTooLarge) and PackedPolicySize is computed, but the policy document's content is not enforced against subsequent API calls (no IAM policy-evaluation engine wired to session credentials). This mirrors the rest of the emulator's authz model and is out of scope for a service-local sts audit.

Audited Operations ​

11 audited operations
OperationWireErrorsStatePersist
AssumeRolefixedokfixedok
AssumeRoleWithSAMLfixedokfixedok
AssumeRoleWithWebIdentityfixedokfixedok
AssumeRootfixedokfixedok
GetCallerIdentityokokokok
GetDelegatedAccessTokenfixedokfixedok
GetFederationTokenokokokok
GetSessionTokenokokokok
GetWebIdentityTokenfixedfixedfixedok
GetAccessKeyInfookokokok
DecodeAuthorizationMessageokfixedokn/a

Audited Feature Families ​

Feature FamilyStatus
trust-policy-evaluationok
session-tag-validationok
lockingok

Released under the MIT License.