Skip to content

Conversation

addaleax
Copy link
Collaborator

For CSFLE support, we will need Compass to be able to access both
server metadata and encrypted collection contents.

Using automatic encryption means that a number of administrative
commands are not available. As a consequence, for CSFLE-enabled
connections, Compass will maintain two separate MongoClient
instances, and DataService methods will pick a specific one
depending on what they do.

For other connections, there is only a single client.

Description

Checklist

  • New tests and/or benchmarks are included
  • Documentation is changed or added

Motivation and Context

  • Bugfix
  • New feature
  • Dependency update
  • Misc

Open Questions

Dependents

Types of changes

  • Backport Needed
  • Patch (non-breaking change which fixes an issue)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would cause existing functionality to change)

…SS-5641

For CSFLE support, we will need Compass to be able to access both
server metadata and encrypted collection contents.

Using automatic encryption means that a number of administrative
commands are not available. As a consequence, for CSFLE-enabled
connections, Compass will maintain two separate `MongoClient`
instances, and `DataService` methods will pick a specific one
depending on what they do.

For other connections, there is only a single client.
Copy link
Member

@Anemy Anemy left a comment

Choose a reason for hiding this comment

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

lgtm, nice comments with jira links! One typing thought/suggestion not blocker

*/
startSession(): ClientSession {
return this._initializedClient.startSession();
startSession(clientType: ClientType): ClientSession {
Copy link
Member

Choose a reason for hiding this comment

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

Would it help the typing here if we have a ClientTypeSession (other names?) type that extends the ClientSession with the clientType as a key? Then in killSessions we might not need to do any casting.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure, done! :)

@addaleax addaleax merged commit 63b46c4 into main Mar 29, 2022
@addaleax addaleax deleted the 5641-dev branch March 29, 2022 14:37
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