mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-11-27 02:24:09 -05:00
Merge pull request #4070 from opencloud-eu/bump-reva-ocm-gateway-selectors
[full-ci] build: bump reva to the ocm gateway selector fix
This commit is contained in:
6 files changed
+31
-14
No files matched your search
@@ -68,7 +68,7 @@ require (
|
||||
github.com/open-policy-agent/opa v1.21.1
|
||||
github.com/opencloud-eu/icap-client v0.0.0-20250930132611-28a2afe62d89
|
||||
github.com/opencloud-eu/libre-graph-api-go v1.0.9-0.20261016073229-17ed3d5dd346
|
||||
github.com/opencloud-eu/reva/v3 v3.0.2-0.20261119121328-0093d72f4c9d
|
||||
github.com/opencloud-eu/reva/v3 v3.0.2-0.20261119135952-a49952dded04
|
||||
github.com/opensearch-project/opensearch-go/v4 v4.7.3
|
||||
github.com/orcaman/concurrent-map v1.0.0
|
||||
github.com/pkg/errors v0.9.1
|
||||
|
||||
@@ -761,8 +761,8 @@ github.com/opencloud-eu/icap-client v0.0.0-20250930132611-28a2afe62d89 h1:W1ms+l
|
||||
github.com/opencloud-eu/icap-client v0.0.0-20250930132611-28a2afe62d89/go.mod h1:vigJkNss1N2QEceCuNw/ullDehncuJNFB6mEnzfq9UI=
|
||||
github.com/opencloud-eu/libre-graph-api-go v1.0.9-0.20261016073229-17ed3d5dd346 h1:3ptbiFhSK4fzY/rC3idcYUveiwepMoOov1sBpc7Rg3k=
|
||||
github.com/opencloud-eu/libre-graph-api-go v1.0.9-0.20261016073229-17ed3d5dd346/go.mod h1:lTM8JeGblNpoMySTW7Lui2+c5TTLI95mwxtdUIHHrhU=
|
||||
github.com/opencloud-eu/reva/v3 v3.0.2-0.20261119121328-0093d72f4c9d h1:pVqdcXJgDmypBdJChOWJvKL6gPeG3nEGU6lcuwbhv8E=
|
||||
github.com/opencloud-eu/reva/v3 v3.0.2-0.20261119121328-0093d72f4c9d/go.mod h1:lwylaua29K7ge30pFxzHMh6LeH9bhCQduFdw+qKFzJA=
|
||||
github.com/opencloud-eu/reva/v3 v3.0.2-0.20261119135952-a49952dded04 h1:OlA8AOMQm4OzN5FT8YqCJG99qXt4N5Nrc3BviUN46os=
|
||||
github.com/opencloud-eu/reva/v3 v3.0.2-0.20261119135952-a49952dded04/go.mod h1:lwylaua29K7ge30pFxzHMh6LeH9bhCQduFdw+qKFzJA=
|
||||
github.com/opencloud-eu/secure v0.0.0-20260312082735-b6f5cb2244e4 h1:l2oB/RctH+t8r7QBj5p8thfEHCM/jF35aAY3WQ3hADI=
|
||||
github.com/opencloud-eu/secure v0.0.0-20260312082735-b6f5cb2244e4/go.mod h1:BmF5hyM6tXczk3MpQkFf1hpKSRqCyhqcbiQtiAF7+40=
|
||||
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
|
||||
|
||||
+9
-4
@@ -48,7 +48,7 @@ func init() {
|
||||
|
||||
type manager struct {
|
||||
c *config
|
||||
gw gateway.GatewayAPIClient
|
||||
gw *pool.Selector[gateway.GatewayAPIClient]
|
||||
}
|
||||
|
||||
type config struct {
|
||||
@@ -65,7 +65,7 @@ func New(m map[string]any, _ *zerolog.Logger) (auth.Manager, error) {
|
||||
if err := mgr.Configure(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
gw, err := pool.GetGatewayServiceClient(mgr.c.GatewayAddr)
|
||||
gw, err := pool.GatewaySelector(mgr.c.GatewayAddr)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -85,8 +85,13 @@ func (m *manager) Configure(ml map[string]interface{}) error {
|
||||
|
||||
func (m *manager) Authenticate(ctx context.Context, ocmshare, sharedSecret string) (*userpb.User, map[string]*authpb.Scope, error) {
|
||||
log := appctx.GetLogger(ctx).With().Str("ocmshare", ocmshare).Logger()
|
||||
gwc, err := m.gw.Next()
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
// We need to use GetOCMShareByToken, as GetOCMShare would require a user in the context
|
||||
shareRes, err := m.gw.GetOCMShareByToken(ctx, &ocm.GetOCMShareByTokenRequest{
|
||||
shareRes, err := gwc.GetOCMShareByToken(ctx, &ocm.GetOCMShareByTokenRequest{
|
||||
Token: sharedSecret,
|
||||
})
|
||||
|
||||
@@ -129,7 +134,7 @@ func (m *manager) Authenticate(ctx context.Context, ocmshare, sharedSecret strin
|
||||
},
|
||||
}
|
||||
|
||||
userRes, err := m.gw.GetAcceptedUser(ctx, &ocminvite.GetAcceptedUserRequest{
|
||||
userRes, err := gwc.GetAcceptedUser(ctx, &ocminvite.GetAcceptedUserRequest{
|
||||
RemoteUserId: u,
|
||||
Opaque: o,
|
||||
})
|
||||
|
||||
+13
-5
@@ -60,7 +60,7 @@ func init() {
|
||||
|
||||
type driver struct {
|
||||
c *config
|
||||
gateway gateway.GatewayAPIClient
|
||||
gateway *pool.Selector[gateway.GatewayAPIClient]
|
||||
}
|
||||
|
||||
type config struct {
|
||||
@@ -108,7 +108,7 @@ func New(m map[string]interface{}, _ events.Stream, _ *zerolog.Logger) (storage.
|
||||
return nil, err
|
||||
}
|
||||
|
||||
gateway, err := pool.GetGatewayServiceClient(c.GatewaySVC)
|
||||
gateway, err := pool.GatewaySelector(c.GatewaySVC)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -156,7 +156,11 @@ func (d *driver) getWebDAVFromShare(ctx context.Context, forUser *userpb.UserId,
|
||||
if forUser != nil {
|
||||
req.Opaque = utils.AppendJSONToOpaque(nil, "userid", forUser)
|
||||
}
|
||||
res, err := d.gateway.GetReceivedOCMShare(ctx, req)
|
||||
gwc, err := d.gateway.Next()
|
||||
if err != nil {
|
||||
return nil, "", "", err
|
||||
}
|
||||
res, err := gwc.GetReceivedOCMShare(ctx, req)
|
||||
if err != nil {
|
||||
return nil, "", "", err
|
||||
}
|
||||
@@ -564,14 +568,18 @@ func (d *driver) ListStorageSpaces(ctx context.Context, filters []*provider.List
|
||||
}
|
||||
}
|
||||
|
||||
lrsRes, err := d.gateway.ListReceivedOCMShares(ctx, &ocmpb.ListReceivedOCMSharesRequest{})
|
||||
gwc, err := d.gateway.Next()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
lrsRes, err := gwc.ListReceivedOCMShares(ctx, &ocmpb.ListReceivedOCMSharesRequest{})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// FIXME This might have to be ListOCMShares
|
||||
// these are grants
|
||||
|
||||
lsRes, err := d.gateway.ListOCMShares(ctx, &ocmpb.ListOCMSharesRequest{})
|
||||
lsRes, err := gwc.ListOCMShares(ctx, &ocmpb.ListOCMSharesRequest{})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
+5
-1
@@ -64,7 +64,11 @@ func (d *driver) CommitUpload(ctx context.Context, ref *provider.Reference, sess
|
||||
// it authenticates as the service account and looks up the share on behalf of the
|
||||
// upload's executant.
|
||||
func (d *driver) serviceWebdavClient(ctx context.Context, ref *provider.Reference) (*gowebdav.Client, *ocmpb.ReceivedShare, string, error) {
|
||||
serviceUserCtx, err := utils.GetServiceUserContextWithContext(context.Background(), d.gateway, d.c.ServiceAccountID, d.c.ServiceAccountSecret)
|
||||
gwc, err := d.gateway.Next()
|
||||
if err != nil {
|
||||
return nil, nil, "", err
|
||||
}
|
||||
serviceUserCtx, err := utils.GetServiceUserContextWithContext(context.Background(), gwc, d.c.ServiceAccountID, d.c.ServiceAccountSecret)
|
||||
if err != nil {
|
||||
return nil, nil, "", err
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1360,7 +1360,7 @@ github.com/opencloud-eu/icap-client
|
||||
# github.com/opencloud-eu/libre-graph-api-go v1.0.9-0.20261016073229-17ed3d5dd346
|
||||
## explicit; go 1.23
|
||||
github.com/opencloud-eu/libre-graph-api-go
|
||||
# github.com/opencloud-eu/reva/v3 v3.0.2-0.20261119121328-0093d72f4c9d
|
||||
# github.com/opencloud-eu/reva/v3 v3.0.2-0.20261119135952-a49952dded04
|
||||
## explicit; go 1.26.0
|
||||
github.com/opencloud-eu/reva/v3/cmd/revad/internal/grace
|
||||
github.com/opencloud-eu/reva/v3/cmd/revad/runtime
|
||||
|
||||
Reference in new issue
Block a user