Server - Configuration
SapphireDb has different options to configure your application to do what you want.
To configure the SapphireDb-Server pass the options object in the service configuration.
Load settings from configuration
You can also pass a configuration section when creating the database options. This will load the settings from it.
You only have to set
IsAllowedToSendMessagesfrom code manually.
The settings contain configuration for authentication. The default configuration is very weak and allows every user to do everything. It is highly recommended to define custom options for critical parts. You can enable the strict mode of the options to run on a higher security level.
If you want to restrict access to the server you can define api configurations. You should define a configuration for every client application.
Every configuration consists of a key, a secret and a readable name.
You can create a hash here:
Checks if a connection is allowed to execute a command. Because every action is a command, this method can be used to generally control all interactions.
(command, context) => true
(command, context) => context.User.Identity.IsAuthenticated
Control if the user is allowed to publish messages.
(context) => true
(context) => context.User.Identity.IsAuthenticated
Enable websocket interface for connections.
Enable SSE interface for connections.
Enable polling (long polling) interface for connections.
Enable rest interface for connections. Always enabled when using long polling or SSE