fix(proxy): fix build after rebase

Signed-off-by: jkoberg <jkoberg@owncloud.com>
This commit is contained in:
jkoberg
2024-07-23 08:58:07 +02:00
parent 7005cbc0fc
commit 3b3d30159d
4 changed files with 7 additions and 13 deletions
@@ -18,13 +18,13 @@ func FullDefaultConfig() *config.Config {
func DefaultConfig() *config.Config { func DefaultConfig() *config.Config {
return &config.Config{ return &config.Config{
Debug: config.Debug{ Debug: config.Debug{
Addr: "127.0.0.1:9197", Addr: "127.0.0.1:9245",
Token: "", Token: "",
Pprof: false, Pprof: false,
Zpages: false, Zpages: false,
}, },
GRPC: config.GRPCConfig{ GRPC: config.GRPCConfig{
Addr: "127.0.0.1:9195", Addr: "127.0.0.1:9246",
Namespace: "com.owncloud.api", Namespace: "com.owncloud.api",
Protocol: "tcp", Protocol: "tcp",
}, },
-7
View File
@@ -247,14 +247,10 @@ func Server(cfg *config.Config) *cli.Command {
} }
} }
<<<<<<< HEAD
func loadMiddlewares(logger log.Logger, cfg *config.Config, func loadMiddlewares(logger log.Logger, cfg *config.Config,
userInfoCache, signingKeyStore microstore.Store, traceProvider trace.TracerProvider, metrics metrics.Metrics, userInfoCache, signingKeyStore microstore.Store, traceProvider trace.TracerProvider, metrics metrics.Metrics,
userProvider backend.UserBackend, gatewaySelector pool.Selectable[gateway.GatewayAPIClient]) alice.Chain { userProvider backend.UserBackend, gatewaySelector pool.Selectable[gateway.GatewayAPIClient]) alice.Chain {
=======
func loadMiddlewares(logger log.Logger, cfg *config.Config, userInfoCache, signingKeyStore microstore.Store, traceProvider trace.TracerProvider, metrics metrics.Metrics) alice.Chain {
>>>>>>> a9df2a66b1 (feat: reva app auth)
rolesClient := settingssvc.NewRoleService("com.owncloud.api.settings", cfg.GrpcClient) rolesClient := settingssvc.NewRoleService("com.owncloud.api.settings", cfg.GrpcClient)
policiesProviderClient := policiessvc.NewPoliciesProviderService("com.owncloud.api.policies", cfg.GrpcClient) policiesProviderClient := policiessvc.NewPoliciesProviderService("com.owncloud.api.policies", cfg.GrpcClient)
@@ -298,8 +294,6 @@ func loadMiddlewares(logger log.Logger, cfg *config.Config, userInfoCache, signi
}) })
} }
<<<<<<< HEAD
=======
authenticators = append(authenticators, middleware.AppAuthAuthenticator{ authenticators = append(authenticators, middleware.AppAuthAuthenticator{
Logger: logger, Logger: logger,
RevaGatewaySelector: gatewaySelector, RevaGatewaySelector: gatewaySelector,
@@ -308,7 +302,6 @@ func loadMiddlewares(logger log.Logger, cfg *config.Config, userInfoCache, signi
Logger: logger, Logger: logger,
RevaGatewaySelector: gatewaySelector, RevaGatewaySelector: gatewaySelector,
}) })
>>>>>>> a9df2a66b1 (feat: reva app auth)
authenticators = append(authenticators, middleware.NewOIDCAuthenticator( authenticators = append(authenticators, middleware.NewOIDCAuthenticator(
middleware.Logger(logger), middleware.Logger(logger),
middleware.UserInfoCache(userInfoCache), middleware.UserInfoCache(userInfoCache),
+1 -1
View File
@@ -13,7 +13,7 @@ import (
// AppAuthAuthenticator defines the app auth authenticator // AppAuthAuthenticator defines the app auth authenticator
type AppAuthAuthenticator struct { type AppAuthAuthenticator struct {
Logger log.Logger Logger log.Logger
RevaGatewaySelector *pool.Selector[gateway.GatewayAPIClient] RevaGatewaySelector pool.Selectable[gateway.GatewayAPIClient]
} }
// Authenticate implements the authenticator interface to authenticate requests via app auth. // Authenticate implements the authenticator interface to authenticate requests via app auth.
@@ -1,12 +1,13 @@
package middleware package middleware
import ( import (
"net/http"
"net/http/httptest"
gateway "github.com/cs3org/go-cs3apis/cs3/gateway/v1beta1" gateway "github.com/cs3org/go-cs3apis/cs3/gateway/v1beta1"
rpcv1beta1 "github.com/cs3org/go-cs3apis/cs3/rpc/v1beta1" rpcv1beta1 "github.com/cs3org/go-cs3apis/cs3/rpc/v1beta1"
"github.com/cs3org/reva/v2/pkg/rgrpc/todo/pool" "github.com/cs3org/reva/v2/pkg/rgrpc/todo/pool"
"google.golang.org/grpc" "google.golang.org/grpc"
"net/http"
"net/http/httptest"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
@@ -22,7 +23,7 @@ var _ = Describe("Authenticating requests", Label("AppAuthAuthenticator"), func(
RevaGatewaySelector: pool.GetSelector[gateway.GatewayAPIClient]( RevaGatewaySelector: pool.GetSelector[gateway.GatewayAPIClient](
"GatewaySelector", "GatewaySelector",
"com.owncloud.api.gateway", "com.owncloud.api.gateway",
func(cc *grpc.ClientConn) gateway.GatewayAPIClient { func(cc grpc.ClientConnInterface) gateway.GatewayAPIClient {
return mockGatewayClient{ return mockGatewayClient{
AuthenticateFunc: func(authType, clientID, clientSecret string) (string, rpcv1beta1.Code) { AuthenticateFunc: func(authType, clientID, clientSecret string) (string, rpcv1beta1.Code) {
if authType != "appauth" { if authType != "appauth" {