-
Type: Improvement
-
Resolution: Won't Do
-
Priority: Unknown
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
I have some recollection of discussing this with kevin.albertson a while back, but I found no existing ticket.
mongoc-uri.c includes several internal functions to validate interactions between URI options:
- mongoc_uri_finalize_auth
- mongoc_uri_finalize_directconnection
- mongoc_uri_finalize_loadbalanced
- mongoc_uri_finalize_srv
- mongoc_uri_finalize_tls
These functions are only called from mongoc_uri_parse. For wrapping drivers such as PHP, that means they will only apply to parsed URI strings. If those wrapping drivers later set URI options through functions such as mongoc_uri_set_option_as_int32, those options will never be validated by libmongoc.
Historically, PHPC has maintained its own copies of some of these functions; however, it looks like we missed introducing a copy of mongoc_uri_finalize_loadbalanced. I only noticed this issue when working on PHPC-1900 and PHPC-1908 and realizing we'd need to copy mongoc_uri_finalize_srv.
It's quite possible that these functions could depend on other private URI APIs to validate, so I think it'd make the most sense for libmongoc to provide a common, public API that calls all of these methods. That could still be called from mongoc_uri_parse but also be available for wrapping drivers to call after they are done setting additional, individual options.
- is depended on by
-
PHPC-2021 Use mongoc_uri_finalize_options to validate mongoc_uri_t before client construction
- Closed
- is related to
-
PHPC-1752 Load Balancer Support
- Released
-
CDRIVER-3723 Validate URI options on client/client pool creation
- Closed