From 7ae2a993ee56e52dd991cabe5ef9899175e78d10 Mon Sep 17 00:00:00 2001 From: Allison Doami Date: Tue, 17 Dec 2024 10:04:39 -0800 Subject: [PATCH] uppercase --- oidc_cli/oidc_impl/client/client.go | 10 +++++----- oidc_cli/oidc_impl/client/config_options.go | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/oidc_cli/oidc_impl/client/client.go b/oidc_cli/oidc_impl/client/client.go index 5126759f..68f8732c 100644 --- a/oidc_cli/oidc_impl/client/client.go +++ b/oidc_cli/oidc_impl/client/client.go @@ -105,7 +105,7 @@ func (c *Client) idTokenFromOauth2Token( // RefreshToken will fetch a new token func (c *Client) RefreshToken(ctx context.Context, oldToken *Token) (*Token, error) { - logrus.Debugf("refresh scopes: %#v", c.oauthConfig.Scopes) + logrus.Debugf("refresh scopes: %#v", c.OauthConfig.Scopes) newToken, err := c.refreshToken(ctx, oldToken) // if we could refresh successfully, do so. @@ -130,7 +130,7 @@ func (c *Client) refreshToken(ctx context.Context, token *Token) (*Token, error) Expiry: token.Expiry, } - tokenSource := c.oauthConfig.TokenSource(ctx, oauthToken) + tokenSource := c.OauthConfig.TokenSource(ctx, oauthToken) newOauth2Token, err := tokenSource.Token() if err != nil { @@ -163,7 +163,7 @@ func (c *Client) refreshToken(ctx context.Context, token *Token) (*Token, error) // GetAuthCodeURL gets the url to the oauth2 consent page func (c *Client) GetAuthCodeURL(oauthMaterial *oauthMaterial) string { - return c.oauthConfig.AuthCodeURL( + return c.OauthConfig.AuthCodeURL( oauthMaterial.State, oauth2.SetAuthURLParam("grant_type", "refresh_token"), oauth2.SetAuthURLParam("code_challenge", oauthMaterial.CodeChallenge), @@ -182,12 +182,12 @@ func (c *Client) ValidateState(ourState []byte, otherState []byte) error { // Exchange will exchange a token func (c *Client) Exchange(ctx context.Context, code string, codeVerifier string) (*oauth2.Token, error) { - token, err := c.oauthConfig.Exchange( + token, err := c.OauthConfig.Exchange( ctx, code, oauth2.SetAuthURLParam("grant_type", "authorization_code"), oauth2.SetAuthURLParam("code_verifier", codeVerifier), - oauth2.SetAuthURLParam("client_id", c.oauthConfig.ClientID), + oauth2.SetAuthURLParam("client_id", c.OauthConfig.ClientID), ) return token, errors.Wrap(err, "failed to exchange oauth token") } diff --git a/oidc_cli/oidc_impl/client/config_options.go b/oidc_cli/oidc_impl/client/config_options.go index b0f89506..cb1719dd 100644 --- a/oidc_cli/oidc_impl/client/config_options.go +++ b/oidc_cli/oidc_impl/client/config_options.go @@ -20,6 +20,6 @@ var SetSuccessMessage = func(successMessage string) Option { var SetOauth2AuthStyle = func(authStyle oauth2.AuthStyle) Option { return func(c *Client) { - c.oauthConfig.Endpoint.AuthStyle = authStyle + c.OauthConfig.Endpoint.AuthStyle = authStyle } }