rustfs / rustfs/cli

feat: implement AWS temporary session based interactions

Offen
#167 3 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
Rust
Sterne
152
Forks
20
Ø Merge
1 T. 3 Std.
Gemergte PRs (30 T.)
27

Beschreibung

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

  • rc alias set supports a new --session-token flag.
  • Configuration changes include a schema_version bump and a migration path (migrations/).
  • schemas/output_v2.json is updated to include the session_token field in the aliasInfo definition.
  • Static credentials continue to function normally when the session token is omitted.
  • CLI correctly identifies an expired token, logs a helpful warning, deletes the alias, and exits with AUTH_ERROR (Code 4).
  • Debug/verbose logs strictly mask the session token as ***REDACTED***.
  • Golden tests are successfully regenerated (UPDATE_GOLDEN=1 cargo test --features golden) and pass.
  • Pre-commit checks (cargo fmt --all, cargo clippy --workspace -- -D warnings) pass with zero warnings.

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.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit der Alias-Struktur in crates/core und lies AGENTS.md, um den Prozess für Breaking Changes zu verstehen. Verfolge S3Client, AdminClient, den Einstiegspunkt zum Setzen von CLI-Aliasen, migrations/ und schemas/output_v2.json und prüfe anschließend die Golden Tests. Als erledigt gilt die Aufgabe, wenn die Konfiguration des Session-Tokens, die Ablaufbehandlung, die Redaction, die Migration, die Schema-Aktualisierungen und die aufgeführten cargo-Prüfungen alle erfolgreich sind.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
aws, rust
Bereich
backend, cli, security
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
48/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.