Skip to content
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 archiver and app provider capabilities #2088

Merged
merged 1 commit into from
Sep 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions changelog/unreleased/archiver-approvider-capabilities.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Enhancement: Add archiver and app provider to ocs capabilities

The archiver and app provider has been added to the ocs capabilities.

https://github.com/cs3org/reva/pull/2088
https://github.com/owncloud/ocis/pull/2529
18 changes: 18 additions & 0 deletions internal/http/services/owncloud/ocs/data/capabilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,22 @@ type CapabilitiesFilesTusSupport struct {
HTTPMethodOverride string `json:"http_method_override" xml:"http_method_override" mapstructure:"http_method_override"`
}

// CapabilitiesArchiver holds available archivers information
type CapabilitiesArchiver struct {
Enabled bool `json:"enabled" xml:"enabled" mapstructure:"enabled"`
Version string `json:"version" xml:"version" mapstructure:"version"`
Formats []string `json:"formats" xml:"formats" mapstructure:"formats"`
ArchiverURL string `json:"archiver_url" xml:"archiver_url" mapstructure:"archiver_url"`
}

// CapabilitiesAppProvider holds available app provider information
type CapabilitiesAppProvider struct {
Enabled bool `json:"enabled" xml:"enabled" mapstructure:"enabled"`
Version string `json:"version" xml:"version" mapstructure:"version"`
AppsURL string `json:"apps_url" xml:"apps_url" mapstructure:"apps_url"`
OpenURL string `json:"open_url" xml:"open_url" mapstructure:"open_url"`
}

// CapabilitiesFiles TODO this is storage specific, not global. What effect do these options have on the clients?
type CapabilitiesFiles struct {
PrivateLinks ocsBool `json:"privateLinks" xml:"privateLinks" mapstructure:"private_links"`
Expand All @@ -110,6 +126,8 @@ type CapabilitiesFiles struct {
Favorites ocsBool `json:"favorites" xml:"favorites"`
BlacklistedFiles []string `json:"blacklisted_files" xml:"blacklisted_files>element" mapstructure:"blacklisted_files"`
TusSupport *CapabilitiesFilesTusSupport `json:"tus_support" xml:"tus_support" mapstructure:"tus_support"`
Archivers []*CapabilitiesArchiver `json:"archivers" xml:"archivers" mapstructure:"archivers"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there are multiple archiver or app provider versions available from the backend, how do I know which one is the most recent one? By parsing the versions? Or do you think it makes sense to introduce some MostRecent boolean in the respective capability struct?

AppProviders []*CapabilitiesAppProvider `json:"app_providers" xml:"app_providers" mapstructure:"app_providers"`
}

// CapabilitiesDav holds dav endpoint config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,14 @@ func (h *Handler) Init(c *config.Config) {
// h.c.Capabilities.Files.Versioning is boolean
// h.c.Capabilities.Files.Favorites is boolean

if h.c.Capabilities.Files.Archivers == nil {
h.c.Capabilities.Files.Archivers = []*data.CapabilitiesArchiver{}
}

if h.c.Capabilities.Files.AppProviders == nil {
h.c.Capabilities.Files.AppProviders = []*data.CapabilitiesAppProvider{}
}

// dav

if h.c.Capabilities.Dav == nil {
Expand Down