academy.exchange.cloud.config¶
Cloud exchange configuration file parsing.
ExchangeAuthConfig
pydantic-model
¶
Bases: BaseModel
Exchange authentication configuration.
Attributes:
-
method
(Optional[Literal['globus']]
) –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.
Config:
extra
:forbid
Fields:
ExchangeServingConfig
pydantic-model
¶
Bases: BaseModel
Exchange serving configuration.
Attributes:
-
host
(str
) –Network interface the server binds to.
-
port
(int
) –Network port the server binds to.
-
certfile
(Optional[str]
) –Certificate file (PEM format) use to enable TLS.
-
keyfile
(Optional[str]
) –Private key file. If not specified, the key will be taken from the certfile.
-
auth
(ExchangeAuthConfig
) –Authentication configuration.
-
log_file
(Optional[str]
) –Location to write logs.
-
log_level
(Union[int, str]
) –Verbosity of logs.
Fields:
-
host
(str
) -
port
(int
) -
certfile
(Optional[str]
) -
keyfile
(Optional[str]
) -
auth
(ExchangeAuthConfig
) -
log_file
(Optional[str]
) -
log_level
(Union[int, str]
)
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).
Source code in academy/exchange/cloud/config.py
load
¶
loads
¶
Parse TOML string to data class.
Parameters:
-
model
(type[BaseModelT]
) –Config model type to parse TOML using.
-
data
(str
) –TOML string to parse.
Returns:
-
BaseModelT
–Model initialized from TOML file.