allow configuring support_sse capability

Signed-off-by: jkoberg <jkoberg@owncloud.com>
This commit is contained in:
jkoberg
2023-08-02 16:47:30 +02:00
parent 604ce5174c
commit 4a850abc86
5 changed files with 10 additions and 5 deletions
@@ -1,4 +1,4 @@
Enhancement: Allow calling the global notifications endpoints when knowing a static secret
Enhancement: Add static secret to gn endpoints
The global notifications POST and DELETE endpoints (used only for deprovision notifications at the moment) can now be called by adding a static secret to the header. Admins can still call this endpoint without knowing the secret
+1
View File
@@ -38,6 +38,7 @@ type Config struct {
EnableFederatedSharingOutgoing bool `yaml:"enable_federated_sharing_outgoing" env:"FRONTEND_ENABLE_FEDERATED_SHARING_OUTGOING" desc:"Changing this value is NOT supported. Enables support for outgoing federated sharing for clients. The backend behaviour is not changed."`
SearchMinLength int `yaml:"search_min_length" env:"FRONTEND_SEARCH_MIN_LENGTH" desc:"Minimum number of characters to enter before a client should start a search for Share receivers. This setting can be used to customize the user experience if e.g too many results are displayed."`
Edition string `yaml:"edition" env:"OCIS_EDITION;FRONTEND_EDITION"`
DisableSSE bool `yaml:"disable_sse" env:"OCIS_DISABLE_SSE,FRONTEND_DISABLE_SSE" desc:"When set to true, clients are informed that the Server-Sent Events endpoint is not accessible."`
PublicURL string `yaml:"public_url" env:"OCIS_URL;FRONTEND_PUBLIC_URL" desc:"The public facing URL of the oCIS frontend."`
+1 -1
View File
@@ -192,7 +192,7 @@ func FrontendConfigFromStruct(cfg *config.Config) (map[string]interface{}, error
"hostname": "",
},
"support_url_signing": true,
"support_sse": true,
"support_sse": !cfg.DisableSSE,
},
"graph": map[string]interface{}{
"personal_data_export": true,
+6 -2
View File
@@ -36,7 +36,11 @@ Additionally to the oc10 API, the `userlog` service also provides an `/sse` (Ser
## Posting
The userlog service is able to store global messages that will be displayed in the Web UI to all users. These messages can only be activated and deleted by users with the `admin` role but not by ordinary users. If a user deletes the message in the Web UI, it reappears on reload. Global messages use the endpoint `/ocs/v2.php/apps/notifications/api/v1/notifications/global` and are activated by sending a `POST` request. Note that sending another `POST` request of the same type overwrites the previous one. For the time being, only the type `deprovision` is supported.
The userlog service is able to store global messages that will be displayed in the Web UI to all users. If a user deletes the message in the Web UI, it reappears on reload. Global messages use the endpoint `/ocs/v2.php/apps/notifications/api/v1/notifications/global` and are activated by sending a `POST` request. Note that sending another `POST` request of the same type overwrites the previous one. For the time being, only the type `deprovision` is supported.
### Authentication
`POST` and `DELETE` endpoints provide notifications to all users, therefore only certain users can access them. There are two different possiblities to authenticate for this endpoint. First, users with the `admin` role can always access the endpoints. However it is possible to define a static secret via the `USERLOG_GLOBAL_NOTIFICATIONS_SECRET`. Users knowing the secret can send a header containing it on their requests. Having the secret in the header bypasses the `admin` requirement.
### Deprovisioning
@@ -46,7 +50,7 @@ Deprovision messages announce a deprovision text including a deprovision date of
To delete events for an user, use a `DELETE` request to `ocs/v2.php/apps/notifications/api/v1/notifications` containing the IDs to delete.
Only users with the `admin` role can send a `DELETE` request to the `ocs/v2.php/apps/notifications/api/v1/notifications/global` endpoint to remove a global message, see the [Posting](#posting) section for more details.)
Sending a `DELETE` request to the `ocs/v2.php/apps/notifications/api/v1/notifications/global` endpoint to remove a global message is a restricted action, see the [Authentication](###authentication) section for more details.)
## Translations
+1 -1
View File
@@ -30,7 +30,7 @@ type Config struct {
DisableSSE bool `yaml:"disable_sse" env:"OCIS_DISABLE_SSE,USERLOG_DISABLE_SSE" desc:"Disables server-sent events (sse). When disabled, clients will no longer be able to connect to the sse endpoint."`
GlobalNotificationsSecret string `yaml:"global_notifications_secret" env:"USERLOG_GLOBAL_NOTIFICATIONS_SECRET" desc:"The secret to secure the global notifications endpoint. Only users knowing that secret and system admins can call the global notifications POST/DELETE endpoints"`
GlobalNotificationsSecret string `yaml:"global_notifications_secret" env:"USERLOG_GLOBAL_NOTIFICATIONS_SECRET" desc:"The secret to secure the global notifications endpoint. Only system admins and users knowing that secret can call the global notifications POST/DELETE endpoints."`
Context context.Context `yaml:"-"`
}