-
Notifications
You must be signed in to change notification settings - Fork 1.3k
CSHARP-5581: Test MONGODB-X509 on cloud-dev #1757
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM + minor comments
{ | ||
RequireServer.Check().Tls(required: true); | ||
|
||
string path, password; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: It's unusual to have multiple variables declaration in a single line.
switch (certificateType) | ||
{ | ||
case CertificateType.MONGO_X509: | ||
RequireEnvironment.Check() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest to reorganize the code a little: set the names of env variables inside the switch, but read the values out side. Something like this:
string cert_path_variable;
switch (certificateType)
{
case CertificateType.MONGO_X509:
cert_path_variable= MONGODB_X509_CLIENT_CERTIFICATE_PATH;
break;
...
}
RequireEnvironment.Check().EnvironmentVariable(cert_path_variable);
var path = Environment.GetEnvironmentVariable(cert_path_variable);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.