mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-02-18 03:18:52 -06:00
feat: add and adjust configs for embed mode
This commit is contained in:
@@ -5,6 +5,8 @@ New configs for the Web embed mode have been added:
|
||||
* `enabled` Defines if embed mode is enabled.
|
||||
* `target` Defines how Web is being integrated when running in embed mode.
|
||||
* `messagesOrigin` Defines a URL under which Web can be integrated via iFrame.
|
||||
* `delegateAuthentication` Defines whether Web should require authentication to be done by the parent application.
|
||||
* `delegateAuthenticationOrigin` Defines the host to validate the message event origin against when running Web in 'embed' mode.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/7670
|
||||
https://github.com/owncloud/web/issues/9768
|
||||
|
||||
@@ -201,7 +201,9 @@ func Sanitize(cfg *config.Config) {
|
||||
// remove Embed parent if no value is set
|
||||
if cfg.Web.Config.Options.Embed.Enabled == "" &&
|
||||
cfg.Web.Config.Options.Embed.Target == "" &&
|
||||
cfg.Web.Config.Options.Embed.MessagesOrigin == "" {
|
||||
cfg.Web.Config.Options.Embed.MessagesOrigin == "" &&
|
||||
cfg.Web.Config.Options.Embed.DelegateAuthentication == "" &&
|
||||
cfg.Web.Config.Options.Embed.DelegateAuthenticationOrigin == "" {
|
||||
cfg.Web.Config.Options.Embed = nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,7 +75,9 @@ type Editor struct {
|
||||
|
||||
// Embed are the Embed options
|
||||
type Embed struct {
|
||||
Enabled string `json:"enabled,omitempty" yaml:"enabled" env:"WEB_OPTION_EMBED_ENABLED" desc:"Defines whether Web should be running in 'embed' mode. Setting this to 'true' will enable a stripped down version of Web with reduced functionality used to integrate Web into other applications like via iFrame. Setting it to 'false' or not setting it (default) will run Web as usual with all functionality enabled. See the text description for more details."`
|
||||
Target string `json:"target,omitempty" yaml:"target" env:"WEB_OPTION_EMBED_TARGET" desc:"Defines how Web is being integrated when running in 'embed' mode. Currently, the only supported options are '' (empty) and 'location'. With '' which is the default, Web will run regular as defined via the 'embed.enabled' config option. With 'location', Web will run embedded as location picker. Resource selection will be disabled and the selected resources array always includes the current folder as the only item. See the text description for more details."`
|
||||
MessagesOrigin string `json:"messagesOrigin,omitempty" yaml:"messagesOrigin" env:"WEB_OPTION_EMBED_MESSAGES_ORIGIN" desc:"Defines a URL under which Web can be integrated via iFrame in 'embed' mode. Note that setting this is mandatory when running Web in 'embed' mode. Use '*' as value to allow running the iFrame under any URL, although this is not recommended for security resons. See the text description for more details."`
|
||||
Enabled string `json:"enabled,omitempty" yaml:"enabled" env:"WEB_OPTION_EMBED_ENABLED" desc:"Defines whether Web should be running in 'embed' mode. Setting this to 'true' will enable a stripped down version of Web with reduced functionality used to integrate Web into other applications like via iFrame. Setting it to 'false' or not setting it (default) will run Web as usual with all functionality enabled. See the text description for more details."`
|
||||
Target string `json:"target,omitempty" yaml:"target" env:"WEB_OPTION_EMBED_TARGET" desc:"Defines how Web is being integrated when running in 'embed' mode. Currently, the only supported options are '' (empty) and 'location'. With '' which is the default, Web will run regular as defined via the 'embed.enabled' config option. With 'location', Web will run embedded as location picker. Resource selection will be disabled and the selected resources array always includes the current folder as the only item. See the text description for more details."`
|
||||
MessagesOrigin string `json:"messagesOrigin,omitempty" yaml:"messagesOrigin" env:"WEB_OPTION_EMBED_MESSAGES_ORIGIN" desc:"Defines a URL under which Web can be integrated via iFrame in 'embed' mode. Note that setting this is mandatory when running Web in 'embed' mode. Use '*' as value to allow running the iFrame under any URL, although this is not recommended for security reasons. See the text description for more details."`
|
||||
DelegateAuthentication string `json:"delegateAuthentication,omitempty" yaml:"delegateAuthentication" env:"WEB_OPTION_EMBED_DELEGATE_AUTHENTICATION" desc:"Defines whether Web should require authentication to be done by the parent application when running in 'embed' mode. If set to 'true' Web will not try to authenticate the user on its own but will require an access token coming from the parent application. Defaults to being unset."`
|
||||
DelegateAuthenticationOrigin string `json:"delegateAuthenticationOrigin,omitempty" yaml:"delegateAuthenticationOrigin" env:"WEB_OPTION_EMBED_DELEGATE_AUTHENTICATION_ORIGIN" desc:"Defines the host to validate the message event origin against when running Web in 'embed' mode with delegated authentication. Defaults to event message origin validation being omitted, which is only recommended for development setups."`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user