atoti.config.session_config module¶
- class atoti.config.session_config.SessionConfig(app_extensions=None, authentication=None, aws=None, azure=None, branding=None, client_certificate=None, extra_jars=(), https=None, i18n=None, java_options=(), jwt=None, logging=None, port=None, same_site=None, user_content_storage=None)¶
The structure of the configuration expected by the session.
Sub-classes can be explored for more information on how to use each part of the configuration.
- app_extensions: Optional[Mapping[str, Union[str, pathlib.Path]]] = None¶
Extensions to customize the web application embedded in the session.
Extensions can enhance the built-in app in many ways such as:
Adding new type of widgets.
Attaching custom menu items or titlebar buttons to a set of widgets.
Providing other React contexts to the components rendered by the app.
Note
This requires the
atoti-plus
plugin.The
app extension template
can be used as a starting point.Example
>>> config = { ... "app_extensions": { ... "some-extension": "../extensions/some-extension-package-directory/dist" ... } ... }
- authentication: Optional[atoti.config.authentication.authentication.AuthenticationConfig] = None¶
Configure the authentication mechanism for the app.
Users and roles are configured using
atoti.session.Session.security
.
- aws: Optional[atoti.config.aws.AwsConfig] = None¶
- azure: Optional[atoti.config.azure.AzureConfig] = None¶
- branding: Optional[atoti.config.branding.BrandingConfig] = None¶
UI elements to change in the app to customize its appearance.
- client_certificate: Optional[atoti.config.client_certificate.ClientCertificateConfig] = None¶
Enable client certificate based authentication on the session.
- extra_jars: Iterable[Union[str, pathlib.Path]] = ()¶
The paths to the JAR that will be added to the classpath of the Java process when starting the session.
Example
>>> config = {"extra_jars": ["../extra.jar"]}
- https: Optional[atoti.config.https.HttpsConfig] = None¶
Provide certificates to enable HTTPS on the app.
- i18n: Optional[atoti.config.i18n.I18nConfig] = None¶
Configure custom translations for the app.
- java_options: Iterable[str] = ()¶
The additional options to pass when starting the Java process (e.g. for optimization or debugging purposes).
In particular, the
-Xmx
option can be set to increase the amount of RAM that the session can use. If this option is not specified, the JVM default memory setting is used which is 25% of the machine memory.Example
>>> config = {"java_options": ["-verbose:gc", "-Xms1g", "-XX:+UseG1GC"]}
- jwt: Optional[atoti.config.jwt.JwtConfig] = None¶
Set the key pair used to validate JWTs when authenticating with the session.
- logging: Optional[atoti.config.logging.LoggingConfig] = None¶
Configure log storage for the session.
- port: Optional[int] = None¶
The port on which the session will be exposed.
Defaults to a random available port.
Example
>>> config = {"port": 8080}
- same_site: Optional[typing_extensions.Literal[none, strict]] = None¶
The value to use for the SameSite attribute of the HTTP cookie sent by the session when
authentication
is configured.Note
This requires the
atoti-plus
plugin.See https://web.dev/samesite-cookies-explained for more information.
Setting it to
none
requires the session to be served through HTTPS.Defaults to
lax
.Example
>>> config = {"same_site": "strict"}
- user_content_storage: Optional[Union[pathlib.Path, str, atoti.config.user_content_storage.UserContentStorageConfig]] = None¶
The location of the database where the user content will be stored.
The user content is what is not part of the data sources, such as the dashboards, widgets, and filters saved in the application.
Defaults to
None
meaning that the user content is kept in memory and is lost when the atoti session is closed.If a path to a directory is given, it will be created if needed.
Example
>>> config = {"user_content_storage": "./content"}