Skip to content

Commit

Permalink
(lint) use correct format for non-formatted errors
Browse files Browse the repository at this point in the history
Signed-off-by: Wes Medford <[email protected]>
  • Loading branch information
wrmedford committed Dec 31, 2024
1 parent c006bd3 commit 989a45d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions util/oidc/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func (p *providerImpl) Verify(tokenString string, argoSettings *settings.ArgoCDS
// VerifyJWT verifies a JWT token using the configured JWK Set URL
func (p *providerImpl) VerifyJWT(tokenString string, argoSettings *settings.ArgoCDSettings) (*jwt.Token, error) {
if argoSettings.JWTConfig == nil || argoSettings.JWTConfig.JWKSetURL == "" {
return nil, fmt.Errorf("JWT configuration not found")
return nil, errors.New("JWT configuration not found")
}

cacheTTL := p.defaultCacheTTL
Expand All @@ -190,7 +190,7 @@ func (p *providerImpl) VerifyJWT(tokenString string, argoSettings *settings.Argo

kid, ok := token.Header["kid"].(string)
if !ok {
return nil, fmt.Errorf("kid header not found in token")
return nil, errors.New("kid header not found in token")
}

var key *jose.JSONWebKey
Expand All @@ -216,7 +216,7 @@ func (p *providerImpl) VerifyJWT(tokenString string, argoSettings *settings.Argo

claims, ok := token.Claims.(jwt.MapClaims)
if !ok {
return nil, fmt.Errorf("invalid token claims")
return nil, errors.New("invalid token claims")
}

if argoSettings.JWTConfig.EmailClaim != "" {
Expand Down Expand Up @@ -250,7 +250,7 @@ func (p *providerImpl) VerifyJWT(tokenString string, argoSettings *settings.Argo
}
}
} else if argoSettings.JWTConfig.Audience != "" {
return nil, fmt.Errorf("audience claim not found or invalid type")
return nil, errors.New("audience claim not found or invalid type")
}

return token, nil
Expand Down
2 changes: 1 addition & 1 deletion util/session/sessionmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ func (mgr *SessionManager) VerifyToken(tokenString string) (jwt.Claims, string,
return nil, "", fmt.Errorf("cannot access settings while verifying the token: %w", err)
}
if argoSettings == nil {
return nil, "", fmt.Errorf("settings are not available while verifying the token")
return nil, "", errors.New("settings are not available while verifying the token")
}

// If JWKSetURL is configured, try JWT verification first
Expand Down

0 comments on commit 989a45d

Please sign in to comment.