Fix MongoDB 8.x auth problem - #273
Merged
Merged
Conversation
…normalization Fix empty list handling in command map normalization
Contributor
|
Just want to add that it affects MongoDB 8.1 and newer https://www.mongodb.com/docs/manual/release-notes/8.2-compatibility/#driver-incompatibility |
Contributor
Author
|
The branch has been updated since the initial PR version. Instead of only handling the pre-auth There is no official |
haoxianhan
force-pushed
the
fix/mongo8-auth-preflight
branch
2 times, most recently
from
March 13, 2026 05:46
a8e3167 to
5a935ee
Compare
Use the handshake response to choose the auth path instead of calling buildInfo before authentication. Keep mc_auth_logic:auth/5 backward compatible, add a regression suite, and run it in CI against MongoDB 8.2.5.
haoxianhan
force-pushed
the
fix/mongo8-auth-preflight
branch
from
March 13, 2026 05:51
5a935ee to
8aa6e43
Compare
Owner
|
Thank you! |
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
Fix
mc_worker_api:connect/1for MongoDB 8.1+ when pre-authbuildInfois rejected.mc_worker_api:connect/1usedbuildInfobefore auth to detect the server version.On MongoDB 8.1+, that can fail with
Unauthorized, so SCRAM auth never starts.This change removes that auth-time
buildInfocheck and uses the handshake response to choose the auth mode instead.Also adds a regression test and runs it in CI against MongoDB 8.2.5.
Testing
rebar3 ct --suite=test/buildinfo_auth_SUITE.erl