@@ -0,0 +1,5 @@
|
||||
Enhancement: Bump reva
|
||||
|
||||
bumps reva version
|
||||
|
||||
https://github.com/owncloud/ocis/pull/6899
|
||||
@@ -13,7 +13,7 @@ require (
|
||||
github.com/coreos/go-oidc v2.2.1+incompatible
|
||||
github.com/coreos/go-oidc/v3 v3.6.0
|
||||
github.com/cs3org/go-cs3apis v0.0.0-20230516150832-730ac860c71d
|
||||
github.com/cs3org/reva/v2 v2.15.1-0.20230725125905-676d4e05f1b7
|
||||
github.com/cs3org/reva/v2 v2.15.1-0.20230726135727-c444e4c5a24f
|
||||
github.com/disintegration/imaging v1.6.2
|
||||
github.com/dutchcoders/go-clamd v0.0.0-20170520113014-b970184f4d9e
|
||||
github.com/egirna/icap-client v0.1.1
|
||||
|
||||
@@ -625,8 +625,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/saml v0.4.13 h1:TYHggH/hwP7eArqiXSJUvtOPNzQDyQ7vwmwEqlFWhMc=
|
||||
github.com/crewjam/saml v0.4.13/go.mod h1:igEejV+fihTIlHXYP8zOec3V5A8y3lws5bQBFsTm4gA=
|
||||
github.com/cs3org/reva/v2 v2.15.1-0.20230725125905-676d4e05f1b7 h1:+G17hDLzyv3tVht0UdrvWwsxiFE8MaJ09QaQvxhXRdE=
|
||||
github.com/cs3org/reva/v2 v2.15.1-0.20230725125905-676d4e05f1b7/go.mod h1:4z5EQghS2LhSWZWocH51Dw9VAs16No1zSFvFgQtgS7w=
|
||||
github.com/cs3org/reva/v2 v2.15.1-0.20230726135727-c444e4c5a24f h1:u1otcEA1Otgv7rxS4y/nHU/7zkc1kU/KdCX1YNGSzsE=
|
||||
github.com/cs3org/reva/v2 v2.15.1-0.20230726135727-c444e4c5a24f/go.mod h1:4z5EQghS2LhSWZWocH51Dw9VAs16No1zSFvFgQtgS7w=
|
||||
github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8 h1:Z9lwXumT5ACSmJ7WGnFl+OMLLjpz5uR2fyz7dC255FI=
|
||||
github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8/go.mod h1:4abs/jPXcmJzYoYGF91JF9Uq9s/KL5n1jvFDix8KcqY=
|
||||
github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4=
|
||||
|
||||
Generated
Vendored
+8
-2
@@ -22,16 +22,22 @@ import (
|
||||
"context"
|
||||
|
||||
userv1beta1 "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1"
|
||||
provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
|
||||
ctxpkg "github.com/cs3org/reva/v2/pkg/ctx"
|
||||
)
|
||||
|
||||
// IsCurrentUserOwner returns whether the context user is the given owner or not
|
||||
func IsCurrentUserOwner(ctx context.Context, owner *userv1beta1.UserId) bool {
|
||||
// IsCurrentUserOwnerOrManager returns whether the context user is the given owner or not
|
||||
func IsCurrentUserOwnerOrManager(ctx context.Context, owner *userv1beta1.UserId, md *provider.ResourceInfo) bool {
|
||||
contextUser, ok := ctxpkg.ContextGetUser(ctx)
|
||||
// personal spaces have owners
|
||||
if ok && contextUser.Id != nil && owner != nil &&
|
||||
contextUser.Id.Idp == owner.Idp &&
|
||||
contextUser.Id.OpaqueId == owner.OpaqueId {
|
||||
return true
|
||||
}
|
||||
// check if the user is space manager
|
||||
if md != nil && md.Owner != nil && md.Owner.GetType() == userv1beta1.UserType_USER_TYPE_SPACE_OWNER {
|
||||
return md.GetPermissionSet().AddGrant
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
Generated
Vendored
+4
-4
@@ -1031,7 +1031,7 @@ func mdToPropResponse(ctx context.Context, pf *XML, md *provider.ResourceInfo, p
|
||||
}
|
||||
var wdp string
|
||||
isPublic := ls != nil
|
||||
isShared := shareTypes != "" && !net.IsCurrentUserOwner(ctx, md.Owner)
|
||||
isShared := shareTypes != "" && !net.IsCurrentUserOwnerOrManager(ctx, md.Owner, md)
|
||||
if md.PermissionSet != nil {
|
||||
wdp = role.WebDAVPermissions(
|
||||
md.Type == provider.ResourceType_RESOURCE_TYPE_CONTAINER,
|
||||
@@ -1253,7 +1253,7 @@ func mdToPropResponse(ctx context.Context, pf *XML, md *provider.ResourceInfo, p
|
||||
}
|
||||
case "public-link-share-owner":
|
||||
if ls != nil && ls.Owner != nil {
|
||||
if net.IsCurrentUserOwner(ctx, ls.Owner) {
|
||||
if net.IsCurrentUserOwnerOrManager(ctx, ls.Owner, nil) {
|
||||
u := ctxpkg.ContextMustGetUser(ctx)
|
||||
appendToOK(prop.Escaped("oc:public-link-share-owner", u.Username))
|
||||
} else {
|
||||
@@ -1285,7 +1285,7 @@ func mdToPropResponse(ctx context.Context, pf *XML, md *provider.ResourceInfo, p
|
||||
}
|
||||
case "owner-id": // phoenix only
|
||||
if md.Owner != nil {
|
||||
if net.IsCurrentUserOwner(ctx, md.Owner) {
|
||||
if net.IsCurrentUserOwnerOrManager(ctx, md.Owner, md) {
|
||||
u := ctxpkg.ContextMustGetUser(ctx)
|
||||
appendToOK(prop.Escaped("oc:owner-id", u.Username))
|
||||
} else {
|
||||
@@ -1375,7 +1375,7 @@ func mdToPropResponse(ctx context.Context, pf *XML, md *provider.ResourceInfo, p
|
||||
}
|
||||
case "owner-display-name": // phoenix only
|
||||
if md.Owner != nil {
|
||||
if net.IsCurrentUserOwner(ctx, md.Owner) {
|
||||
if net.IsCurrentUserOwnerOrManager(ctx, md.Owner, md) {
|
||||
u := ctxpkg.ContextMustGetUser(ctx)
|
||||
appendToOK(prop.Escaped("oc:owner-display-name", u.DisplayName))
|
||||
} else {
|
||||
|
||||
+1
-1
@@ -338,7 +338,7 @@ func (s *svc) handleTusPost(ctx context.Context, w http.ResponseWriter, r *http.
|
||||
isPublic = ls != nil
|
||||
}
|
||||
}
|
||||
isShared := !net.IsCurrentUserOwner(ctx, info.Owner)
|
||||
isShared := !net.IsCurrentUserOwnerOrManager(ctx, info.Owner, info)
|
||||
role := conversions.RoleFromResourcePermissions(info.PermissionSet, isPublic)
|
||||
permissions := role.WebDAVPermissions(
|
||||
info.Type == provider.ResourceType_RESOURCE_TYPE_CONTAINER,
|
||||
|
||||
+17
-5
@@ -276,11 +276,23 @@ func (fs *Decomposedfs) Postprocessing(ch <-chan events.Event) {
|
||||
failed = true
|
||||
}
|
||||
|
||||
getParent := func() *node.Node {
|
||||
p, err := up.Node.Parent(ctx)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Str("uploadID", ev.UploadID).Msg("could not read parent")
|
||||
return nil
|
||||
}
|
||||
return p
|
||||
}
|
||||
|
||||
now := time.Now()
|
||||
if p, err := node.ReadNode(ctx, fs.lu, up.Info.Storage["SpaceRoot"], n.ParentID, false, nil, true); err != nil {
|
||||
log.Error().Err(err).Str("uploadID", ev.UploadID).Msg("could not read parent")
|
||||
} else {
|
||||
// update parent tmtime to propagate etag change
|
||||
if failed {
|
||||
// propagate sizeDiff after failed postprocessing
|
||||
if err := fs.tp.Propagate(ctx, up.Node, -up.SizeDiff); err != nil {
|
||||
log.Error().Err(err).Str("uploadID", ev.UploadID).Msg("could not propagate tree size change")
|
||||
}
|
||||
} else if p := getParent(); p != nil {
|
||||
// update parent tmtime to propagate etag change after successful postprocessing
|
||||
_ = p.SetTMTime(ctx, &now)
|
||||
if err := fs.tp.Propagate(ctx, p, 0); err != nil {
|
||||
log.Error().Err(err).Str("uploadID", ev.UploadID).Msg("could not propagate etag change")
|
||||
@@ -900,7 +912,7 @@ func (fs *Decomposedfs) ListFolder(ctx context.Context, ref *provider.Reference,
|
||||
for child := range work {
|
||||
np := rp
|
||||
// add this childs permissions
|
||||
pset, _ := n.PermissionSet(ctx)
|
||||
pset, _ := child.PermissionSet(ctx)
|
||||
node.AddPermissions(&np, &pset)
|
||||
ri, err := child.AsResourceInfo(ctx, &np, mdKeys, fieldMask, utils.IsRelativeReference(ref))
|
||||
if err != nil {
|
||||
|
||||
Generated
Vendored
+5
-5
@@ -234,7 +234,7 @@ func Get(ctx context.Context, id string, lu *lookup.Lookup, tp Tree, fsRoot stri
|
||||
|
||||
up := buildUpload(ctx, info, info.Storage["BinPath"], infoPath, lu, tp, pub, async, tknopts)
|
||||
up.versionsPath = info.MetaData["versionsPath"]
|
||||
up.sizeDiff, _ = strconv.ParseInt(info.MetaData["sizeDiff"], 10, 64)
|
||||
up.SizeDiff, _ = strconv.ParseInt(info.MetaData["sizeDiff"], 10, 64)
|
||||
return up, nil
|
||||
}
|
||||
|
||||
@@ -364,8 +364,8 @@ func initNewNode(upload *Upload, n *node.Node, fsize uint64) (*lockedfile.File,
|
||||
}
|
||||
|
||||
// on a new file the sizeDiff is the fileSize
|
||||
upload.sizeDiff = int64(fsize)
|
||||
upload.Info.MetaData["sizeDiff"] = strconv.Itoa(int(upload.sizeDiff))
|
||||
upload.SizeDiff = int64(fsize)
|
||||
upload.Info.MetaData["sizeDiff"] = strconv.Itoa(int(upload.SizeDiff))
|
||||
return f, nil
|
||||
}
|
||||
|
||||
@@ -393,9 +393,9 @@ func updateExistingNode(upload *Upload, n *node.Node, spaceID string, fsize uint
|
||||
}
|
||||
|
||||
upload.versionsPath = upload.lu.InternalPath(spaceID, n.ID+node.RevisionIDDelimiter+tmtime.UTC().Format(time.RFC3339Nano))
|
||||
upload.sizeDiff = int64(fsize) - old.Blobsize
|
||||
upload.SizeDiff = int64(fsize) - old.Blobsize
|
||||
upload.Info.MetaData["versionsPath"] = upload.versionsPath
|
||||
upload.Info.MetaData["sizeDiff"] = strconv.Itoa(int(upload.sizeDiff))
|
||||
upload.Info.MetaData["sizeDiff"] = strconv.Itoa(int(upload.SizeDiff))
|
||||
|
||||
targetPath := n.InternalPath()
|
||||
|
||||
|
||||
+3
-3
@@ -91,6 +91,8 @@ type Upload struct {
|
||||
Info tusd.FileInfo
|
||||
// node for easy access
|
||||
Node *node.Node
|
||||
// SizeDiff size difference between new and old file version
|
||||
SizeDiff int64
|
||||
// infoPath is the path to the .info file
|
||||
infoPath string
|
||||
// binPath is the path to the binary file (which has no extension)
|
||||
@@ -100,8 +102,6 @@ type Upload struct {
|
||||
tp Tree
|
||||
// versionsPath will be empty if there was no file before
|
||||
versionsPath string
|
||||
// sizeDiff size difference between new and old file version
|
||||
sizeDiff int64
|
||||
// and a logger as well
|
||||
log zerolog.Logger
|
||||
// publisher used to publish events
|
||||
@@ -296,7 +296,7 @@ func (upload *Upload) FinishUpload(_ context.Context) error {
|
||||
}
|
||||
}
|
||||
|
||||
return upload.tp.Propagate(upload.Ctx, n, upload.sizeDiff)
|
||||
return upload.tp.Propagate(upload.Ctx, n, upload.SizeDiff)
|
||||
}
|
||||
|
||||
// Terminate terminates the upload
|
||||
|
||||
Vendored
+1
-1
@@ -352,7 +352,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/tx/v1beta1
|
||||
github.com/cs3org/go-cs3apis/cs3/types/v1beta1
|
||||
# github.com/cs3org/reva/v2 v2.15.1-0.20230725125905-676d4e05f1b7
|
||||
# github.com/cs3org/reva/v2 v2.15.1-0.20230726135727-c444e4c5a24f
|
||||
## explicit; go 1.20
|
||||
github.com/cs3org/reva/v2/cmd/revad/internal/grace
|
||||
github.com/cs3org/reva/v2/cmd/revad/runtime
|
||||
|
||||
Reference in New Issue
Block a user