Skip to content

Conversation

@dap0am
Copy link

@dap0am dap0am commented Aug 1, 2025

Summary

• Implements CloudShell metadata endpoint support using IMDSv2-like flow at localhost:1338
• Adds support for standard AWS environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN)
• Integrates both credential providers into the existing credential chain with comprehensive test coverage

Changes

  • CloudShell support: Token-based authentication flow for CloudShell metadata endpoint
  • Environment variables: Support for AWS credential environment variables with optional session token
  • Testing: 12 new comprehensive tests covering success/failure scenarios for both credential methods
  • Integration: Seamless integration into existing credential provider chain without breaking changes

Test Results

All tests pass (32 total: 20 existing + 12 new)

Test plan

  • Unit tests for CloudShell credential retrieval (success/failure scenarios)
  • Unit tests for environment variable credential retrieval (with/without session token)
  • Integration tests confirming both methods work in the main credential chain
  • Existing tests continue to pass with mock updates
  • Manual testing in development environment

Fixes #285

dap0am added 2 commits August 2, 2025 00:48
Implements CloudShell metadata endpoint support using IMDSv2-like flow
with token-based authentication at localhost:1338. Also adds support
for standard AWS environment variables (AWS_ACCESS_KEY_ID,
AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN).

Both credential providers are integrated into the existing credential
chain with comprehensive test coverage. Addresses issue aws#285.
AWS_CONTAINER_AUTH_TOKEN_FILE_ENV = "AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE"

# CloudShell credentials endpoint
CLOUDSHELL_METADATA_ENDPOINT = "http://localhost:1338/latest"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just quick question: Is this endpoint created on the host and playing as a fake endpoint to get security-credentials ?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Better CloudShell credential support

2 participants