Bump reva

This commit is contained in:
André Duffeck
2023-10-18 18:15:21 +02:00
parent b3a92548b7
commit 0b10285dd6
5 changed files with 38 additions and 19 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ require (
github.com/coreos/go-oidc v2.2.1+incompatible github.com/coreos/go-oidc v2.2.1+incompatible
github.com/coreos/go-oidc/v3 v3.6.0 github.com/coreos/go-oidc/v3 v3.6.0
github.com/cs3org/go-cs3apis v0.0.0-20230727093620-0f4399be4543 github.com/cs3org/go-cs3apis v0.0.0-20230727093620-0f4399be4543
github.com/cs3org/reva/v2 v2.16.1-0.20231012102459-2b27cd47ab72 github.com/cs3org/reva/v2 v2.16.1-0.20231018140500-4565fd54f281
github.com/disintegration/imaging v1.6.2 github.com/disintegration/imaging v1.6.2
github.com/dutchcoders/go-clamd v0.0.0-20170520113014-b970184f4d9e github.com/dutchcoders/go-clamd v0.0.0-20170520113014-b970184f4d9e
github.com/egirna/icap-client v0.1.1 github.com/egirna/icap-client v0.1.1
+2 -2
View File
@@ -1013,8 +1013,8 @@ github.com/crewjam/httperr v0.2.0 h1:b2BfXR8U3AlIHwNeFFvZ+BV1LFvKLlzMjzaTnZMybNo
github.com/crewjam/httperr v0.2.0/go.mod h1:Jlz+Sg/XqBQhyMjdDiC+GNNRzZTD7x39Gu3pglZ5oH4= github.com/crewjam/httperr v0.2.0/go.mod h1:Jlz+Sg/XqBQhyMjdDiC+GNNRzZTD7x39Gu3pglZ5oH4=
github.com/crewjam/saml v0.4.14 h1:g9FBNx62osKusnFzs3QTN5L9CVA/Egfgm+stJShzw/c= github.com/crewjam/saml v0.4.14 h1:g9FBNx62osKusnFzs3QTN5L9CVA/Egfgm+stJShzw/c=
github.com/crewjam/saml v0.4.14/go.mod h1:UVSZCf18jJkk6GpWNVqcyQJMD5HsRugBPf4I1nl2mME= github.com/crewjam/saml v0.4.14/go.mod h1:UVSZCf18jJkk6GpWNVqcyQJMD5HsRugBPf4I1nl2mME=
github.com/cs3org/reva/v2 v2.16.1-0.20231012102459-2b27cd47ab72 h1:53M+ldLYQSxl/iJokKfOUmY0ntMhnATQu9cBZE1X53k= github.com/cs3org/reva/v2 v2.16.1-0.20231018140500-4565fd54f281 h1:XvLyfOO8s4vTIIaxbUnnoWh6pPOdA1OT4Jlc5USr1Og=
github.com/cs3org/reva/v2 v2.16.1-0.20231012102459-2b27cd47ab72/go.mod h1:6M5k4UvGUgZh31t4r70RwbesW+w2EM/gd/gpuQZxAPg= github.com/cs3org/reva/v2 v2.16.1-0.20231018140500-4565fd54f281/go.mod h1:6M5k4UvGUgZh31t4r70RwbesW+w2EM/gd/gpuQZxAPg=
github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
+11 -12
View File
@@ -805,19 +805,18 @@ func (m *Manager) ListReceivedShares(ctx context.Context, filters []*collaborati
} }
// add all spaces the user has receved shares for, this includes mount points and share state for groups // add all spaces the user has receved shares for, this includes mount points and share state for groups
// TODO: rewrite this code to not use the internal strucs anymore (e.g. by adding a List method). Sync can then be made private. spaces, err := m.UserReceivedStates.List(ctx, user.Id.OpaqueId)
_ = m.UserReceivedStates.Sync(ctx, user.Id.OpaqueId) // ignore error, cache will be updated on next read if err != nil {
return nil, err
if m.UserReceivedStates.ReceivedSpaces[user.Id.OpaqueId] != nil { }
for ssid, rspace := range m.UserReceivedStates.ReceivedSpaces[user.Id.OpaqueId].Spaces { for ssid, rspace := range spaces {
if rs, ok := ssids[ssid]; ok { if rs, ok := ssids[ssid]; ok {
for shareid, state := range rspace.States { for shareid, state := range rspace.States {
// overwrite state // overwrite state
rs.States[shareid] = state rs.States[shareid] = state
}
} else {
ssids[ssid] = rspace
} }
} else {
ssids[ssid] = rspace
} }
} }
@@ -177,15 +177,35 @@ func (c *Cache) Get(ctx context.Context, userID, spaceID, shareID string) (*Stat
return c.ReceivedSpaces[userID].Spaces[spaceID].States[shareID], nil return c.ReceivedSpaces[userID].Spaces[spaceID].States[shareID], nil
} }
// Sync updates the in-memory data with the data from the storage if it is outdated // List returns a list of received shares for a given user
func (c *Cache) Sync(ctx context.Context, userID string) error { // The return list is guaranteed to be thread-safe
func (c *Cache) List(ctx context.Context, userID string) (map[string]*Space, error) {
ctx, span := appctx.GetTracerProvider(ctx).Tracer(tracerName).Start(ctx, "Grab lock") ctx, span := appctx.GetTracerProvider(ctx).Tracer(tracerName).Start(ctx, "Grab lock")
unlock := c.lockUser(userID) unlock := c.lockUser(userID)
span.End() span.End()
span.SetAttributes(attribute.String("cs3.userid", userID)) span.SetAttributes(attribute.String("cs3.userid", userID))
defer unlock() defer unlock()
return c.syncWithLock(ctx, userID) err := c.syncWithLock(ctx, userID)
if err != nil {
return nil, err
}
spaces := map[string]*Space{}
for spaceID, space := range c.ReceivedSpaces[userID].Spaces {
spaceCopy := &Space{
States: map[string]*State{},
}
for shareID, state := range space.States {
spaceCopy.States[shareID] = &State{
State: state.State,
MountPoint: state.MountPoint,
Hide: state.Hide,
}
}
spaces[spaceID] = spaceCopy
}
return spaces, nil
} }
func (c *Cache) syncWithLock(ctx context.Context, userID string) error { func (c *Cache) syncWithLock(ctx context.Context, userID string) error {
+1 -1
View File
@@ -357,7 +357,7 @@ github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1
github.com/cs3org/go-cs3apis/cs3/storage/registry/v1beta1 github.com/cs3org/go-cs3apis/cs3/storage/registry/v1beta1
github.com/cs3org/go-cs3apis/cs3/tx/v1beta1 github.com/cs3org/go-cs3apis/cs3/tx/v1beta1
github.com/cs3org/go-cs3apis/cs3/types/v1beta1 github.com/cs3org/go-cs3apis/cs3/types/v1beta1
# github.com/cs3org/reva/v2 v2.16.1-0.20231012102459-2b27cd47ab72 # github.com/cs3org/reva/v2 v2.16.1-0.20231018140500-4565fd54f281
## explicit; go 1.20 ## explicit; go 1.20
github.com/cs3org/reva/v2/cmd/revad/internal/grace github.com/cs3org/reva/v2/cmd/revad/internal/grace
github.com/cs3org/reva/v2/cmd/revad/runtime github.com/cs3org/reva/v2/cmd/revad/runtime