-
Notifications
You must be signed in to change notification settings - Fork 4.6k
xds bootstrap: enable using JWT Call Credentials (part 2 for A97) #8536
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
base: master
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #8536 +/- ##
==========================================
- Coverage 82.09% 82.05% -0.05%
==========================================
Files 412 415 +3
Lines 40453 40652 +199
==========================================
+ Hits 33211 33355 +144
- Misses 5869 5919 +50
- Partials 1373 1378 +5
🚀 New features to boost your workflow:
|
@@ -58,6 +59,9 @@ func RegisterCredentials(c Credentials) { | |||
// GetCredentials returns the credentials associated with a given name. | |||
// If no credentials are registered with the name, nil will be returned. | |||
func GetCredentials(name string) Credentials { | |||
if name == "jwt_token_file" && !envconfig.XDSBootstrapCallCredsEnabled { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, since the convention is to register the credentials via an init()
function in xds/bootstrap/credentials.go
, it's not possible to opt in or out of the registration there and at the same time to be able to unit test if the feature is guarded by XDSBootstrapCallCredsEnabled
. Hence why the check has been moved here.
Part two for grpc/proposal#492 (A97). It's stacked on top of #8431
What this PR does is:
internal/xds/bootstrap
with support for loading multiple PerRPCCallCredentials specifed in a newcall_creds
field in the boostrap file as per A97xds/internal/xdsclient/clientimpl.go
to use the call credentials when constructing the clientxds/bootstrap
to register thejwtcreds
call credentials and make them available ifGRPC_EXPERIMENTAL_XDS_BOOTSTRAP_CALL_CREDS
is enabledI have added
DialOptionsWithCallCredsForTransport
because, even though current and future call credentials are likely to all expect secure transport, I thought it would be safer to check of insecure transport just in case. If you prefer, I can just updateDialOptions
to use all call credentials regardless of the transport.Relates to istio/istio#53532
RELEASE NOTES: