Description
Implement support for AWS session tokens to enable temporary, role-based interactions with S3-compatible backends. To maintain a seamless user experience, aliases utilizing expired session tokens will be automatically pruned from the configuration upon detection.
Requirements
- Core Alias Updates: Update the
Alias configuration to support an optional session token using #[serde(default)] for backward compatibility.
- Security: Implement a custom
fmt::Debug for the Alias struct to ensure session tokens and secret keys are scrubbed from logs.
- Credential Injection: Modify
S3Client and AdminClient to inject the session token into the AWS credentials provider.
- Error Handling: Introduce a
TokenExpired(String) error variant and map AWS ExpiredToken / InvalidToken errors to it.
- CLI Auto-Pruning: Intercept
TokenExpired errors at the CLI boundary to log a clear message, automatically remove the dead alias from config.toml, and exit gracefully.
Acceptance Criteria
Notes
This change impacts the Alias struct in crates/core, triggering the Breaking Change process outlined in AGENTS.md. The aws-sigv4 crate automatically handles the X-Amz-Security-Token header during request signing.
Description
Implement support for AWS session tokens to enable temporary, role-based interactions with S3-compatible backends. To maintain a seamless user experience, aliases utilizing expired session tokens will be automatically pruned from the configuration upon detection.
Requirements
Aliasconfiguration to support an optional session token using#[serde(default)]for backward compatibility.fmt::Debugfor theAliasstruct to ensure session tokens and secret keys are scrubbed from logs.S3ClientandAdminClientto inject the session token into the AWS credentials provider.TokenExpired(String)error variant and map AWSExpiredToken/InvalidTokenerrors to it.TokenExpirederrors at the CLI boundary to log a clear message, automatically remove the dead alias fromconfig.toml, and exit gracefully.Acceptance Criteria
rc alias setsupports a new--session-tokenflag.schema_versionbump and a migration path (migrations/).schemas/output_v2.jsonis updated to include thesession_tokenfield in thealiasInfodefinition.AUTH_ERROR(Code 4).***REDACTED***.UPDATE_GOLDEN=1 cargo test --features golden) and pass.cargo fmt --all,cargo clippy --workspace -- -D warnings) pass with zero warnings.Notes
This change impacts the
Aliasstruct incrates/core, triggering the Breaking Change process outlined inAGENTS.md. Theaws-sigv4crate automatically handles theX-Amz-Security-Tokenheader during request signing.