feat: AWS IAM auth for DocumentDB and pooled Postgres (v0.2.10) - #21
Merged
Conversation
- 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.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
AWS IAM-based auth for both the document DB (DocumentDB) and relational (Postgres) backends.
DocumentDB
connect_iam_auth(async Motor + sync PyMongo) using theMONGODB-AWSmechanism over TLS (authSource=$external,retryWrites=false). Credentials resolve from the standard AWS provider chain viapymongo-auth-aws.get_mongodb(...)/get_mongodb_sync(...)withauth="iam".Postgres
connection_class(previously_ensure_poolinjected a static null password — broken for token auth).from_iam_auth/from_entra_managed_identitynow acceptpool/pool_min_size/pool_max_size.Packaging
pymongo->pymongo[aws]inaws/all/devextras (pullspymongo-auth-aws);uv.lockrefreshed.__init__, previously out of sync).Tests
Not covered here
MONGODB-AWShandshake against a real IAM-enabled DocumentDB cluster (needs an AWS account; format matches AWS docs + the reference Node sample).