Skip to content
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

fix(NODE-3675): SRV option bug correctly defaults authSource to $external #3079

Merged
merged 10 commits into from Dec 15, 2021

Conversation

syz99
Copy link
Contributor

@syz99 syz99 commented Dec 13, 2021

Description

What is changing?

Previously, for external mechanisms, it was not always the case that authSource defaulted to $external even though that was the intended behavior / what the spec outlines. External auth source mechanisms are now explicitly checked for in connection_string to avoid errant overrides (e.g. authSource = admin over $external). Unit tests added as well.

Is there new documentation needed for these changes?

n/a

[ jira ]

Double check the following

  • Ran npm run check:lint script
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: <type>(NODE-xxxx)<!>: <description>
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

@syz99 syz99 requested a review from nbbeeken December 13, 2021 22:48
@syz99 syz99 self-assigned this Dec 13, 2021
@nbbeeken nbbeeken added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Dec 13, 2021
@syz99
Copy link
Contributor Author

syz99 commented Dec 14, 2021

I've chosen to replace any checks for external auth mechanisms (e.g. if (GSSAP || AWS || X509)) with a check for the newly introduced $EXTERNAL_AUTH_SOURCE_MECHANISMS set "typing".

This is mainly a choice of grouping these three as the external auth source mechanisms explicitly. Does this introduce too much confusion / make things less readable?

example diffs: (1), (2)

nbbeeken
nbbeeken previously approved these changes Dec 14, 2021
Copy link
Contributor

@nbbeeken nbbeeken left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@nbbeeken nbbeeken added Team Review Needs review from team and removed Primary Review In Review with primary reviewer, not yet ready for team's eyes labels Dec 14, 2021
test/unit/srv_option_handling.test.ts Outdated Show resolved Hide resolved
test/unit/srv_option_handling.test.ts Outdated Show resolved Hide resolved
test/unit/srv_option_handling.test.ts Outdated Show resolved Hide resolved
test/unit/srv_option_handling.test.ts Outdated Show resolved Hide resolved
test/unit/connection_string.test.ts Outdated Show resolved Hide resolved
test/unit/connection_string.test.ts Outdated Show resolved Hide resolved
@syz99 syz99 requested a review from dariakp December 15, 2021 16:02
src/cmap/auth/providers.ts Outdated Show resolved Hide resolved
@syz99 syz99 requested a review from nbbeeken December 15, 2021 18:49
@nbbeeken nbbeeken merged commit 30f2a2d into main Dec 15, 2021
@nbbeeken nbbeeken deleted the NODE-3675/srv-option-bug branch December 15, 2021 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team Review Needs review from team
Projects
None yet
5 participants