Skip to content

feat(mysql): in-provider RDS IAM token minting (prototype, Route B) - #3

Draft
matt-royal wants to merge 1 commit into
gusto-mainfrom
wb-247-route-b-iam-connector
Draft

feat(mysql): in-provider RDS IAM token minting (prototype, Route B)#3
matt-royal wants to merge 1 commit into
gusto-mainfrom
wb-247-route-b-iam-connector

Conversation

@matt-royal

Copy link
Copy Markdown

Prototype: authenticate provider-sql's admin MySQL connection to RDS/Aurora with an IAM database auth token, minted in-process per connection.

Draft, not for merge. This is a prototype from an investigation that has been shelved — the IAM-database-auth direction was set aside as too complex, and the RDS Data API alternative was declined for network-posture reasons. It's pushed as a durable record in case the approach is revisited.

Approach:

  • A TokenMinter interface + a database/sql driver.Connector that mints a fresh RDS IAM auth token per physical connection; the pool is keyed by a password-less DSN so token rotation reuses the pool instead of churning it.
  • A concrete rdsauth.Minter wrapping feature/rds/auth.BuildAuthToken with an optional assume-role chain.
  • A new RDSIAMAuth ProviderConfig credential source + user-reconciler wiring (cluster path).

Unit-tested against fakes (fake minter + a driver-boundary seam); not verified against real Aurora.

Generated with Claude Code 🤖

Teaches provider-sql to authenticate to RDS/Aurora MySQL with an IAM auth
token it mints itself, per physical connection, from the pod's ambient AWS
identity (IRSA / Pod Identity) — no external refresher, no token in any
Kubernetes Secret.

Core: a TokenMinter interface + a driver.Connector that mints the password
per connection; the pool is opened via sql.OpenDB keyed by a password-less
DSN, so token rotation reuses the pool instead of churning it. A concrete
rdsauth.Minter wraps feature/rds/auth.BuildAuthToken with the default cred
chain plus an optional assume-role chain.

Opt-in (cluster ProviderConfig path): a new RDSIAMAuth credentials source
and an RDSAuth {region, assumeRoleARNs} block, with the user reconciler's
Connect() building the minter (via an injected factory) and calling
NewWithMinter. Unit-tested end to end against fakes; real-Aurora
verification is a deferred staging step. See WB-247-ROUTE-B-EVALUATION.md.
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