From 8e0a6191e08f5950fdb9786676d95738d166ba0d Mon Sep 17 00:00:00 2001 From: Houssem Ben Mabrouk Date: Mon, 22 Apr 2024 11:37:52 +0200 Subject: [PATCH] fix lint Signed-off-by: Houssem Ben Mabrouk --- connector/oidc/oidc.go | 4 ++-- connector/oidc/oidc_test.go | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/connector/oidc/oidc.go b/connector/oidc/oidc.go index 353d47c7cf..3e20262019 100644 --- a/connector/oidc/oidc.go +++ b/connector/oidc/oidc.go @@ -381,9 +381,9 @@ func (c *oidcConnector) getTokenViaClientCredentials(r *http.Request) (token *oa clientSecret = q.Get("custom_client_secret") } - // Check if parsed credentials are not empty + // Check if oauth2 credentials are not empty if len(clientID) == 0 || len(clientSecret) == 0 { - return nil, fmt.Errorf("oidc: unable to parse clientID or clientSecret") + return nil, fmt.Errorf("oidc: unable to get clientID or clientSecret") } // Construct data to be sent to the external IdP diff --git a/connector/oidc/oidc_test.go b/connector/oidc/oidc_test.go index 2522ff0e27..310ef386ee 100644 --- a/connector/oidc/oidc_test.go +++ b/connector/oidc/oidc_test.go @@ -424,7 +424,6 @@ func TestHandleCallback(t *testing.T) { clientCredentials: false, }, { - name: "withCustomCredentials", userIDKey: "", // not configured userNameKey: "", // not configured @@ -482,7 +481,7 @@ func TestHandleCallback(t *testing.T) { customClientSecret: "", // not configured in the request scopes: []string{"openid"}, token: nil, - expectedHandlerError: fmt.Errorf("oidc: unable to parse clientID or clientSecret"), + expectedHandlerError: fmt.Errorf("oidc: unable to get clientID or clientSecret"), clientCredentials: true, }, { @@ -499,7 +498,7 @@ func TestHandleCallback(t *testing.T) { customClientSecret: "", // not configured in the request scopes: []string{"openid"}, token: nil, - expectedHandlerError: fmt.Errorf("oidc: unable to parse clientID or clientSecret"), + expectedHandlerError: fmt.Errorf("oidc: unable to get clientID or clientSecret"), clientCredentials: true, }, }