Skip to content

Commit

Permalink
Never log tokens (#2466)
Browse files Browse the repository at this point in the history
  • Loading branch information
qwerty287 authored Sep 16, 2023
1 parent a40bb4f commit 29e93bd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion agent/rpc/auth_interceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func (interceptor *AuthInterceptor) refreshToken() error {
}

interceptor.accessToken = accessToken
log.Trace().Str("token", accessToken).Msg("Token refreshed")
log.Trace().Msg("token refreshed")

return nil
}
3 changes: 2 additions & 1 deletion server/cron/cron.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,14 @@ func CreatePipeline(ctx context.Context, store store.Store, f forge.Forge, cron
// the pipeline.
if refresher, ok := f.(forge.Refresher); ok {
refreshed, err := refresher.Refresh(ctx, creator)
log.Debug().Msgf("token refreshed: %t", refreshed)
if err != nil {
log.Error().Err(err).Msgf("failed to refresh oauth2 token for creator: %s", creator.Login)
} else if refreshed {
if err := store.UpdateUser(creator); err != nil {
log.Error().Err(err).Msgf("error while updating creator: %s", creator.Login)
// move forward
} else {
log.Debug().Msgf("token refreshed for creator: %s", creator.Login)
}
}
}
Expand Down

0 comments on commit 29e93bd

Please sign in to comment.