linting and other cleanups

This commit is contained in:
Florian Schade
2020-11-17 11:32:12 +01:00
committed by Benedikt Kulmann
parent f8aa1a5e08
commit 8be5323276
8 changed files with 16 additions and 8 deletions
+3 -5
View File
@@ -10,10 +10,12 @@ import (
"strings"
)
// OIDCProvider used to mock the oidc provider during tests
type OIDCProvider interface {
UserInfo(ctx context.Context, ts oauth2.TokenSource) (*gOidc.UserInfo, error)
}
// OIDCAuth provides a middleware to check access secured by a static token.
func OIDCAuth(optionSetters ...Option) func(next http.Handler) http.Handler {
options := newOptions(optionSetters...)
@@ -111,9 +113,5 @@ func (m oidcAuth) shouldServe(req *http.Request) bool {
}
}
if !strings.HasPrefix(header, "Bearer ") {
return false
}
return true
return strings.HasPrefix(header, "Bearer ")
}