Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Driver attempts to connect to non-secretsmanager JDBC URLs #2

Closed
jvelonis opened this issue Dec 3, 2018 · 4 comments
Closed

Driver attempts to connect to non-secretsmanager JDBC URLs #2

jvelonis opened this issue Dec 3, 2018 · 4 comments

Comments

@jvelonis
Copy link

jvelonis commented Dec 3, 2018

My JDK 11 app connects to two databases, one using a jdbc-secretsmanager URL and the other using a plain jdbc URL. When DriverManager.getConnection() walks through the registered drivers to connect to the JDBC URL, if it tries the Secrets Manager driver first, it throws an exception complaining that the JDBC URL is not a valid secret ID.

I think AWSSecretsManagerDriver.connect() should not try to connect if the URL doesn't match the jdbc-secretsmanager scheme, or at least it should not try to connect if the URL does match the jdbc scheme.

@StevenEmelander
Copy link

Thank you for submitting this issue and providing this feedback. You are correct, today the driver only supports connecting to a database using secrets retrieved from AWS Secrets Manager. The thought was that those using this driver would only be connecting to a database using secrets retrieved from AWS Secrets Manager, and that they would want an error if that was not the case. I understand though that this is not true in your scenario. Can you help us better understand your use case by providing details on how you are defining the driver and the URL for the two databases within your app today? Would it be possible to configure different jdbc drivers for each database?

@StevenEmelander
Copy link

We are making a change to not process any URL's that start with "jdbc:". In that case it will move on to the next JDBC driver instead of throwing an exception. We believe that will address your use case.

@willtong1234
Copy link
Contributor

A pull request has been created for this issue: #3. We hope to include it in the next release.

@willtong1234
Copy link
Contributor

The PR has been merged and a new release (1.0.1) has been created. The new JARs should be available in maven central momentarily. Closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants