Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
james-d-elliott committed Sep 28, 2024
1 parent b43bc14 commit 5df0ecf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions handler/oauth2/strategy_jwt_profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,9 @@ func fmtValidateJWTError(token *jwt.Token, client jwt.Client, inner error) (err
case errJWTValidation.Has(jwt.ValidationErrorAudience):
aud, ok := token.Claims.GetAudience()
if ok {
return oauth2.ErrTokenClaim.WithDebugf("Token %shas an invalid audience. The token was expected to have an 'iss' claim with one of the following values: ''. The 'iss' claim has a value of '%s'.", clientText, aud)
return oauth2.ErrTokenClaim.WithDebugf("Token %shas an invalid audience. The token was expected to have an 'iss' claim with one of the following values: ''. The 'aud' claim has a value of '%s'.", clientText, aud)
} else {
return oauth2.ErrTokenClaim.WithDebugf("Token %shas an invalid audience. The token does not have an 'iss' claim or it has an invalid type.", clientText)
return oauth2.ErrTokenClaim.WithDebugf("Token %shas an invalid audience. The token does not have an 'aud' claim or it has an invalid type.", clientText)
}
case errJWTValidation.Has(jwt.ValidationErrorClaimsInvalid):
return oauth2.ErrTokenClaim.WithDebugf("Token %shas invalid claims. Error occurred trying to validate the request objects claims: %s", clientText, strings.TrimPrefix(errJWTValidation.Error(), "go-jose/go-jose: "))
Expand Down
4 changes: 2 additions & 2 deletions token/jwt/claims_map_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,9 @@ func TestMapClaims_VerifyAudienceAny(t *testing.T) {
{
"ShouldPassMultipleAny",
MapClaims{
consts.ClaimAudience: []string{"foo"},
consts.ClaimAudience: []string{"foo", "baz"},
},
[]string{"foo", "bar"},
[]string{"bar", "baz"},
true,
true,
},
Expand Down
3 changes: 3 additions & 0 deletions token/jwt/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,9 @@ type JWTProfileAccessTokenClient interface {
// MUST NOT be specified without setting access_token_encrypted_response_alg.
GetAccessTokenEncryptedResponseEnc() (alg string)

// GetEnableJWTProfileOAuthAccessTokens indicates this client should or should not issue JWT Profile Access Tokens.
GetEnableJWTProfileOAuthAccessTokens() (enforce bool)

BaseClient
}

Expand Down

0 comments on commit 5df0ecf

Please sign in to comment.