add missing comments

This commit is contained in:
David Christofas
2022-08-22 14:15:13 +02:00
parent b5ef10dc2b
commit 12d42e0074
5 changed files with 4 additions and 1 deletions

View File

@@ -67,7 +67,6 @@ const (
)
// Authenticator is the common interface implemented by all request authenticators.
type Authenticator interface {
// Authenticate is used to authenticate incoming HTTP requests.
// The Authenticator may augment the request with user info or anything related to the

View File

@@ -16,6 +16,7 @@ type BasicAuthenticator struct {
UserOIDCClaim string
}
// Authenticate implements the authenticator interface to authenticate requests via basic auth.
func (m BasicAuthenticator) Authenticate(r *http.Request) (*http.Request, bool) {
if isPublicPath(r.URL.Path) {
// The authentication of public path requests is handled by another authenticator.

View File

@@ -239,6 +239,7 @@ func (m OIDCAuthenticator) getProvider() OIDCProvider {
return m.provider
}
// Authenticate implements the authenticator interface to authenticate requests via oidc auth.
func (m OIDCAuthenticator) Authenticate(r *http.Request) (*http.Request, bool) {
// there is no bearer token on the request,
if !m.shouldServe(r) || isPublicPath(r.URL.Path) {

View File

@@ -25,6 +25,7 @@ type PublicShareAuthenticator struct {
RevaGatewayClient gateway.GatewayAPIClient
}
// Authenticate implements the authenticator interface to authenticate requests via public share auth.
func (a PublicShareAuthenticator) Authenticate(r *http.Request) (*http.Request, bool) {
if !isPublicPath(r.URL.Path) {
return nil, false

View File

@@ -186,6 +186,7 @@ func (m SignedURLAuthenticator) getSigningKey(ctx context.Context, ocisID string
return res.Records[0].Value, nil
}
// Authenticate implements the authenticator interface to authenticate requests via signed URL auth.
func (m SignedURLAuthenticator) Authenticate(r *http.Request) (*http.Request, bool) {
if !m.shouldServe(r) {
return nil, false