10gen / mongo-orchestration

Apache License 2.0
7 stars 11 forks source link

Expose TLS and authentication options in mongodb_uri field #287

Closed alcaeus closed 5 months ago

alcaeus commented 3 years ago

Fixes #268.

This PR refactors the generation of the URI returned after starting a cluster. Previously, mongodb_uri and mongodb_auth_uri had to be checked depending on whether auth was enabled. As indicated in the ticket above, TLS options also weren't added automatically. The goal is to get mongo-orchestration to return a mongodb_uri that can be used to connect to the cluster, without having to append other options.

This PR changes mongodb_uri to include both TLS and auth options. The mongodb_auth_uri field is kept for backward compatibility, but it always contains the same value as mongodb_uri. I'm not sure if this change is kosher, as somebody may be relying on mongodb_uri not containing auth information to test authentication failures. Please let me know if I should separate those changes.

alcaeus commented 3 years ago

I've kept it concise, noting that we now expose TLS and auth options. I've also reached out in #driver-devs to double-check before breaking somebody's workflow.

alcaeus commented 3 years ago

On second thought, changing mongodb_uri will break the setup for any driver that tests against ssl clusters as they'll be adding uri options manually. I'll change the PR to expose this as a new field and deprecate existing fields. Is there a way to deprecate these?

ShaneHarvey commented 3 years ago

There's no way to deprecate an api response field. Let's just keep the existing ones. Perhaps we can note that they are deprecated in the wiki: https://github.com/10gen/mongo-orchestration/search?q=mongodb_uri&type=wikis

As for the name of the new field, anything you come up with is fine. Maybe mongodb_full_uri or mongodb_tls_uri?