-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Spaces to Capabilities #2015
Conversation
Although this boolean flag is enough to fulfill the ticket, wouldn't it be nice to have some more information in the capabilities like which spaces API version the instance supports or something like that? I'm thinking about the long term here. |
I think spaces should not have its own version, otherwise we would need to version WebDAV and OCS. The structure already contains a version of owncloud (or, oCIS): // Version holds version information
type Version struct {
Major int `json:"major" xml:"major"`
Minor int `json:"minor" xml:"minor"`
Micro int `json:"micro" xml:"micro"` // = patch level
String string `json:"string" xml:"string"`
Edition string `json:"edition" xml:"edition"`
} And IMO clients should act on this version. While it makes sense to look to the future regarding APIs, the fact that ownCloud implement several APIs, we either version the product or version each API individually; the latter offers more granularity but it is more cumbersome. If I think a bit further to the release cycle to the This was my reasoning on only adding a boolean under the |
changelog: add unreleased folder and .keep file add changelog
9926c23
to
bf0f8e0
Compare
@labkode this should be ready for review + merge |
internal/http/services/owncloud/ocs/handlers/cloud/capabilities/capabilities.go
Outdated
Show resolved
Hide resolved
@labkode 👍 removed the hardcoded condition, instead let the default config parsing handle it. From the config standpoint if looks something like this: diff --git a/go.mod b/go.mod
index e7e6f4112..2f44e599c 100644
--- a/go.mod
+++ b/go.mod
@@ -76,6 +76,7 @@ require (
replace (
github.com/crewjam/saml => github.com/crewjam/saml v0.4.5
+ github.com/cs3org/reva => ../../refs/reva
go.etcd.io/etcd/api/v3 => go.etcd.io/etcd/api/v3 v3.0.0-20210204162551-dae29bb719dd
go.etcd.io/etcd/pkg/v3 => go.etcd.io/etcd/pkg/v3 v3.0.0-20210204162551-dae29bb719dd
)
diff --git a/storage/pkg/command/frontend.go b/storage/pkg/command/frontend.go
index ef686698b..9d623c625 100644
--- a/storage/pkg/command/frontend.go
+++ b/storage/pkg/command/frontend.go
@@ -208,7 +208,9 @@ func frontendConfigFromStruct(c *cli.Context, cfg *config.Config, filesCfg map[s
"preferred_upload_type": cfg.Reva.ChecksumPreferredUploadType,
},
"files": filesCfg,
- "dav": map[string]interface{}{},
+ "dav": map[string]interface{}{
+ "spaces": true,
+ },
"files_sharing": map[string]interface{}{
"api_enabled": true,
"resharing": true,
Tested the logic with this diff on oCIS and works as intended 👍 |
IMO spaces are not only a WebDAV thing. If you ask me, we should introduce a new top-level entry for spaces. |
@micbar brought the idea of introducing a new key for 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"`
Notifications *CapabilitiesNotifications `json:"notifications,omitempty" xml:"notifications,omitempty"`
Spaces *CapabilitiesSpaces `json:"spaces,omitempty" xml:"spaces,omitempty"`
} type CapabilitiesSpaces struct {
Enabled bool `json:"enabled" xml:"enabled"`
} |
@micbar ok, adding its own key is the way we're moving forward. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😄
@labkode could you merge this one? |
In order for clients to be aware of the new spaces feature we need to enable the
spaces
flag on the capabilities' endpoint. As we currently do, the capabilities endpoints remains a hardcoded set of capabilities, and it will default to true.