[CDRIVER-3389] Duplicate authMechanismProperties should be consistent with other duplicate URI options Created: 09/Oct/19 Updated: 27/Oct/23 Resolved: 06/Dec/21 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | docs, libmongoc, uri |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Kevin Albertson | Assignee: | Roberto Sanchez |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
Duplicates for values within authMechanismProperties have surprisingly different behavior from how other duplicate URI options are handled. For example, the following produces no warning:
Additionally, unlike other URI options, since authMechanismProperties are stored without duplicate checking, when they're retrieved (e.g. here) we'll use the first occurrence ("a" in the example above) which differs from other URI duplicate options handling where we will use the value of the last occurrence and warn. E.g.
Produces a warning:
And would use the value 500. Note, I think this is technically spec-compliant since duplicate URI options is undefined. Note, the auth spec says:
|
| Comments |
| Comment by Roberto Sanchez [ 06/Dec/21 ] |
|
Updated the documentation to reflect that this particular issue (specifying the same key multiple times) results in undefined behavior. |
| Comment by Kevin Albertson [ 14/Oct/19 ] |
|
Since this is undefined by the spec, this could be a documentation only change. |
| Comment by Kevin Albertson [ 09/Oct/19 ] |
|
Note, this check needs to be made case insensitive as well, since the properties are stored as they are presented. |