atoti.config.session_config module

class atoti.config.session_config.SessionConfig(_app_extensions=None, authentication=None, aws=None, azure=None, branding=None, extra_jars=None, https=None, i18n=None, java_options=None, jwt=None, logging=None, port=None, same_site='lax', 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.

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.

extra_jars: Optional[Sequence[Union[str, pathlib.Path]]] = None

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 translation keys for the app.

java_options: Optional[Sequence[str]] = None

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: typing_extensions.Literal[lax, none, strict] = 'lax'

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.

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"}