IAM and authentication
Floci provides one IAM model for its emulated AWS services. It stores identities and credentials, creates temporary sessions, maps signed requests to AWS actions and resources, and applies shared policy decisions before a service handler runs. Services also reuse the same caller and public-policy rules.
Identity and credential model
IAM manages users, groups, roles, policies, access keys, and account-level identity settings. Long-lived access keys identify IAM users or account-root callers. Temporary credentials identify a role session, federated user, delegated caller, or another scoped session. IAM keeps this state account-scoped while retaining AWS-style global IAM ARNs (src/…/IamService.java• L100-112, src/…/IamService.java• L5236-5246, src/…/IamQueryHandler.java• L135-370).
The access key is the identity used by the shared request path. Other IAM credentials support their own workflows but do not replace that request identity (src/…/IamQueryHandler.java• L147-210, src/…/IamService.java• L370-471).
Temporary sessions
STS creates short-lived credentials with an expiration time and identity context for later authorization. The context can retain the issuing role, source account, long-lived issuer, approving identity, and a session policy that narrows the caller's permissions (src/…/SessionCredential.java• L12-61, src/…/StsQueryHandler.java• L144-240, src/…/StsQueryHandler.java• L527-556, src/…/IamService.java• L5252-5313).
Some sessions carry a narrow purpose. Presigned S3 sessions are limited to one action and object. Internal transfers use a restricted resource. Runtime sessions retain the service identity needed by Lambda, EC2, or ECS. MFA-backed sessions retain authentication time for later policy checks. These limits remain part of the authorization context and do not become general customer permissions (src/…/SessionCredential.java• L29-76, src/…/IamEnforcementFilter.java• L501-549, src/…/IamEnforcementFilter.java• L778-798).
The session path is:
flowchart LR
A[Long-lived or federated caller] --> B[Trust and proof checks]
B -->|allowed| C[Temporary credentials]
B -->|denied| D[No session]
C --> E[Session identity and account context]
E --> F[SigV4 caller resolution]
F --> G[Shared authorization decision]
References: src/…/SessionCredential.java• L12-61 src/…/StsQueryHandler.java• L173-240 src/…/IamService.java• L5252-5313
Multi-factor authentication
Virtual MFA devices exist independently until a user enables one. STS accepts a current one-time code when a caller requests a session or assumes a role. A successful GetSessionToken session carries MFA context into later authorization. An assumed-role session uses MFA for its trust check but does not create a new later MFA claim (src/…/VirtualMfaDevice.java• L11-39, src/…/StsQueryHandler.java• L327-399).
References: src/…/VirtualMfaDevice.java• L11-39 src/…/StsQueryHandler.java• L327-399
IAM control plane
The IAM Query surface creates and manages the identity objects that later feed authorization. It also exposes policy simulation, access reports, federation providers, root-session features, and delegation requests. Request-shape checks happen before an operation runs, so malformed input is a control-plane validation error rather than a policy result (src/…/IamQueryHandler.java• L135-378).
IAM validates policy text when a caller creates or updates it. Trust policies must have policy-shaped JSON, a principal, and STS actions. Identity policies must have valid policy structure and valid action, resource, version, and effect values. This prevents malformed input from becoming stored authorization state (src/…/IamPolicyDocuments.java• L125-219, src/…/IamPolicyDocuments.java• L221-285, src/…/TrustPolicyStatements.java• L19-60).
Trust-policy validation and permission-policy validation serve different documents. A trust policy describes who can create a role session, so it does not use the action-and-resource requirements of an identity policy. A permission policy describes actions on resources and cannot contain a principal (src/…/IamPolicyDocuments.java• L125-185, src/…/IamPolicyDocuments.java• L197-287).
References: src/…/IamQueryHandler.java• L135-378 src/…/IamPolicyDocuments.java• L125-285 src/…/TrustPolicyStatements.java• L19-60 src/…/IamService.java• L1877-1926
Policy decision model
Policies state which actions a caller may perform on resources under given conditions. A live request can combine identity policies, group policies, resource policies, session policies, permission boundaries, and organization limits. The shared evaluator gives all emulated services the same meaning for these policy sources.
Policy sources
The decision uses these policy layers:
- Identity policies grant permissions to a user or role. Group policies add grants to a user.
- Resource policies grant or deny access on a target resource and identify its owner.
- Session policies narrow temporary credentials.
- Permission boundaries cap what a user or role can use.
- Service control policies cap an account inside an organization.
The caller context carries the identity policies, session policy, boundary, principal ARN, and SCP levels. Simulation contexts can also retain the source of each identity policy so a result can explain which input supplied a matching statement. Service policy providers add the target resource policy and its owner account. A missing resource policy is not an allow (src/…/IamPolicyEvaluator.java• L146-167, src/…/IamPolicyEvaluator.java• L168-225, src/…/CallerContext.java• L7-31, src/…/PolicySource.java• L3-22).
References: src/…/IamPolicyEvaluator.java• L146-225 src/…/CallerContext.java• L7-31 src/…/PolicySource.java• L3-22
Action and condition matching
Action matching starts with the operation that the service will execute. Query requests use their action or operation member. JSON requests use X-Amz-Target. REST requests use the matched route. AWS action aliases and actions with no resource type are applied after the operation is known. Action patterns are case-insensitive, while resource names and most condition values keep their AWS-defined case rules (src/…/IamActionRegistry.java• L538-567, src/…/IamActionRegistry.java• L597-640, src/…/IamPolicyEvaluator.java• L2178-2198).
REST authorization cannot be changed by a caller-supplied Action, Operation, or X-Amz-Target. The registry matches the method and path that reached the handler. It can use a modeled route when an explicit rule is not present. If no safe mapping exists, the action is unknown and ordinary credentials retain Floci's compatibility allow (src/…/IamActionRegistry.java• L597-640).
Action matches when one pattern matches the request. NotAction matches when none of its patterns match. Resource and NotResource use the same pattern idea for the target ARN. Conditions combine as an AND between condition blocks and an OR among values in one block. The request context combines request members with stored resource tags and values, then adds account, region, principal, and request-time facts. Organization context keys come from the principal's account when that account belongs to an organization (src/…/IamConditionContextResolver.java• L516-600, src/…/IamConditionContextResolver.java• L1204-1275, src/…/IamPolicyEvaluator.java• L1247-1321, src/…/PrincipalOrganization.java• L20-67).
Condition data is taken from the request and from the resource state that the request names. The resolver supports service-specific data such as S3 object tags, EC2 resource fields, DynamoDB keys, and IAM request tags. It keeps a separate context for each target, so one target's tags or values cannot satisfy a condition for another target (src/…/IamConditionContextResolver.java• L178-220, src/…/IamConditionContextResolver.java• L971-1011, src/…/IamConditionContextResolver.java• L1290-1430).
References: src/…/IamActionRegistry.java• L538-640 src/…/IamConditionContextResolver.java• L178-220 src/…/IamConditionContextResolver.java• L516-600 src/…/IamConditionContextResolver.java• L971-1011
Principal matching
Resource policies distinguish the caller they name from an account they name. IAM users, roles, role sessions, account principals, service principals, anonymous callers, and S3 canonical users use their matching principal form. A role session can match both its session ARN and the role ARN that issued it. A service principal has no IAM identity context, so its resource policy is the deciding grant (src/…/IamPolicyEvaluator.java• L416-430, src/…/IamPolicyEvaluator.java• L1314-1477, src/…/RequestCallerResolver.java• L11-42).
Shared public-policy checks use one meaning for wildcard principals. A resource policy is public unless its conditions restrict that wildcard to a fixed trusted value, account-scoped ARN, or sufficiently narrow source range. Services such as S3, Lambda, and Aurora DSQL use these shared rules before they accept or report a public policy (src/…/PolicyDocument.java• L8-89, src/…/PublicAccessConditions.java• L10-89).
References: src/…/IamPolicyEvaluator.java• L1314-1477 src/…/RequestCallerResolver.java• L11-42 src/…/PolicyDocument.java• L8-89 src/…/PublicAccessConditions.java• L10-89
Resource matching
Resource matching turns request data into the ARN that a policy statement must name. Existing resources use their stored ARN. Create operations build an ARN from the requested name and path. Rename operations check both the old and new ARN. A request with several target resources is checked against each target (src/…/ResourceArnBuilder.java• L151-215, src/…/ResourceArnBuilder.java• L425-461).
Request members can come from Query forms, JSON, CBOR, or REST alternatives. IAM buffers a request body before reading it and restores the stream so authorization does not change the body received by the service handler. Routes documented outside the normal service model are marked as carrying no operation members, which prevents caller-supplied body values from becoming authorization inputs (src/…/IamConditionContextResolver.java• L1187-1275, src/…/IamActionRegistry.java• L661-669).
Delegation requests expose their recorded owner through a stored-resource lookup so the owner condition uses current request state. STS uses the same lookup boundary for role targets and confirms that a cross-account role ARN names a role held by IAM before the shared evaluator treats it as a reached resource (src/…/ResourceArnBuilder.java• L377-423, src/…/IamStoredResourceArns.java• L12-65, src/…/StsStoredResourceArns.java• L11-57).
References: src/…/ResourceArnBuilder.java• L151-215 src/…/ResourceArnBuilder.java• L377-423 src/…/IamStoredResourceArns.java• L12-65 src/…/StsStoredResourceArns.java• L11-57 src/…/IamConditionContextResolver.java• L1187-1275
Authorization outcomes
The evaluator first checks explicit denies and organization limits. It then finds a base grant. Same-account access can use an identity grant or a resource grant. Cross-account access needs a grant from the caller and a grant from the resource owner. Session policies and permission boundaries remain ceilings on the result (src/…/IamPolicyEvaluator.java• L241-325, src/…/IamPolicyEvaluator.java• L829-865).
The decision flow is:
flowchart TD
A[Caller action resource and context] --> B{SCP levels allow}
B -->|no| X[Deny]
B -->|yes| C{Explicit deny}
C -->|yes| X
C -->|no| D{Base grant}
D -->|no| Y[Implicit deny]
D -->|yes| E{Cross-account}
E -->|no| F[Apply session and boundary ceilings]
E -->|yes| G{Caller and owner grants}
G -->|no| X
G -->|yes| F
F -->|fails| X
F -->|passes| H[Allow]
The shared enforcement path obtains resource policies from the service that owns the action's resource. It evaluates each resource with its own tags, stored values, owner account, and global context. This prevents a grant for one target from authorizing another target in the same request (src/…/IamEnforcementFilter.java• L1194-1283).
References: src/…/IamPolicyEvaluator.java• L241-325 src/…/IamPolicyEvaluator.java• L337-405 src/…/IamPolicyEvaluator.java• L829-865 src/…/IamEnforcementFilter.java• L1194-1283
Trust policies
A trust policy controls who may create a role session. It is separate from a permission policy, which controls what the session may do after it exists. Direct role assumption checks the STS action, principal, and request conditions. Account principals delegate the final decision to the caller's account policies, while a caller-specific match grants that caller directly (src/…/AssumeRolePolicyEvaluator.java• L61-74, src/…/AssumeRolePolicyEvaluator.java• L154-207, src/…/StsQueryHandler.java• L401-459).
For ordinary role assumption, the role trust document also enters the shared resource-policy path for STS actions that target an IAM role. The provider adds the role ARN to statements that omit a resource and keeps the role's account as the resource owner. A missing or unreadable role document therefore cannot become an accidental same-account grant (src/…/RoleTrustPolicyProvider.java• L19-29, src/…/RoleTrustPolicyProvider.java• L47-112).
Trust evaluation uses one shared statement shape. An explicit deny wins, a matching allow is required, and malformed statements or conditions do not become allows. Service callers, OIDC callers, and SAML callers use their matching principal type and proof data (src/…/TrustPolicyStatements.java• L19-60, src/…/AssumeRolePolicyEvaluator.java• L209-319, src/…/WebIdentityTrustPolicyEvaluator.java• L89-226, src/…/SAMLTrustPolicyEvaluator.java• L27-121).
Federated trust checks are narrow by design. Web identity requires a matching federated OIDC provider and issuer-bound claims such as sub or aud; claim comparisons are case-sensitive and unsupported condition operators fail closed. SAML requires a matching federated provider, the SAML assume action, and supported string conditions over assertion claims or sts:RoleSessionName (src/…/WebIdentityTrustPolicyEvaluator.java• L103-167, src/…/WebIdentityTrustPolicyEvaluator.java• L169-252, src/…/SAMLTrustPolicyEvaluator.java• L53-121).
References: src/…/RoleTrustPolicyProvider.java• L19-112 src/…/StsStoredResourceArns.java• L39-57 src/…/StsQueryHandler.java• L401-459 src/…/TrustPolicyStatements.java• L19-60 src/…/WebIdentityTrustPolicyEvaluator.java• L89-252 src/…/SAMLTrustPolicyEvaluator.java• L27-121
Policy simulation
IAM simulation answers the same policy question without running a service operation. A principal simulation starts with the resolved identity's policies and can add policy input, a replacement boundary, organization levels, context values, and resources. A custom simulation uses the supplied policies as its identity policies (src/…/IamQueryHandler.java• L2190-2251).
Each requested action produces one aggregate result across its resources. The result can also show each resource's decision, matched policy statements, missing context keys, and the effect of organization and boundary limits. Statement positions point back to the source policy text, and action resource templates explain the resource type rather than naming a customer resource (src/…/IamQueryHandler.java• L2402-2484, src/…/PolicyStatementPositions.java• L12-29, src/…/SimulatedResourceTemplates.java• L11-39).
References: src/…/IamQueryHandler.java• L2190-2251 src/…/IamQueryHandler.java• L2402-2484 src/…/PolicyStatementPositions.java• L12-29 src/…/SimulatedResourceTemplates.java• L11-39
SigV4 enforcement
The shared filter converts a signed HTTP request into a credential, service scope, action, resource, condition context, and policy decision before the target handler runs. It reads credentials from the Authorization header or a presigned URL. Presigned POST requests are checked after the multipart form exposes their credential. Service operations marked as requiring no authentication can remain unsigned (src/…/IamEnforcementFilter.java• L355-407, src/…/IamEnforcementFilter.java• L843-873).
The filter checks the access key before it applies permissions. Unknown keys, inactive keys, expired sessions, unreadable credentials, and mismatched temporary-session data are rejected. Unknown action mappings retain Floci's compatibility allow for ordinary credentials. sts:GetCallerIdentity and sts:GetSessionToken remain callable after credential checks because AWS does not control those authentication operations with permission policies (src/…/IamEnforcementFilter.java• L390-471).
The enforcement flow is:
flowchart LR
A[Signed request] --> B[Read credential and signing scope]
B --> C[Resolve serving service and action]
A --> D[Read route query and body data]
D --> E[Build resource ARN and condition context]
B --> F[Resolve caller policies]
C --> F
E --> F
F --> G[Evaluate grants and ceilings]
G --> H[Run handler or return denial]
Each target in a multi-resource request is checked. The same path also checks passed roles, forwarded service actions, tag-on-create permissions, connector permissions, and service-specific permission requirements (src/…/IamEnforcementFilter.java• L521-739, src/…/IamEnforcementFilter.java• L957-1107).
References: src/…/IamEnforcementFilter.java• L355-471 src/…/IamEnforcementFilter.java• L521-739 src/…/IamEnforcementFilter.java• L1194-1283
Request authorization mapping
The action registry and resource builder form one authorization contract. The registry identifies the AWS action for the dispatched operation. The builder identifies the resource or resources named by that operation. Resource-policy providers can then replace or enrich the resource view owned by the serving service. Query, JSON, RPC, REST, and S3 sub-resource requests reach the same policy evaluator through protocol-specific mapping (src/…/IamActionRegistry.java• L538-567, src/…/IamActionRegistry.java• L615-640, src/…/IamEnforcementFilter.java• L1215-1269).
REST requests use the route that actually matched. A caller-supplied Action, Operation, or X-Amz-Target cannot change the REST action. S3 Control routes are selected before S3 data-plane query overrides because both use the s3 signing scope. Ambiguous routes are refused rather than authorized as one of several possible operations (src/…/IamEnforcementFilter.java• L407-463, src/…/IamActionRegistry.java• L522-535, src/…/IamActionRegistry.java• L719-731).
References: src/…/IamActionRegistry.java• L538-640 src/…/IamActionRegistry.java• L719-731 src/…/IamEnforcementFilter.java• L407-463 src/…/IamEnforcementFilter.java• L1215-1269
Passed-role authorization
Some requests pass a customer role to a receiving service. The request must first pass its own action and resource decision. Each discovered role then needs a separate iam:PassRole allow with the receiving service as context (src/…/IamEnforcementFilter.java• L624-631, src/…/IamEnforcementFilter.java• L957-980).
Service-owned lookups find roles in task definitions, launch resources, StackSets, or other service state. This keeps IAM independent from those resources while still applying the same role-passing rule (src/…/PassedRoleLookup.java• L6-70, src/…/PassedRoles.java• L93-205).
References: src/…/IamEnforcementFilter.java• L624-631 src/…/IamEnforcementFilter.java• L957-980 src/…/PassedRoleLookup.java• L6-70 src/…/PassedRoles.java• L93-205
Service role authorization
Service role authorization lets an emulated service act through a customer-owned role. IAM checks account ownership and trust before the service acts. The downstream work then uses the role's permissions, boundary, and SCP limits (src/…/ServiceRoleAuthorizer.java• L17-110).
This differs from a customer-signed request. The service assumes the role, and a failed trust check or one missing downstream permission stops the service operation.
References: src/…/ServiceRoleAuthorizer.java• L17-110
Privileged root sessions
STS can issue a short-lived session that acts as the root user of an eligible member account. Organization membership, caller type, regional use, and a permitted task policy must all pass before issuance. The task policy limits the session, so the privileged work still enters the shared authorization path with a narrower ceiling than unrestricted root access (src/…/StsQueryHandler.java• L935-1014, src/…/IamEnforcementFilter.java• L488-519).
References: src/…/StsQueryHandler.java• L935-1014 src/…/IamEnforcementFilter.java• L488-519
Federation and delegated access
Federation and delegation add proof or approval before STS issues credentials. After issuance, each session follows the same caller, account, action, resource, and policy checks as other temporary credentials.
Web identity and SAML federation
Web identity federation verifies a trusted OIDC issuer, token claims, the target role, and the role's federated trust policy. SAML federation verifies the registered provider, signed assertion, requested role-provider pair, and SAML trust conditions (src/…/StsQueryHandler.java• L559-726, src/…/StsQueryHandler.java• L759-825, src/…/WebIdentityTrustPolicyEvaluator.java• L44-252, src/…/SAMLTrustPolicyEvaluator.java• L23-121).
Outbound web identity federation lets an account issue a signed JWT for a temporary caller. The issuer has stable account signing keys and publishes verification keys for relying parties. The token carries standard identity claims plus account, source-region, and request-tag claims under the AWS namespace (src/…/StsQueryHandler.java• L1143-1239, src/…/WebIdentityTokenIssuer.java• L33-45, src/…/WebIdentityTokenIssuer.java• L103-167).
References: src/…/StsQueryHandler.java• L559-726 src/…/StsQueryHandler.java• L759-825 src/…/WebIdentityTrustPolicyEvaluator.java• L44-252 src/…/SAMLTrustPolicyEvaluator.java• L23-121 src/…/WebIdentityTokenIssuer.java• L103-167 src/…/StsWebIdentityWellKnownController.java• L25-95
Delegated access
Delegated access lets a partner request temporary credentials that act in a customer account. The partner creates the request. The customer claims it, approves or rejects it, and releases an exchange token. Only the creating partner account can redeem that token (src/…/DelegationRequestService.java• L34-63, src/…/DelegationRequestService.java• L188-245, src/…/StsQueryHandler.java• L901-932).
The delegated session acts in the customer's account as the approving identity. Its session policy narrows that identity's permissions. Registered partner boundaries can also limit roles created or managed through delegated access (src/…/StsQueryHandler.java• L910-932, src/…/IamService.java• L5347-5377).
References: src/…/DelegationRequestService.java• L34-63 src/…/StsQueryHandler.java• L901-932 src/…/IamService.java• L5347-5377
Organization guardrails and reports
Organizations adds limits above IAM permissions. IAM obtains the effective SCP levels for the caller's account and applies them during live authorization. IAM also exposes reports about policy reach and SCP reach. These reports describe possible access rather than recorded service use (src/…/IamPolicyEvaluator.java• L619-680, src/…/IamQueryHandler.java• L350-359).
Service control policies
An account inside an organization must pass every applicable root, OU, and account SCP level. Each level must allow the action and must not contain a matching explicit deny. An unreadable SCP denies because a broken guardrail must not open access (src/…/IamPolicyEvaluator.java• L829-865, src/…/IamPolicyEvaluator.java• L1100-1138).
References: src/…/IamPolicyEvaluator.java• L619-680 src/…/IamPolicyEvaluator.java• L829-865 src/…/IamPolicyEvaluator.java• L1100-1138
Access reports
Service last-accessed reports describe the services reachable from an entity's allow policies. Organization reports describe services that survive the SCP path. Floci stores the result when it generates the report, so later policy changes do not rewrite that snapshot (src/…/ServiceLastAccessedService.java• L18-89, src/…/OrganizationsAccessReportService.java• L25-38, src/…/OrganizationsAccessReportService.java• L77-165).
References: src/…/ServiceLastAccessedService.java• L18-89 src/…/OrganizationsAccessReportService.java• L25-38 src/…/OrganizationsAccessReportService.java• L77-165
Change checklist
When these files or sections are changed, remember to consider these:
- If action mapping changes, update route selection, action aliases, resource mapping, resource-policy provider lookup, and no-auth operation rules together.
- If REST route data changes, preserve method, encoded path, query markers, route priority, alternative member locations, and documented-route behavior.
- If policy document validation changes, keep trust-policy grammar and values separate from permission-policy values. Align write-time validation with evaluation-time parsing.
- If session identity changes, check expiry, account routing, session tokens, caller ARN, principal ARN, issuer identity, delegated approver, session policy, MFA time, and delegated boundaries together.
- If caller resolution changes, keep role-session matching, principal condition keys, account-root handling, organization context, and service-owned resource-policy checks aligned.
- If STS role authorization changes, keep role ARN reachability, role-account ownership, trust-policy resource handling, direct trust checks, and cross-account decisions aligned.
- If condition context changes, keep request members, stored resource tags, stored resource values, global keys, service-principal keys, federation claims, and per-target context separation aligned.
- If resource ARN rules change, preserve stored partitions, account ownership, create paths, rename targets, direct ARN inputs, delegation request IDs, and wildcard fallbacks.
- If delegation ownership changes, keep the automatic per-request grant aligned with claim state, owner identity, listing conditions, and request expiry.
- If federation changes, keep token verification, provider registration, trust conditions, issuer claims, discovery metadata, JWKS keys, and case-sensitive claim matching aligned.
- If simulation changes, keep supplied policy sources, statement positions, resource templates, missing context keys, scenario resources, and live decision rules aligned.
- If SCP or report behavior changes, keep live authorization ceilings separate from generation-time report snapshots.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A REST request uses a caller-supplied operation field instead of its matched route | The request can be authorized as the wrong action | Derive REST authorization from the matched method and path |
| A route table is stale, ambiguous, or malformed | An operation gets the wrong action or no safe mapping | Keep modeled route data ordered and refuse ambiguous routes |
| A trust or permission policy is stored without policy-shaped JSON | Evaluation sees no valid statements or a role cannot be assumed | Validate the document before the IAM write succeeds |
| A trust policy has no principal or grants a non-STS action | The trust document is accepted or evaluated with the wrong session scope | Apply trust-specific validation at role create and update |
| A web-identity condition uses a different issuer prefix or unsupported operator | A token can satisfy the wrong provider condition or fail in an unclear way | Bind claims to the token issuer and fail closed for unsupported operators |
A resource cannot be resolved and becomes * | A resource-specific policy cannot narrow the request | Add the request or stored-resource lookup needed to build the ARN |
| A temporary request omits or mismatches its session token | Credential lookup fails | Send the token issued with the temporary access key |
| A temporary session expires during separate credential lookups | Caller and expiry checks can disagree | Use one clock instant for session checks and caller resolution |
A passed role lacks iam:PassRole for the receiving service | The main action is allowed but the service operation is denied | Resolve every passed role and check the receiving service context |
| An SCP level denies, lacks an allow, or contains invalid policy text | The request is denied before identity grants apply | Check every effective organization level |
| A service-role trust or downstream permission check fails | The service cannot act through the customer role | Check ownership, trust, role permissions, boundary, and SCP limits |
| An STS role ARN is treated as a local resource or its trust policy is used for a non-STS action | A role assumption can receive the wrong account or trust decision | Resolve the role in the ARN account and apply its trust document only to STS role actions |
| A resource condition provider returns tags or stored values from another target | A policy can allow one resource by using another resource's context | Resolve and merge stored context separately for each target ARN |
| A delegated exchange token is redeemed by a non-creating account | The partner receives no customer session | Check the request's creating account before token expiry |
| A policy mapping consumes the request body | The service handler receives an empty request | Buffer and restore the body stream |
| An OIDC token issuer or JWKS route does not match the token issuer | A relying party cannot verify the token or STS rejects it | Keep issuer identity, discovery URL, key set, and signed token claims consistent |
| A wildcard principal is read in only one JSON shape | One service treats a public policy as private | Use the shared policy-document and public-condition rules |
| A simulation reports a position or source that does not match its policy input | Clients cannot explain the result or identify the deciding statement | Keep policy order, source metadata, and statement spans position-aligned |
| An MFA code is reused for the same time step | A second session is issued from one one-time code | Record the last accepted TOTP step for each virtual device |
Key files
| File | Why to read it |
|---|---|
| src/…/IamService.java | Owns IAM identities, credentials, sessions, policy catalogs, and caller context assembly |
| src/…/IamQueryHandler.java | Exposes IAM control-plane operations, including policies, simulation, reports, and delegation requests |
| src/…/SessionCredential.java | Shows the identity, account, expiry, MFA, and scope carried by temporary credentials |
| src/…/CallerContext.java | Defines the policy inputs shared by live authorization and simulation |
| src/…/IamPolicyEvaluator.java | Defines action, resource, condition, principal, grant, deny, boundary, SCP, and simulation decisions |
| src/…/IamPolicyDocuments.java | Defines write-time grammar and value checks for trust and permission policy documents |
| src/…/PolicyDocument.java | Defines shared wildcard-principal reading for resource-policy checks |
| src/…/PublicAccessConditions.java | Defines shared trusted-condition rules for public-policy checks |
| src/…/RoleTrustPolicyProvider.java | Exposes role trust policies as STS resource-policy input with the role account as owner |
| src/…/StsStoredResourceArns.java | Confirms that a cross-account STS role target exists in its IAM account |
| src/…/IamStoredResourceArns.java | Connects stored delegation ownership to IAM condition evaluation |
| src/…/IamConditionContextResolver.java | Builds request, resource, principal, account, tag, service-call, and federation-related condition context |
| src/…/IamEnforcementFilter.java | Connects SigV4 credentials, protocol dispatch, resources, policies, and request enforcement |
| src/…/IamActionRegistry.java | Maps protocol requests and service routes to IAM actions |
| src/…/ResourceArnBuilder.java | Maps request targets to policy resource ARNs |
| src/…/AssumeRolePolicyEvaluator.java | Defines direct role trust decisions and principal matching |
| src/…/WebIdentityTrustPolicyEvaluator.java | Defines OIDC provider, claim, condition, and web-identity trust matching |
| src/…/SAMLTrustPolicyEvaluator.java | Defines SAML provider, assertion claim, session-name, and trust matching |
| src/…/StsQueryHandler.java | Creates STS sessions and applies federation, delegation, MFA, and privileged-session checks |