mongodb / mongo-jdbc-driver

JDBC Driver for MongoDB Atlas SQL interface
Apache License 2.0
40 stars 35 forks source link

SQL-21:Support auth in JDBC driver #17

Closed huan-Mongo closed 4 years ago

huan-Mongo commented 4 years ago

In this PR, I added support for auth field during connection. User will be able to specify the fields either in connString or via properties. User is expected only to set each value once. If there is conflict between connString and properties, an exception will be thrown. The field name is case insensitive.

I added an integration test for the auth connection as well. ADL test host setting is passed in via environment variables.

huan-Mongo commented 4 years ago

@rychipman I check all the properties consistencies in the normalizeOptions functions. User and Password are placed before the hostname in connection string which is not part of the query options. So the check for these two values is not part of this function. What do you think?

pmeredit commented 4 years ago

My question still is if we shouldn't flag mismatches on user and password? I'm not sure why they would be treated differently.

huan-Mongo commented 4 years ago

@pmeredit for the other options, we do throw an exception when there is a mismatch. Not sure what do you mean by we treat user and password differently?

rychipman commented 4 years ago

LGTM!