Skip to content

Commit

Permalink
set secureview flag based on addr
Browse files Browse the repository at this point in the history
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
  • Loading branch information
butonic committed May 31, 2024
1 parent e291088 commit c65fb8d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
3 changes: 2 additions & 1 deletion changelog/unreleased/add-providerinfo-secure-view-flag.md
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions deployments/examples/ocis_wopi/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ services:
PROXY_CSP_CONFIG_FILE_LOCATION: /etc/ocis/csp.yaml
COLLABORA_DOMAIN: ${COLLABORA_DOMAIN:-collabora.owncloud.test}
ONLYOFFICE_DOMAIN: ${ONLYOFFICE_DOMAIN:-onlyoffice.owncloud.test}
# make collabora the secure view app
FRONTEND_APP_HANDLER_SECURE_VIEW_APP_ADDR: com.owncloud.api.app-provider-collabora
volumes:
- ./config/ocis/app-registry.yaml:/etc/ocis/app-registry.yaml
- ./config/ocis/csp.yaml:/etc/ocis/csp.yaml
Expand Down
6 changes: 3 additions & 3 deletions services/frontend/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:"Service name or address of the app provider to use for secure view. Should match the service name or address of the registered CS3 app provider." introductionVersion:"5.1"`
}

type Archiver struct {
Expand Down
4 changes: 2 additions & 2 deletions services/frontend/pkg/config/defaults/defaultconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion services/frontend/pkg/revaconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit c65fb8d

Please sign in to comment.