Skip to content

feat: AWS Secrets Manager provider (Plan 8)#210

Merged
erans merged 7 commits intomainfrom
worktree-plan-08-aws-sm-provider
Apr 10, 2026
Merged

feat: AWS Secrets Manager provider (Plan 8)#210
erans merged 7 commits intomainfrom
worktree-plan-08-aws-sm-provider

Conversation

@erans
Copy link
Copy Markdown
Collaborator

@erans erans commented Apr 10, 2026

Summary

  • Add internal/proxy/secrets/awssm/ package: Config, Provider (smClient interface, New, Fetch, Close), error mapping with isAuthError helper
  • STS GetCallerIdentity connectivity probe (auth-fatal, non-auth non-fatal for VPC-endpoint deployments)
  • JSON field extraction + single-key auto-resolve for aws-sm://host/path#field URIs
  • Wire aws-sm into knownProviderTypes, DefaultConstructors, and decodeProviderConfig
  • 26 unit tests (30 subtests) with mock smClient, race-clean, ProviderContract compliance

Test Plan

  • go test ./internal/proxy/secrets/awssm/... -race — all pass
  • go test ./internal/policy/...TestValidateSecrets_AWSProvider passes
  • go test ./internal/session/...TestResolveProviderConfigs_AWSSM passes
  • go test ./... — full suite green
  • GOOS=windows go build ./... — cross-compile clean

🤖 Generated with Claude Code

erans and others added 7 commits April 10, 2026 09:07
Add internal/proxy/secrets/awssm package with Config, Provider,
smClient interface, New constructor, Fetch, Close, and error
mapping. Uses AWS SDK for Go v2 with ambient credentials.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace GetSecretValue probe with STS GetCallerIdentity — works in
least-privilege IAM setups. Expand mapAWSError to cover common AWS
auth error codes beyond AccessDeniedException.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Mock-based tests for Fetch (string, binary, JSON field extraction,
auto-resolve, error mapping), Close lifecycle, concurrency (test
hooks for TOCTOU race), and ProviderContract compliance.

Co-Authored-By: Claude <noreply@anthropic.com>
- Extract isAuthError helper for reuse in constructor and Fetch.
- Map STS probe auth failures to ErrUnauthorized (not generic error).
- Remove InvalidRequestException → ErrInvalidURI mapping: that AWS
  error signals resource state (pending deletion, managed by another
  service), not a malformed URI. It now falls through to the generic
  aws-sm wrapper.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…n 8)

Add aws-sm to knownProviderTypes, YAML decoder, and
DefaultConstructors. Services can now reference aws-sm://
URIs and the resolver builds awssm.Config from policy YAML.

Co-Authored-By: Claude <noreply@anthropic.com>
…oborev)

- Make non-auth STS probe failures non-fatal: VPC-endpoint-only
  deployments may not have STS reachability, but SM still works.
  Auth failures remain fatal (bad credentials won't self-heal).
- Add InvalidClientTokenId and SignatureDoesNotMatch to isAuthError
  for comprehensive AWS credential failure mapping.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…orev)

If the bootstrap context is canceled/expired during the STS probe,
propagate the context error instead of silently swallowing it.
Auth errors and context errors are fatal; other STS failures
(e.g. endpoint unreachable) remain non-fatal.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@erans erans merged commit d4865ba into main Apr 10, 2026
9 checks passed
@erans erans deleted the worktree-plan-08-aws-sm-provider branch April 10, 2026 18:03
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.

1 participant