Skip to content

Conversation

olavloite
Copy link

Allow the user to supply io.grpc.CallCredentials instead of only com.google.auth.Credentials. Any CallCredentials supplied will take precedence above the Credentials set on SpannerOptions.

Fixes #6373

Allow the user to supply io.grpc.CallCredentials instead
of only com.google.auth.Credentials. Any CallCredentials
supplied will take precedence above the Credentials set on
SpannerOptions.

Fixes #6373
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Oct 3, 2019
@codecov
Copy link

codecov bot commented Oct 3, 2019

Codecov Report

Merging #6426 into master will decrease coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #6426      +/-   ##
============================================
- Coverage     46.34%   46.34%   -0.01%     
+ Complexity    27967    27966       -1     
============================================
  Files          2613     2613              
  Lines        287929   287929              
  Branches      33756    33756              
============================================
- Hits         133443   133441       -2     
- Misses       144267   144268       +1     
- Partials      10219    10220       +1
Impacted Files Coverage Δ Complexity Δ
...able/gaxx/reframing/ReframingResponseObserver.java 88.99% <0%> (-1.84%) 29% <0%> (-1%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 19eee78...2ca894c. Read the comment docs.

@Capstan
Copy link
Contributor

Capstan commented Oct 4, 2019

My one concern is that this seems more widely applicable to ServiceOptions rather than SpannerOptions, especially for any server backed by gRPC. I don't know if it's desirable to spill implementation details into these classes.

My other thought is on the other side of the problem, and whether we should come up with a sane way to have a private class that extends com.google.auth.Credentials such that it'd obviate this request.

/cc @tsalomie

@olavloite
Copy link
Author

My one concern is that this seems more widely applicable to ServiceOptions rather than SpannerOptions, especially for any server backed by gRPC. I don't know if it's desirable to spill implementation details into these classes.

I can see that one too, and adding this option to ServiceOptions is obviously a trivial change. However, the way that the different client libraries setup and invoke the gRPC calls can differ quite a lot. Spanner happens to already have one method newCallContext that is called for every gRPC call to setup the call context to use, which makes it easy to respect the CallCredentials setting. I'm not sure whether that part of the change would be equally trivial for other client libraries.

@olavloite
Copy link
Author

@Capstan Any update on whether this change is still something you would need, or did you find some other way to use CallCredentials instead of Credentials?

@Capstan
Copy link
Contributor

Capstan commented Oct 18, 2019

@olavloite I'm discussing this with Google-internal colleagues on the team that needs it. I don't believe we have an alternate solution at the moment, but I've not checked in recently and need to sync with them.

@Capstan
Copy link
Contributor

Capstan commented Oct 18, 2019

/cc @pawelz

@Capstan
Copy link
Contributor

Capstan commented Oct 18, 2019

/cc @tsalomie

@Capstan
Copy link
Contributor

Capstan commented Oct 18, 2019

I am going to pursue – after the weekend – extending the internal support so that also can handle com.google.auth.Credentials. I'm fairly positive that will work out of the box and will obviate the need for this PR.

@Capstan
Copy link
Contributor

Capstan commented Oct 18, 2019

/cc @xiesheng211

@chingor13
Copy link
Contributor

@olavloite This PR will need to be reopened in the https://github.com/googleapis/java-spanner repo as we've migrated the google-cloud-spanner code

@olavloite
Copy link
Author

@Capstan Is this PR still needed? If so, we need to migrate it to the new repository.

@Capstan
Copy link
Contributor

Capstan commented Jan 10, 2020

Yes, we still need this functionality.

@olavloite
Copy link
Author

Moved to the new repo and merged there.

@olavloite olavloite closed this Mar 10, 2020
@olavloite olavloite deleted the spanner-allow-call-credentials branch March 10, 2020 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants