Skip to content

CDRIVER-5739 do not warn if TXT authSource is ignored #1741

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 1, 2024

Conversation

kevinAlbs
Copy link
Collaborator

Summary

Do not log a warning if TXT option authSource is ignored due to already being present in the URI.

Background & Motivation

When using the mongodb+srv protocol, TXT records may provide defaults for URI options. From Initial DNS Seedlist Discovery:

If available, a TXT record provides default connection string options. [...]

A Client MUST use options specified in the Connection String [...] to override options provided through TXT records.

The auth mechanism MONGODB-X509 requires authSource=$external. MongoDB Atlas includes a default TXT record authSource=admin. This caused an unavoidable warning noted in CDRIVER-5712 when attempting to use MONGODB-X509 to an Atlas M10 cluster:

WARNING:       mongoc: Cannot override URI option "authSource" from TXT record "authSource=admin"

Since authSource has a use-case to override, this PR downgrades the message to an informative trace log.

@kevinAlbs kevinAlbs changed the title Do not log warning if TXT authSource is ignored CDRIVER-5739 do not warn if TXT authSource is ignored Sep 26, 2024
@kevinAlbs kevinAlbs marked this pull request as ready for review September 26, 2024 15:54
Copy link
Contributor

@rcsanchez97 rcsanchez97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kevinAlbs kevinAlbs merged commit 04027c0 into mongodb:master Oct 1, 2024
42 of 43 checks passed
kevinAlbs added a commit that referenced this pull request Oct 1, 2024
* only trace if `authSource` is ignored from TXT record
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