From 66f4198e12850467ba26e9873bd89c0177369f87 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Fri, 4 Mar 2022 14:23:37 +0100 Subject: [PATCH] include spaces etags in drives listing --- changelog/unreleased/spaces-etags.md | 5 +++++ go.mod | 2 +- go.sum | 4 ++-- graph/pkg/service/v0/drives.go | 9 +++++---- 4 files changed, 13 insertions(+), 7 deletions(-) create mode 100644 changelog/unreleased/spaces-etags.md diff --git a/changelog/unreleased/spaces-etags.md b/changelog/unreleased/spaces-etags.md new file mode 100644 index 00000000000..42765c2f3b6 --- /dev/null +++ b/changelog/unreleased/spaces-etags.md @@ -0,0 +1,5 @@ +Enhancement: Include etags in drives listing + +Added etags in the response of list drives. + +https://github.com/owncloud/ocis/pull/3267 diff --git a/go.mod b/go.mod index 39be739d397..448427b6854 100644 --- a/go.mod +++ b/go.mod @@ -22,7 +22,7 @@ require ( github.com/blevesearch/bleve/v2 v2.3.1 github.com/coreos/go-oidc/v3 v3.1.0 github.com/cs3org/go-cs3apis v0.0.0-20220126114148-64c025ccdd19 - github.com/cs3org/reva/v2 v2.0.0 + github.com/cs3org/reva/v2 v2.0.0-20220304131900-b8be80d1ba81 github.com/disintegration/imaging v1.6.2 github.com/glauth/glauth/v2 v2.0.0-20211021011345-ef3151c28733 github.com/go-chi/chi/v5 v5.0.7 diff --git a/go.sum b/go.sum index 567ff7dee57..bd91fd53286 100644 --- a/go.sum +++ b/go.sum @@ -342,8 +342,8 @@ github.com/crewjam/saml v0.4.5/go.mod h1:qCJQpUtZte9R1ZjUBcW8qtCNlinbO363ooNl02S github.com/cs3org/cato v0.0.0-20200828125504-e418fc54dd5e/go.mod h1:XJEZ3/EQuI3BXTp/6DUzFr850vlxq11I6satRtz0YQ4= github.com/cs3org/go-cs3apis v0.0.0-20220126114148-64c025ccdd19 h1:1jqPH58jCxvbaJ9WLIJ7W2/m622bWS6ChptzljSG6IQ= github.com/cs3org/go-cs3apis v0.0.0-20220126114148-64c025ccdd19/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY= -github.com/cs3org/reva/v2 v2.0.0 h1:/w5jn77qm4p8Eizbiat3WDWZmY9mAM/le/lZ+Woa13Q= -github.com/cs3org/reva/v2 v2.0.0/go.mod h1:XNtK1HEClNzmz5vyQa2DUw4KH3oqBjQoEsV1LhAGlV0= +github.com/cs3org/reva/v2 v2.0.0-20220304131900-b8be80d1ba81 h1:g6c1HYGTSpDnf6uNPXYIOySVk0P545zWUPmdPWEcMps= +github.com/cs3org/reva/v2 v2.0.0-20220304131900-b8be80d1ba81/go.mod h1:XNtK1HEClNzmz5vyQa2DUw4KH3oqBjQoEsV1LhAGlV0= 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= diff --git a/graph/pkg/service/v0/drives.go b/graph/pkg/service/v0/drives.go index 6c5a2b077e3..e3e16186164 100644 --- a/graph/pkg/service/v0/drives.go +++ b/graph/pkg/service/v0/drives.go @@ -507,15 +507,16 @@ func (g Graph) cs3StorageSpaceToDrive(baseURL *url.URL, space *storageprovider.S if description, ok := space.Opaque.Map["description"]; ok { drive.Description = libregraph.PtrString(string(description.Value)) } - } - if space.Opaque != nil && space.Opaque.Map != nil { - v, ok := space.Opaque.Map["trashed"] - if ok { + if v, ok := space.Opaque.Map["trashed"]; ok { deleted := &libregraph.Deleted{} deleted.SetState(string(v.Value)) drive.Root.Deleted = deleted } + + if entry, ok := space.Opaque.Map["etag"]; ok { + drive.Root.ETag = libregraph.PtrString(string(entry.Value)) + } } if baseURL != nil {