From 8f8824571cfe9e4b36a9cbaa9601aa9224fdabd6 Mon Sep 17 00:00:00 2001 From: jkoberg Date: Fri, 23 Dec 2022 10:43:37 +0100 Subject: [PATCH 1/3] bump reva Signed-off-by: jkoberg --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 937e6792f..fe8e2fae4 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/blevesearch/bleve/v2 v2.3.5 github.com/coreos/go-oidc/v3 v3.4.0 github.com/cs3org/go-cs3apis v0.0.0-20221012090518-ef2996678965 - github.com/cs3org/reva/v2 v2.12.1-0.20221219152307-4d5800e63bf4 + github.com/cs3org/reva/v2 v2.12.1-0.20221223093348-3ae37de4759d github.com/disintegration/imaging v1.6.2 github.com/ggwhite/go-masker v1.0.9 github.com/go-chi/chi/v5 v5.0.7 diff --git a/go.sum b/go.sum index 2f087d623..211fe2196 100644 --- a/go.sum +++ b/go.sum @@ -345,6 +345,8 @@ github.com/cs3org/go-cs3apis v0.0.0-20221012090518-ef2996678965 h1:y4n2j68LLnvac github.com/cs3org/go-cs3apis v0.0.0-20221012090518-ef2996678965/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY= github.com/cs3org/reva/v2 v2.12.1-0.20221219152307-4d5800e63bf4 h1:FxPCpd3oE5snNw5filxKGd3M27ySbjqeiiMTBJI8tSw= github.com/cs3org/reva/v2 v2.12.1-0.20221219152307-4d5800e63bf4/go.mod h1:GpocVB1w6yxeSr1VBsO9jztmt1SyNC4lCwudLwDzxHQ= +github.com/cs3org/reva/v2 v2.12.1-0.20221223093348-3ae37de4759d h1:8CzNOyGaqIDv3rlYGYxv8TIYVHPBLkPmyTprlOh1Om4= +github.com/cs3org/reva/v2 v2.12.1-0.20221223093348-3ae37de4759d/go.mod h1:GpocVB1w6yxeSr1VBsO9jztmt1SyNC4lCwudLwDzxHQ= 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= From 6b374694d60254a55d849277701b4ae949acac47 Mon Sep 17 00:00:00 2001 From: jkoberg Date: Fri, 23 Dec 2022 10:44:25 +0100 Subject: [PATCH 2/3] changelog Signed-off-by: jkoberg --- changelog/unreleased/bump-reva.md | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog/unreleased/bump-reva.md b/changelog/unreleased/bump-reva.md index ac5e8e224..5a6a53310 100644 --- a/changelog/unreleased/bump-reva.md +++ b/changelog/unreleased/bump-reva.md @@ -3,3 +3,4 @@ Enhancement: Bump reva version use latest reva version https://github.com/owncloud/ocis/pull/5243 +https://github.com/owncloud/ocis/pull/5285 From 837eff9017dcb5660679bd0f3a845a7c15cc7b5e Mon Sep 17 00:00:00 2001 From: jkoberg Date: Fri, 23 Dec 2022 10:43:23 +0100 Subject: [PATCH 3/3] adjust for tags pkg Signed-off-by: jkoberg tmp Signed-off-by: jkoberg --- services/graph/pkg/service/v0/tags.go | 18 ++++++++---------- services/search/pkg/content/basic.go | 2 +- services/webdav/pkg/service/v0/search.go | 5 +---- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/services/graph/pkg/service/v0/tags.go b/services/graph/pkg/service/v0/tags.go index 40de0be16..57bedfa56 100644 --- a/services/graph/pkg/service/v0/tags.go +++ b/services/graph/pkg/service/v0/tags.go @@ -33,10 +33,10 @@ func (g Graph) GetTags(w http.ResponseWriter, r *http.Request) { return } - tagList := tags.FromList("") + tagList := tags.New("") for _, match := range sr.Matches { for _, tag := range match.Entity.Tags { - tagList.AddList(tag) + tagList.Add(tag) } } @@ -100,9 +100,8 @@ func (g Graph) AssignTags(w http.ResponseWriter, r *http.Request) { currentTags = m["tags"] } - allTags := tags.FromList(currentTags) - newTags := strings.Join(assignment.Tags, ",") - if !allTags.AddList(newTags) { + allTags := tags.New(currentTags) + if !allTags.Add(assignment.Tags...) { errorcode.InvalidRequest.Render(w, r, http.StatusBadRequest, "no new tags in createtagsrequest or maximum reached") return } @@ -123,7 +122,7 @@ func (g Graph) AssignTags(w http.ResponseWriter, r *http.Request) { if g.eventsPublisher != nil { ev := events.TagsAdded{ - Tags: newTags, + Tags: strings.Join(assignment.Tags, ","), Ref: &provider.Reference{ ResourceId: &rid, Path: ".", @@ -190,9 +189,8 @@ func (g Graph) UnassignTags(w http.ResponseWriter, r *http.Request) { currentTags = m["tags"] } - allTags := tags.FromList(currentTags) - toDelete := strings.Join(unassignment.Tags, ",") - if !allTags.RemoveList(toDelete) { + allTags := tags.New(currentTags) + if !allTags.Remove(unassignment.Tags...) { errorcode.InvalidRequest.Render(w, r, http.StatusBadRequest, "no new tags in createtagsrequest or maximum reached") return } @@ -213,7 +211,7 @@ func (g Graph) UnassignTags(w http.ResponseWriter, r *http.Request) { if g.eventsPublisher != nil { ev := events.TagsRemoved{ - Tags: toDelete, + Tags: strings.Join(unassignment.Tags, ","), Ref: &provider.Reference{ ResourceId: &rid, Path: ".", diff --git a/services/search/pkg/content/basic.go b/services/search/pkg/content/basic.go index 6c8382dff..ba95ad38e 100644 --- a/services/search/pkg/content/basic.go +++ b/services/search/pkg/content/basic.go @@ -29,7 +29,7 @@ func (b Basic) Extract(_ context.Context, ri *storageProvider.ResourceInfo) (Doc if m := ri.ArbitraryMetadata.GetMetadata(); m != nil { if t, ok := m["tags"]; ok { - doc.Tags = tags.FromList(t).AsSlice() + doc.Tags = tags.New(t).AsSlice() } } diff --git a/services/webdav/pkg/service/v0/search.go b/services/webdav/pkg/service/v0/search.go index 7ad4258d6..72c08f7fc 100644 --- a/services/webdav/pkg/service/v0/search.go +++ b/services/webdav/pkg/service/v0/search.go @@ -190,10 +190,7 @@ func matchToPropResponse(ctx context.Context, match *searchmsg.Match) (*propfind propstatOK.Prop = append(propstatOK.Prop, prop.Escaped("d:getcontenttype", match.Entity.MimeType)) propstatOK.Prop = append(propstatOK.Prop, prop.Escaped("oc:permissions", match.Entity.Permissions)) - t := tags.FromList("") - for _, tag := range match.Entity.Tags { - t.AddList(tag) - } + t := tags.New(match.Entity.Tags...) propstatOK.Prop = append(propstatOK.Prop, prop.Escaped("oc:tags", t.AsList())) // those seem empty - bug?