Skip to content

feat: MongoDB TLS CA fields + DocumentDB connection type#29

Merged
jiatolentino merged 2 commits into
mainfrom
feat/add-mongodb-tls-and-documentdb-connection
Jun 28, 2026
Merged

feat: MongoDB TLS CA fields + DocumentDB connection type#29
jiatolentino merged 2 commits into
mainfrom
feat/add-mongodb-tls-and-documentdb-connection

Conversation

@jiatolentino

@jiatolentino jiatolentino commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

MongoDB TLS CA fields

  • Add tls_ca_file: str = "" and tls_allow_invalid_certificates: bool = False to MongoConnectionConfig.
  • Serialize them under the existing TLS handling (matching the DM-3391 to_api_dict spec):
    • emitted only when tls is enabled,
    • tls_ca_file only when set,
    • tls_allow_invalid_certificates only when True.
  • Inbound deserialization round-trips both fields.

AWS DocumentDB connection type

  • Add DatabaseType.documentdb.
  • Add DocumentDbConnectionConfig, a thin subclass of MongoConnectionConfig that differs only by its db_type / database_type discriminator (inherits all fields, TLS handling, and serialization).
  • Register it in DB_TYPE_MAP and export it from datamasque.client.

Testing

  • New unit tests in tests/test_connections.py:
    • TLS fields present/absent, the TLS-disabled case (neither key sent), and round-trip;
    • DocumentDB serialization (db_type=documentdb, retry_writes passthrough) and validate_connection dispatch to DocumentDbConnectionConfig.
  • Full suite green: pytest (358 passed), ruff, and mypy all clean.

Notes

  • Purely additive (144 insertions, 0 deletions); no behaviour change for existing connection types.
  • Refs: DM-3842, DM-3715 (follow-on from DM-3391 / DM-3419).

@jiatolentino jiatolentino requested a review from alxboyle June 28, 2026 21:01
@jiatolentino jiatolentino self-assigned this Jun 28, 2026
@jiatolentino jiatolentino force-pushed the feat/add-mongodb-tls-and-documentdb-connection branch from deb6b25 to c4b3148 Compare June 28, 2026 21:06
- Add tls_ca_file and tls_allow_invalid_certificates to MongoConnectionConfig, serialized only when TLS is enabled (ca_file only when set, allow-invalid only when true), with round-trip deserialization and unit tests.

- Add DatabaseType.documentdb and DocumentDbConnectionConfig (a MongoConnectionConfig subclass differing only by db_type), registered in DB_TYPE_MAP and exported, so AWS DocumentDB connections round-trip as their own type.
@jiatolentino jiatolentino force-pushed the feat/add-mongodb-tls-and-documentdb-connection branch from c4b3148 to 4853ace Compare June 28, 2026 21:56
@jiatolentino jiatolentino requested a review from alxboyle June 28, 2026 21:56
@jiatolentino jiatolentino merged commit 317fe37 into main Jun 28, 2026
9 checks passed
@jiatolentino jiatolentino deleted the feat/add-mongodb-tls-and-documentdb-connection branch June 28, 2026 21:59
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