mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-25 19:56:09 +01:00
Merge pull request #14116 from reasonerjt/reduce-oidc-warning
Reduce warning logs in OIDC middleware
This commit is contained in:
commit
120d88a0dd
@ -40,6 +40,9 @@ func (i *idToken) Generate(req *http.Request) security.Context {
|
||||
return nil
|
||||
}
|
||||
token := bearerToken(req)
|
||||
if len(token) == 0 {
|
||||
return nil
|
||||
}
|
||||
claims, err := oidc.VerifyToken(ctx, token)
|
||||
if err != nil {
|
||||
log.Warningf("failed to verify token: %v", err)
|
||||
|
@ -15,12 +15,13 @@
|
||||
package security
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
"github.com/goharbor/harbor/src/common"
|
||||
"github.com/goharbor/harbor/src/lib"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"net/http"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestIDToken(t *testing.T) {
|
||||
|
Loading…
Reference in New Issue
Block a user