mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-06 04:09:40 -06:00
refactor proxy code
I refactored the proxy so that we execute the routing before the authentication middleware. This is necessary so that we can determine which routes are considered unprotected i.e. which routes don't need authentication.
This commit is contained in:
committed by
Ralf Haferkamp
parent
48b0425fed
commit
4d4f3a16e1
@@ -26,6 +26,7 @@ import (
|
||||
"github.com/owncloud/ocis/v2/services/proxy/pkg/metrics"
|
||||
"github.com/owncloud/ocis/v2/services/proxy/pkg/middleware"
|
||||
"github.com/owncloud/ocis/v2/services/proxy/pkg/proxy"
|
||||
"github.com/owncloud/ocis/v2/services/proxy/pkg/router"
|
||||
"github.com/owncloud/ocis/v2/services/proxy/pkg/server/debug"
|
||||
proxyHTTP "github.com/owncloud/ocis/v2/services/proxy/pkg/server/http"
|
||||
"github.com/owncloud/ocis/v2/services/proxy/pkg/tracing"
|
||||
@@ -211,6 +212,8 @@ func loadMiddlewares(ctx context.Context, logger log.Logger, cfg *config.Config)
|
||||
oidcHTTPClient,
|
||||
),
|
||||
|
||||
router.Middleware(cfg.PolicySelector, cfg.Policies, logger),
|
||||
|
||||
middleware.Authentication(
|
||||
authenticators,
|
||||
middleware.CredentialsByUserAgent(cfg.AuthMiddleware.CredentialsByUserAgent),
|
||||
|
||||
Reference in New Issue
Block a user