Skip to content

Commit

Permalink
Clarify git-provider-token in logging
Browse files Browse the repository at this point in the history
- Again remove the JWTAuthorizationHeaderPrincipalGetter debug
  statement, its not very useful
  • Loading branch information
foot committed Jan 26, 2023
1 parent 553aba1 commit 21c8080
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions pkg/server/auth/jwt.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ func NewJWTAuthorizationHeaderPrincipalGetter(log logr.Logger, verifier tokenVer
}

func (pg *JWTAuthorizationHeaderPrincipalGetter) Principal(r *http.Request) (*UserPrincipal, error) {
pg.log.V(logger.LogLevelDebug).Info("attempt to read token from auth header")

header := r.Header.Get("Authorization")
if header == "" {
return nil, nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/server/middleware/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func WithProviderToken(jwtClient auth.JWTClient, h http.Handler, log logr.Logger
tokenSlice := strings.Split(tokenStr, "token ")

if len(tokenSlice) < 2 {
log.V(logger.LogLevelDebug).Info("missing or invalid token.")
log.V(logger.LogLevelDebug).Info("missing or invalid git-provider-token.")

This comment has been minimized.

Copy link
@bigkevmcd

bigkevmcd Jan 26, 2023

Contributor

We should probably agree on some logging standards

  • Should we start with capitals or not?
  • Should we end log entries with a full-stop (period)?
  • What do we consider to be "Debug" level logging?
// No token specified. Nothing to be done.
// We do NOT return 400 here because there may be some 'unauthenticated' routes (ie /login)
h.ServeHTTP(w, r)
Expand Down

0 comments on commit 21c8080

Please sign in to comment.