From d35bb61faccf356f783e60a84e9db570177c7cbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Fri, 31 May 2024 16:03:19 +0200 Subject: [PATCH] set secureview flag based on addr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- changelog/unreleased/add-providerinfo-secure-view-flag.md | 3 ++- services/frontend/pkg/config/config.go | 6 +++--- services/frontend/pkg/config/defaults/defaultconfig.go | 4 ++-- services/frontend/pkg/revaconfig/config.go | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/changelog/unreleased/add-providerinfo-secure-view-flag.md b/changelog/unreleased/add-providerinfo-secure-view-flag.md index 1e2e4f277c4..bcf0e1242ae 100644 --- a/changelog/unreleased/add-providerinfo-secure-view-flag.md +++ b/changelog/unreleased/add-providerinfo-secure-view-flag.md @@ -1,6 +1,7 @@ Enhancement: add secureview flag when listing apps via http -To allow clients to see which application supports secure view we add a flag to the http response when the app name matches a configured secure view app. The app can be configured by setting `FRONTEND_APP_HANDLER_SECURE_VIEW_APP` to the name of the app registered as a CS3 app provider. +To allow clients to see which application supports secure view, we add a flag to the http response when the app service name matches a configured secure view app provider. The app can be configured by setting `FRONTEND_APP_HANDLER_SECURE_VIEW_APP_ADDR` to the address of the registered CS3 app provider. +https://github.com/owncloud/ocis/pull/9289 https://github.com/owncloud/ocis/pull/9280 https://github.com/owncloud/ocis/pull/9277 diff --git a/services/frontend/pkg/config/config.go b/services/frontend/pkg/config/config.go index a3e1670e7ac..012c58bdb69 100644 --- a/services/frontend/pkg/config/config.go +++ b/services/frontend/pkg/config/config.go @@ -107,9 +107,9 @@ type Auth struct { } type AppHandler struct { - Prefix string `yaml:"-"` - Insecure bool `yaml:"insecure" env:"OCIS_INSECURE;FRONTEND_APP_HANDLER_INSECURE" desc:"Allow insecure connections to the frontend." introductionVersion:"pre5.0"` - SecureViewApp string `yaml:"secure_view_app" env:"FRONTEND_APP_HANDLER_SECURE_VIEW_APP" desc:"Name of the app to use for secure view. Should match COLLABORATION_APP_NAME, the name configured for the CS3 app provider." introductionVersion:"5.1"` + Prefix string `yaml:"-"` + Insecure bool `yaml:"insecure" env:"OCIS_INSECURE;FRONTEND_APP_HANDLER_INSECURE" desc:"Allow insecure connections to the frontend." introductionVersion:"pre5.0"` + SecureViewAppAddr string `yaml:"secure_view_app_addr" env:"FRONTEND_APP_HANDLER_SECURE_VIEW_APP_ADDR" desc:"Adress or service name of the app provider to use for secure view. Should match the URL or service name of the registered CS3 app provider." introductionVersion:"5.1"` } type Archiver struct { diff --git a/services/frontend/pkg/config/defaults/defaultconfig.go b/services/frontend/pkg/config/defaults/defaultconfig.go index 848ccc0c2f9..a448f8acda3 100644 --- a/services/frontend/pkg/config/defaults/defaultconfig.go +++ b/services/frontend/pkg/config/defaults/defaultconfig.go @@ -93,8 +93,8 @@ func DefaultConfig() *config.Config { PreferredUploadType: "sha1", }, AppHandler: config.AppHandler{ - Prefix: "app", - SecureViewApp: "Collabora", + Prefix: "app", + SecureViewAppAddr: "com.owncloud.api.collaboration", }, Archiver: config.Archiver{ Insecure: false, diff --git a/services/frontend/pkg/revaconfig/config.go b/services/frontend/pkg/revaconfig/config.go index d3ebbbbf57f..0df042ecd86 100644 --- a/services/frontend/pkg/revaconfig/config.go +++ b/services/frontend/pkg/revaconfig/config.go @@ -137,7 +137,7 @@ func FrontendConfigFromStruct(cfg *config.Config, logger log.Logger) (map[string "contextRouteName": "files-spaces-personal", // TODO: remove when https://github.com/owncloud/web/pull/7437 arrived in oCIS }, }, - "secure_view_app": cfg.AppHandler.SecureViewApp, + "secure_view_app_addr": cfg.AppHandler.SecureViewAppAddr, }, "archiver": map[string]interface{}{ "prefix": cfg.Archiver.Prefix,