You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
--account / SPORE_ACCOUNT is accepted but never checked (only spawn doctor reads it) #1118
Found in the documentation audit (spore-host/spore-host#585). truffle has the same bug as truffle#206; this is spawn's.
The promise:
The root flag reads --account string Expected AWS account ID (optional guard).
docs/guides/aws-auth.md (~66, ~91) and docs/reference/environment-variables.md (~29) say a tool "refuses to act if your credentials resolve to a different account" when --account or SPORE_ACCOUNT is set.
The code (main):
cmd/root.go:139 passes the flag to spawnconfig.SetSharedFlags, and pkg/config/shared.go stores it.
The only reader of SharedConfig().Account is pkg/doctor/aws_prober.go:90.
pkg/aws/client.go (NewClientWithRegion) uses the shared profile and region, never the account.
So spawn --account 111111111111 launch … with credentials for another account launches anyway.
Why it matters: this is a safety guard people set precisely because spawn creates billable resources. A guard that silently does nothing is worse than none: it's counted on.
Fix: after loading the AWS config in NewClientWithRegion, if an expected account is set, call STS GetCallerIdentity once (cached per process) and refuse with both account IDs on a mismatch. Doctor already has the comparison logic. The docs will describe current behaviour until this lands.
Activity
fix: --account / SPORE_ACCOUNT is enforced, not just accepted (#1118)