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: include username in server metadata key #194

Merged
merged 1 commit into from
Aug 1, 2024

Conversation

addaleax
Copy link
Contributor

This is something we should have ideally always been doing (as hinted at by the doc comment for getAuthState()), but which the driver only added back support for in 6.7.0.

This shouldn't have an immediate impact on our products, because we already have some mitigations in place for the fact that usernames were previously not being taken into account (e.g. here:
https://github.com/mongodb-js/mongosh/blob/adc530e7ffcf092677d944fd69670c5cbd8e103d/packages/service-provider-server/src/cli-service-provider.ts#L172 ), but is semantically the right thing to do and should give us a bit more flexibility in the future.

Also, add a test that confirms that changes to server metadata/username actually have the expected effect, and emit a message bus event that shares information about the server metadata, as that may be helpful debugging information.

This is something we should have ideally always been doing (as hinted at by
the doc comment for `getAuthState()`), but which the driver only added
back support for in 6.7.0.

This shouldn't have an immediate impact on our products, because we already
have some mitigations in place for the fact that usernames were previously
not being taken into account (e.g. here:
https://github.com/mongodb-js/mongosh/blob/adc530e7ffcf092677d944fd69670c5cbd8e103d/packages/service-provider-server/src/cli-service-provider.ts#L172
), but is semantically the right thing to do and should give us a bit more
flexibility in the future.

Also, add a test that confirms that changes to server metadata/username
actually have the expected effect, and emit a message bus event that
shares information about the server metadata, as that may be helpful
debugging information.
@addaleax addaleax merged commit eb66433 into main Aug 1, 2024
15 of 17 checks passed
@addaleax addaleax deleted the include-username-in-server-key branch August 1, 2024 09:04
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