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

feat: support CredentialsProvider in Connection API #1869

Merged
merged 2 commits into from
May 5, 2022

Conversation

olavloite
Copy link
Collaborator

Adds support for setting a CredentialsProvider instead of a
credentialsUrl in a connection string. The CredentialsProvider reference
must be a class name to a public class with a public no-arg constructor.
This option is available in the Connection API, which means that any
client that uses that API can directly benefit from it (this effectively
means the JDBC driver).

The option will only be available in the JDBC driver once the dependency on the client library in the JDBC driver has been updated to a version of the Java client library that contains this change.

Fixes b/231174409

Adds suppport for setting a CredentialsProvider instead of a
credentialsUrl in a connection string. The CredentialsProvider reference
must be a class name to a public class with a public no-arg constructor.
This option is available in the Connection API, which means that any
client that uses that API can directly benefit from it (this effectively
means the JDBC driver).

Fixes b/231174409
@olavloite olavloite requested a review from a team as a code owner May 3, 2022 14:15
@product-auto-label product-auto-label bot added size: l Pull request size is large. api: spanner Issues related to the googleapis/java-spanner API. labels May 3, 2022
@olavloite olavloite requested review from rajatbhatta and ansh0l May 3, 2022 14:15
Copy link
Contributor

@rajatbhatta rajatbhatta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with a couple of small points/questions.

@olavloite olavloite added the automerge Merge the pull request once unit tests and other checks pass. label May 4, 2022
@gcf-merge-on-green
Copy link
Contributor

Merge-on-green attempted to merge your PR for 6 hours, but it was not mergeable because either one of your required status checks failed, one of your required reviews was not approved, or there is a do not merge label. Learn more about your required status checks here: https://help.github.com/en/github/administering-a-repository/enabling-required-status-checks. You can remove and reapply the label to re-run the bot.

@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label May 4, 2022
@rajatbhatta rajatbhatta added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 4, 2022
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 4, 2022
@rajatbhatta rajatbhatta added the automerge Merge the pull request once unit tests and other checks pass. label May 4, 2022
@gcf-merge-on-green
Copy link
Contributor

Merge-on-green attempted to merge your PR for 6 hours, but it was not mergeable because either one of your required status checks failed, one of your required reviews was not approved, or there is a do not merge label. Learn more about your required status checks here: https://help.github.com/en/github/administering-a-repository/enabling-required-status-checks. You can remove and reapply the label to re-run the bot.

@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label May 4, 2022
@rajatbhatta
Copy link
Contributor

Merging manually, as automerge failed on this PR (even though all checks have passed).

@rajatbhatta rajatbhatta merged commit f1d2d3e into main May 5, 2022
@rajatbhatta rajatbhatta deleted the connection-credentials-provider branch May 5, 2022 04:31
rajatbhatta added a commit to googleapis/java-spanner-jdbc that referenced this pull request May 26, 2022
testConnectWithCredentialsAndOAuthToken test was failing with following error -
JdbcDriverTest.testConnectWithCredentialsAndOAuthToken:135 expected to contain: Cannot specify both credentials and an OAuth token
but was : INVALID_ARGUMENT: Specify only one of credentialsUrl, encodedCredentials, credentialsProvider and OAuth token.

Changing assertThat to account for this change. The exception message was changed as part of googleapis/java-spanner#1869.
rajatbhatta added a commit to renovate-bot/java-spanner-jdbc that referenced this pull request May 26, 2022
testConnectWithCredentialsAndOAuthToken test was failing with following error -
JdbcDriverTest.testConnectWithCredentialsAndOAuthToken:135 expected to contain: Cannot specify both credentials and an OAuth token
but was : INVALID_ARGUMENT: Specify only one of credentialsUrl, encodedCredentials, credentialsProvider and OAuth token.

Changing assertThat to account for this change. The exception message was changed as part of googleapis/java-spanner#1869.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the googleapis/java-spanner API. size: l Pull request size is large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants