Skip to content

feat: AWS IAM auth for DocumentDB and pooled Postgres (v0.2.10) - #21

Merged
abhi-bhat-lyzr merged 1 commit into
mainfrom
feat/iam-auth-postgres-documentdb
Aug 2, 2026
Merged

feat: AWS IAM auth for DocumentDB and pooled Postgres (v0.2.10)#21
abhi-bhat-lyzr merged 1 commit into
mainfrom
feat/iam-auth-postgres-documentdb

Conversation

@abhi-bhat-lyzr

Copy link
Copy Markdown
Contributor

Summary

AWS IAM-based auth for both the document DB (DocumentDB) and relational (Postgres) backends.

DocumentDB

  • New connect_iam_auth (async Motor + sync PyMongo) using the MONGODB-AWS mechanism over TLS (authSource=$external, retryWrites=false). Credentials resolve from the standard AWS provider chain via pymongo-auth-aws.
  • Routed through get_mongodb(...) / get_mongodb_sync(...) with auth="iam".

Postgres

  • Pooled IAM/Entra auth now mints a fresh token per physical pool connection via a custom connection_class (previously _ensure_pool injected a static null password — broken for token auth).
  • from_iam_auth / from_entra_managed_identity now accept pool/pool_min_size/pool_max_size.

Packaging

  • pymongo -> pymongo[aws] in aws/all/dev extras (pulls pymongo-auth-aws); uv.lock refreshed.
  • Version bump 0.2.9 -> 0.2.10 (pyproject + __init__, previously out of sync).

Tests

  • New: DocumentDB IAM URI/mechanism assertions (async + sync); pooled Postgres IAM per-connection token minting.
  • Full suite: 274 passed, 3 skipped; ruff clean.

Not covered here

  • Live MONGODB-AWS handshake against a real IAM-enabled DocumentDB cluster (needs an AWS account; format matches AWS docs + the reference Node sample).

- DocumentDB: add connect_iam_auth (MONGODB-AWS, authSource=$external) for
  async (Motor) and sync (PyMongo); route via get_mongodb*(auth="iam").
- Postgres: pooled IAM/Entra now mints a fresh token per physical pool
  connection via a custom connection_class; from_iam_auth/from_entra accept
  pool params. Fixes static-password bug in _ensure_pool.
- Add pymongo[aws] to aws/all/dev extras; refresh uv.lock.
- Tests for DocumentDB IAM (async+sync) and pooled Postgres IAM.
- Bump to 0.2.10.
@sonarqubecloud

sonarqubecloud Bot commented Aug 2, 2026

Copy link
Copy Markdown

@abhi-bhat-lyzr
abhi-bhat-lyzr merged commit a185f6e into main Aug 2, 2026
2 checks passed
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