Files
floci/docs/configuration
Alex Banna f52b9209cf feat(iam): route assumed-role credentials to the target account (#1549)
* feat(iam): route assumed-role credentials to the target account

Assumed-role temporary credentials (ASIA… keys) collapsed to the default
account: account resolution only recognised 12-digit access key IDs and had
no link to the STS session store. Cross-account "assume a role in account B,
then provision" flows therefore landed resources in account 000000000000
instead of B.

Add a SessionAccountLookup port in core.common, implemented by IamService,
mapping a temporary access key to its account — the account in the session's
role (or federated-user) ARN, or the caller account captured at mint time for
role-less GetSessionToken credentials. AccountContextFilter now resolves with
the precedence 12-digit AKID → session lookup → default, for both the
Authorization header and the presigned X-Amz-Credential parameter.

STS handlers record the caller account on every minted session, and
SessionCredential gains an originAccountId field. The session lookup is
account-independent, since sessions are keyed by a globally unique access key.

IamService is now @Startup so AWS-managed policies seed under the default
account at boot. Seeding is account-namespaced and AccountContextFilter now
instantiates IamService to resolve the request account, so lazy seeding would
otherwise bind managed policies to whichever account made the first request.

Tests: unit coverage for resolver/filter precedence and session lookup, plus
an integration test proving a table created with role-B credentials
materialises in account B and is invisible to account A.

* perf(iam): skip session-store scan for non-ASIA access keys

Account resolution runs on every request. Gating the session lookup on the
ASIA temporary-credential prefix keeps the common case (e.g. the 'test'
default credential) off the session-store scan, which would otherwise grow
with every issued session.

* chore: re-trigger CI

Unrelated flaky CodeBuildTest.batchGetBuilds_eventuallySucceeds; root-cause
fix in floci-io/floci#1577.
2026-06-28 21:30:34 -05:00
..
2026-05-10 11:53:31 -05:00