Skip to content

Commit

Permalink
Remove some toke authn log
Browse files Browse the repository at this point in the history
  • Loading branch information
yadzhang authored and choujimmy committed Jan 17, 2020
1 parent fda9bc3 commit ffb7158
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion pkg/auth/authentication/authenticator/oidc.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ func (h *TokenAuthenticator) AuthenticateToken(ctx context.Context, token string

idToken, err := h.IDTokenVerifier.Verify(ctx, token)
if err != nil {
log.Error("Failed to verify the oidc bearer token", log.String("token", token), log.Err(err))
return nil, false, err
}
var claims oidcclaims.IDTokenClaims
Expand Down
1 change: 1 addition & 0 deletions pkg/auth/handler/authn/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func (h *Handler) AuthenticateToken(request *restful.Request, response *restful.

authResp, valid, err := h.tokenAuthenticator.AuthenticateToken(context.Background(), tokenReview.Spec.Token)
if !valid || err != nil {
log.Error("Failed to authenticate token", log.String("token", tokenReview.Spec.Token), log.Bool("valid", valid), log.Err(err))
tokenReview.Status = authv1.TokenReviewStatus{Authenticated: false}
responsewriters.WriteRawJSON(http.StatusUnauthorized, tokenReview, response.ResponseWriter)
return
Expand Down
1 change: 0 additions & 1 deletion pkg/auth/util/sign.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ func (g genericKeySigner) Verify(apiKey string) (*APIClaims, error) {
}

if err != nil {
log.Warn("Verify api key failed", log.String("api key", apiKey), log.Any("result", result), log.Err(err))
if ve, ok := err.(*jwt.ValidationError); ok {
if ve.Errors&jwt.ValidationErrorMalformed != 0 {
return claims, fmt.Errorf("not valid jwt token format")
Expand Down

0 comments on commit ffb7158

Please sign in to comment.