From 12d42e00746fb6f4050f645bb864403549ce4de5 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Mon, 22 Aug 2022 14:15:13 +0200 Subject: [PATCH] add missing comments --- services/proxy/pkg/middleware/authentication.go | 1 - services/proxy/pkg/middleware/basic_auth.go | 1 + services/proxy/pkg/middleware/oidc_auth.go | 1 + services/proxy/pkg/middleware/public_share_auth.go | 1 + services/proxy/pkg/middleware/signed_url_auth.go | 1 + 5 files changed, 4 insertions(+), 1 deletion(-) diff --git a/services/proxy/pkg/middleware/authentication.go b/services/proxy/pkg/middleware/authentication.go index a21854676..93a023038 100644 --- a/services/proxy/pkg/middleware/authentication.go +++ b/services/proxy/pkg/middleware/authentication.go @@ -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 diff --git a/services/proxy/pkg/middleware/basic_auth.go b/services/proxy/pkg/middleware/basic_auth.go index eb8f79847..913e74048 100644 --- a/services/proxy/pkg/middleware/basic_auth.go +++ b/services/proxy/pkg/middleware/basic_auth.go @@ -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. diff --git a/services/proxy/pkg/middleware/oidc_auth.go b/services/proxy/pkg/middleware/oidc_auth.go index 36adeeb29..c89f83d5c 100644 --- a/services/proxy/pkg/middleware/oidc_auth.go +++ b/services/proxy/pkg/middleware/oidc_auth.go @@ -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) { diff --git a/services/proxy/pkg/middleware/public_share_auth.go b/services/proxy/pkg/middleware/public_share_auth.go index cab9b6ebf..8f82bf720 100644 --- a/services/proxy/pkg/middleware/public_share_auth.go +++ b/services/proxy/pkg/middleware/public_share_auth.go @@ -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 diff --git a/services/proxy/pkg/middleware/signed_url_auth.go b/services/proxy/pkg/middleware/signed_url_auth.go index 2455e8eec..793f6d8ad 100644 --- a/services/proxy/pkg/middleware/signed_url_auth.go +++ b/services/proxy/pkg/middleware/signed_url_auth.go @@ -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