fix(proxy): fix build after rebase

Signed-off-by: jkoberg <jkoberg@owncloud.com>
This commit is contained in:
jkoberg
2024-07-12 09:12:58 +02:00
parent 7005cbc0fc
commit 3b3d30159d
4 changed files with 7 additions and 13 deletions

View File

@@ -18,13 +18,13 @@ func FullDefaultConfig() *config.Config {
func DefaultConfig() *config.Config {
return &config.Config{
Debug: config.Debug{
Addr: "127.0.0.1:9197",
Addr: "127.0.0.1:9245",
Token: "",
Pprof: false,
Zpages: false,
},
GRPC: config.GRPCConfig{
Addr: "127.0.0.1:9195",
Addr: "127.0.0.1:9246",
Namespace: "com.owncloud.api",
Protocol: "tcp",
},

View File

@@ -247,14 +247,10 @@ func Server(cfg *config.Config) *cli.Command {
}
}
<<<<<<< HEAD
func loadMiddlewares(logger log.Logger, cfg *config.Config,
userInfoCache, signingKeyStore microstore.Store, traceProvider trace.TracerProvider, metrics metrics.Metrics,
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)
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{
Logger: logger,
RevaGatewaySelector: gatewaySelector,
@@ -308,7 +302,6 @@ func loadMiddlewares(logger log.Logger, cfg *config.Config, userInfoCache, signi
Logger: logger,
RevaGatewaySelector: gatewaySelector,
})
>>>>>>> a9df2a66b1 (feat: reva app auth)
authenticators = append(authenticators, middleware.NewOIDCAuthenticator(
middleware.Logger(logger),
middleware.UserInfoCache(userInfoCache),

View File

@@ -13,7 +13,7 @@ import (
// AppAuthAuthenticator defines the app auth authenticator
type AppAuthAuthenticator struct {
Logger log.Logger
RevaGatewaySelector *pool.Selector[gateway.GatewayAPIClient]
RevaGatewaySelector pool.Selectable[gateway.GatewayAPIClient]
}
// Authenticate implements the authenticator interface to authenticate requests via app auth.

View File

@@ -1,12 +1,13 @@
package middleware
import (
"net/http"
"net/http/httptest"
gateway "github.com/cs3org/go-cs3apis/cs3/gateway/v1beta1"
rpcv1beta1 "github.com/cs3org/go-cs3apis/cs3/rpc/v1beta1"
"github.com/cs3org/reva/v2/pkg/rgrpc/todo/pool"
"google.golang.org/grpc"
"net/http"
"net/http/httptest"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
@@ -22,7 +23,7 @@ var _ = Describe("Authenticating requests", Label("AppAuthAuthenticator"), func(
RevaGatewaySelector: pool.GetSelector[gateway.GatewayAPIClient](
"GatewaySelector",
"com.owncloud.api.gateway",
func(cc *grpc.ClientConn) gateway.GatewayAPIClient {
func(cc grpc.ClientConnInterface) gateway.GatewayAPIClient {
return mockGatewayClient{
AuthenticateFunc: func(authType, clientID, clientSecret string) (string, rpcv1beta1.Code) {
if authType != "appauth" {