Skip to content

fix(aws): preserve STS identity query output - #4669

Open
PavanaSakethaRam wants to merge 1 commit into
rtk-ai:developfrom
PavanaSakethaRam:fix/issue-4662-20261019204805-6784a5b4
Open

PavanaSakethaRam wants to merge 1 commit into
rtk-ai:developfrom
PavanaSakethaRam:fix/issue-4662-20261019204805-6784a5b4

Conversation

@PavanaSakethaRam

@PavanaSakethaRam PavanaSakethaRam commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Pass aws sts get-caller-identity through to AWS unchanged when the caller supplies --query or an explicit --output format. This preserves projected values, requested formatting, stderr, and exit status.
  • Keep the compact AWS: <account> <arn> summary for calls without those options.
  • Prevent non-object JSON from being formatted as an unknown identity.
  • Add credential-free CLI regression tests for array and scalar projections, attached option syntax, explicit text output, ordinary summary output, and AWS errors.

The STS formatter expects an object with Account and Arn. A query can return an array, scalar, or null, while forcing JSON also overrides an explicit text format. Routing those requests through the existing passthrough path preserves the AWS CLI response.

Fixes #4662

Validation

  • The CLI regression tests reproduced the original issue before the implementation change and all six pass afterward.
  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets --locked --offline
  • cargo test --workspace --locked --offline
  • cargo clippy --no-default-features --all-targets --locked --offline
  • cargo test --no-default-features --locked --offline
  • cargo doc --no-deps --locked --offline

Validation ran in the Linux Rust 1.99.1 worker image with a local AWS CLI stand-in; no live AWS credentials were required.

@rtk-wshm-sync-bot rtk-wshm-sync-bot Bot added aws bug Something isn't working labels Oct 19, 2026
@rtk-wshm-sync-bot

Copy link
Copy Markdown

wshm · Automated triage by AI

📊 Automated PR Analysis

🐛 Type bug-fix
🟢 Risk low

Summary

Fixes a bug in the AWS CLI STS identity filter where using --query to request specific fields caused the output to incorrectly show "AWS: ? ?" because the code assumed the parsed JSON was always an object. The fix detects array-shaped JSON (the format returned when --query is used) and returns None, falling back to passing through the raw CLI output unchanged.

Review Checklist

  • Tests present
  • Breaking change
  • Docs updated

Linked issues: #4662


Analyzed automatically by wshm · This is an automated analysis, not a human review.

@PavanaSakethaRam
PavanaSakethaRam force-pushed the fix/issue-4662-20261019204805-6784a5b4 branch from 8dd8a24 to 7818b08 Compare October 19, 2026 21:39
@CLAassistant

CLAassistant commented Oct 19, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aws bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

aws: sts get-caller-identity --query … prints "AWS: ? ?" (1.0.1)

2 participants