academy.exchange.cloud.config¶
Cloud exchange configuration file parsing.
LogConfig
¶
Bases: BaseModel
Log config for exchange server.
Attributes:
-
level(int | str) –Console log verbosity.
-
logfile(str | None) –Base file name to write to.
-
logfile_level(int | str) –Verbosity of logs in file.
-
rotate(bool) –Weather to rotate logs or not.
-
rotation_interval_days(int) –How often in days to rotate logs.
-
backup_count(int) –How many previous log files to keep
init_logger
¶
init_logger() -> Logger
Initialize logger from this configuration.
Source code in academy/exchange/cloud/config.py
ExchangeAuthConfig
¶
Bases: BaseModel
Exchange authentication configuration.
Attributes:
-
method(Literal['globus'] | None) –Authentication method.
-
kwargs(dict[str, Any]) –Arbitrary keyword arguments to pass to the authenticator. The kwargs are excluded from the
repr()of this class because they often contain secrets.
BackendConfig
¶
Bases: Protocol
Config for backend of storing messages.
get_backend
abstractmethod
¶
get_backend() -> MailboxBackend
PythonBackendConfig
¶
RedisBackendConfig
¶
Bases: BaseModel
Config for RedisBackend.
Attributes:
-
hostname(str) –Redis host
-
port(int) –Redis port
-
kwargs(dict[str, Any]) –Any additional args to Redis
get_backend
¶
get_backend() -> MailboxBackend
Construct an instance of the backend from the config.
Source code in academy/exchange/cloud/config.py
ExchangeServingConfig
¶
Bases: BaseModel
Exchange serving configuration.
Attributes:
-
host(str) –Network interface the server binds to.
-
port(int) –Network port the server binds to.
-
certfile(str | None) –Certificate file (PEM format) use to enable TLS.
-
keyfile(str | None) –Private key file. If not specified, the key will be taken from the certfile.
-
auth(ExchangeAuthConfig) –Authentication configuration.
-
log_file(ExchangeAuthConfig) –Location to write logs.
-
log_level(ExchangeAuthConfig) –Verbosity of logs.
from_toml
classmethod
¶
Parse an TOML config file.
Example
Minimal config without SSL and without authentication.
Example
Serve with SSL and Globus Auth.
Note
Omitted values will be set to their defaults (if they are an optional value with a default).