1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2024-12-24 10:07:21 +02:00

Never log tokens (#2466)

This commit is contained in:
qwerty287 2023-09-16 10:53:37 +02:00 committed by GitHub
parent a40bb4f890
commit 29e93bdf8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -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
}

View File

@ -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)
}
}
}