Skip to content

fix(iam): add ECS credential discovery with coverage#44

Open
rhnvrm wants to merge 2 commits into
masterfrom
fix-ecs-iam-pr43
Open

fix(iam): add ECS credential discovery with coverage#44
rhnvrm wants to merge 2 commits into
masterfrom
fix-ecs-iam-pr43

Conversation

@rhnvrm
Copy link
Copy Markdown
Owner

@rhnvrm rhnvrm commented May 21, 2026

This PR supersedes #43 and addresses #42.

It preserves the original ECS credential discovery contribution as the first commit, then adds the maintainer follow-up needed to make it mergeable:

  • preserve IAMResponse compatibility by restoring exported fields removed in added ecs compatibility #43
  • validate ECS credential endpoint HTTP status
  • drain and close ECS response bodies
  • avoid falling back to IMDS when ECS credentials are explicitly configured but the ECS fetch fails
  • add regression coverage for:
    • ECS success path
    • ECS non-200 path
    • IMDS fallback when ECS credentials are not configured

Attribution:

  • commit feat(iam): add ECS container credential discovery keeps the original author attribution to Antoine Charbonneau and is based on the implementation from added ecs compatibility #43

Tested:

  • go test ./... -run 'TestS3_NewUsingIAM|TestFetchIAMData' -count=1
  • full local MinIO-backed suite with:
    • AWS_S3_REGION=us-east-1
    • AWS_S3_ACCESS_KEY=minioadmin
    • AWS_S3_SECRET_KEY=minioadmin
    • AWS_S3_ENDPOINT=http://127.0.0.1:9000
    • AWS_S3_BUCKET=testbucket
    • AWS_ACCESS_KEY_ID=minioadmin
    • AWS_SECRET_ACCESS_KEY=minioadmin
    • AWS_DEFAULT_REGION=us-east-1
    • go test -v ./...

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.

2 participants