Skip to content

Commit

Permalink
Don't log auth tokens in debug mode (#5497)
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Parraga <[email protected]>
  • Loading branch information
Sovietaced authored Jun 25, 2024
1 parent 242303b commit f1e511d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions flyteadmin/auth/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,10 @@ func GetAuthenticationCustomMetadataInterceptor(authCtx interfaces.Authenticatio
if authCtx.Options().GrpcAuthorizationHeader != DefaultAuthorizationHeader {
md, ok := metadata.FromIncomingContext(ctx)
if ok {
existingHeader := md.Get(authCtx.Options().GrpcAuthorizationHeader)
grpcAuthzHeader := authCtx.Options().GrpcAuthorizationHeader
existingHeader := md.Get(grpcAuthzHeader)
if len(existingHeader) > 0 {
logger.Debugf(ctx, "Found existing metadata %s", existingHeader[0])
logger.Debugf(ctx, "Found existing metadata header %s", grpcAuthzHeader)
newAuthorizationMetadata := metadata.Pairs(DefaultAuthorizationHeader, existingHeader[0])
joinedMetadata := metadata.Join(md, newAuthorizationMetadata)
newCtx := metadata.NewIncomingContext(ctx, joinedMetadata)
Expand Down

0 comments on commit f1e511d

Please sign in to comment.