[CDRIVER-1494] authMechanism URI options cannot be set individually Created: 26/Aug/16  Updated: 12/Mar/17  Resolved: 07/Dec/16

Status: Closed
Project: C Driver
Component/s: auth, libmongoc
Affects Version/s: 1.4.0
Fix Version/s: 1.6.0

Type: Bug Priority: Major - P3
Reporter: Jeremy Mikola Assignee: A. Jesse Jiryu Davis
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by PHPC-772 Parse authMechanism options in URI op... Closed
Related
related to CDRIVER-2084 Create setter for authMechanism URI o... Closed

 Description   

mongoc_uri_option_is_utf8() reports true for "authMechanism", but mongoc_uri_set_option_as_utf8() is not suitable for setting that option. Based on the static mongoc_uri_parse_option() function, its value must be appended to uri->credentials instead of uri->options.

"authMechanismProperties" also cannot be set, since mongoc_uri_parse_auth_mechanism_properties() is static.

The PHP and HHVM drivers depend on being able to set URI options individually, since they allow options to be received in a separate array to be merged atop the values in the URI string.



 Comments   
Comment by Jeremy Mikola [ 10/Mar/17 ]

jesse: I believe a setter for "authMechanism" is still missing. Should we re-open this or would you rather I create a new ticket and target 1.7.0?

Comment by Githook User [ 10/Dec/16 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-1494 missing-sentinel warning in URI code
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/698023942f37580408b0e5c04ed8e717e3b11bb6

Comment by Githook User [ 07/Dec/16 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-1494 add mongoc_uri_set_mechanism_properties

New function to replace all authMechanismProperties set on a URI.
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/95cd85c35b41c1ca977b057e26b4a4ec3c8cd730

Comment by Jeremy Mikola [ 29/Aug/16 ]

The current code in mongoc-uri.c dates back to CDRIVER-437, so I believe this behavior has always been broken for us. I only noticed it while revising our SSL and X509 tests for PHPC-605.

I'm OK with leaving PHPC-772 open if you want to defer this to the next 1.6.0 release. It's more important that we have a ticket open so users are aware of the issue.

Comment by A. Jesse Jiryu Davis [ 26/Aug/16 ]

Thanks, I think I understand. Right now we have a getter:

bool
mongoc_uri_get_mechanism_properties (
   const mongoc_uri_t           *uri,
   bson_t                       *properties);

So it seems consistent to do:

void
mongoc_uri_append_auth_mechanism_properties (
   mongoc_uri_t *uri,
   bson_t *properties);

Would that work?

The C Driver 1.5-rc0 will be out around Sept 12 and the final a few weeks after that, must we have it in 1.5 or could it be a few months later in 1.6?

Generated at Wed Feb 07 21:12:43 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.