Skip to content

Commit

Permalink
Use local clientCredentialsConfig
Browse files Browse the repository at this point in the history
Use the locally defined struct clientCredentialsConfig in favor of the
upstream clientcredentials.Config object.
  • Loading branch information
elikatsis committed Sep 6, 2023
1 parent 147ea12 commit f0d87ff
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions extension/oauth2clientauthextension/extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
// clientAuthenticator provides implementation for providing client authentication using OAuth2 client credentials
// workflow for both gRPC and HTTP clients.
type clientAuthenticator struct {
clientCredentials *clientcredentials.Config
clientCredentials *clientCredentialsConfig
logger *zap.Logger
client *http.Client
}
Expand Down Expand Up @@ -55,12 +55,14 @@ func newClientAuthenticator(cfg *Config, logger *zap.Logger) (*clientAuthenticat
transport.TLSClientConfig = tlsCfg

return &clientAuthenticator{
clientCredentials: &clientcredentials.Config{
ClientID: cfg.ClientID,
ClientSecret: string(cfg.ClientSecret),
TokenURL: cfg.TokenURL,
Scopes: cfg.Scopes,
EndpointParams: cfg.EndpointParams,
clientCredentials: &clientCredentialsConfig{
Config: clientcredentials.Config{
ClientID: cfg.ClientID,
ClientSecret: string(cfg.ClientSecret),
TokenURL: cfg.TokenURL,
Scopes: cfg.Scopes,
EndpointParams: cfg.EndpointParams,
},
},
logger: logger,
client: &http.Client{
Expand Down

0 comments on commit f0d87ff

Please sign in to comment.