Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
Signed-off-by: Houssem Ben Mabrouk <[email protected]>
  • Loading branch information
orange-hbenmabrouk committed Apr 22, 2024
1 parent 4137a9c commit 8e0a619
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions connector/oidc/oidc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions connector/oidc/oidc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,6 @@ func TestHandleCallback(t *testing.T) {
clientCredentials: false,
},
{

name: "withCustomCredentials",
userIDKey: "", // not configured
userNameKey: "", // not configured
Expand Down Expand Up @@ -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,
},
{
Expand All @@ -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,
},
}
Expand Down

0 comments on commit 8e0a619

Please sign in to comment.