From c9a95b11c7a531ae2de34250e4a37b721ba1074c Mon Sep 17 00:00:00 2001 From: Alex Unger <6905948+refs@users.noreply.github.com> Date: Mon, 13 Sep 2021 08:24:13 +0200 Subject: [PATCH] Add Spaces to Capabilities (#2015) --- changelog/unreleased/.keep | 0 changelog/unreleased/spaces-capabilities.md | 5 +++++ .../services/owncloud/ocs/data/capabilities.go | 18 +++++++++++++----- 3 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 changelog/unreleased/.keep create mode 100644 changelog/unreleased/spaces-capabilities.md diff --git a/changelog/unreleased/.keep b/changelog/unreleased/.keep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/changelog/unreleased/spaces-capabilities.md b/changelog/unreleased/spaces-capabilities.md new file mode 100644 index 00000000000..0b1ff89b36b --- /dev/null +++ b/changelog/unreleased/spaces-capabilities.md @@ -0,0 +1,5 @@ +Enhancement: Add spaces to the list of capabilities + +In order for clients to be aware of the new spaces feature we need to enable the `spaces` flag on the capabilities' endpoint. + +https://github.com/cs3org/reva/pull/2015 diff --git a/internal/http/services/owncloud/ocs/data/capabilities.go b/internal/http/services/owncloud/ocs/data/capabilities.go index a50e2983a9f..e86772e4f9f 100644 --- a/internal/http/services/owncloud/ocs/data/capabilities.go +++ b/internal/http/services/owncloud/ocs/data/capabilities.go @@ -50,14 +50,22 @@ type CapabilitiesData struct { // Capabilities groups several capability aspects type Capabilities struct { - Core *CapabilitiesCore `json:"core" xml:"core"` - Checksums *CapabilitiesChecksums `json:"checksums" xml:"checksums"` - Files *CapabilitiesFiles `json:"files" xml:"files" mapstructure:"files"` - Dav *CapabilitiesDav `json:"dav" xml:"dav"` - FilesSharing *CapabilitiesFilesSharing `json:"files_sharing" xml:"files_sharing" mapstructure:"files_sharing"` + Core *CapabilitiesCore `json:"core" xml:"core"` + Checksums *CapabilitiesChecksums `json:"checksums" xml:"checksums"` + Files *CapabilitiesFiles `json:"files" xml:"files" mapstructure:"files"` + Dav *CapabilitiesDav `json:"dav" xml:"dav"` + FilesSharing *CapabilitiesFilesSharing `json:"files_sharing" xml:"files_sharing" mapstructure:"files_sharing"` + Spaces *Spaces `json:"spaces,omitempty" xml:"spaces,omitempty" mapstructure:"spaces"` + Notifications *CapabilitiesNotifications `json:"notifications,omitempty" xml:"notifications,omitempty"` } +// Spaces lets a service configure its advertised options related to Storage Spaces. +type Spaces struct { + Version string `json:"version" xml:"version" mapstructure:"version"` + Enabled bool `json:"enabled" xml:"enabled" mapstructure:"enabled"` +} + // CapabilitiesCore holds webdav config type CapabilitiesCore struct { PollInterval int `json:"pollinterval" xml:"pollinterval" mapstructure:"poll_interval"`