-
Notifications
You must be signed in to change notification settings - Fork 67
SWIFT-429 Implement auth spec tests #333
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
| /// final options set on the `ConnectionString`. | ||
| internal init(_ connectionString: String, options: inout ClientOptions) throws { | ||
| /// Initializes a new `ConnectionString` with the provided options. | ||
| internal init(_ connectionString: String, options: ClientOptions? = nil) throws { |
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.
for some reason I wrote this clunky inout API where the connection string would update the client options struct to reflect the final values on the URI so that the MongoClient could have correct values for read concern, write concern, and read preference.
however, it's way simpler to just have MongoClient read back those values by calling the appropriate getters on the connection string after it creates it (see MongoClient.init.)
| mongoc_uri_set_option_as_bool(self._uri, MONGOC_URI_RETRYREADS, rr) | ||
| } | ||
|
|
||
| // we can't get values for retryReads and retryWrites individually, so we will read |
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.
the client doesn't get the options struct back anymore, and doesn't actually care what the values of retryReads and retryWrites are, so we don't need to worry about retrieving those values anymore to send back.
1a17a85 to
961959d
Compare
cec6caf to
24897d3
Compare
patrickfreed
left a comment
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.
one comment about future work, otherwise looks good to me.
24897d3 to
56d282f
Compare
b7ac3b5 to
7eaebb1
Compare
7eaebb1 to
3e8f1a4
Compare
fb1e24a to
08d4812
Compare
This implements the auth JSON and prose tests as best as we can right now.
I am putting this up as a PR against the spec file helper branch for now so it can be reviewed separately. I'll switch the base branch to master once that gets merged.
FYI this fails on Travis Swift 4.2 right now. I didn't bother special-casing the call to
mongoc_uri_get_mechanism_propertiesas I expect that #330 dropping 4.2 will be merged before this is.I also made a somewhat related change to
ConnectionStringas part of this, will explain more in inline comment.