config
cattle_grid.config
AuthConfig
Bases: BaseModel
Configures the Authorization layer
Source code in cattle_grid/config/__init__.py
actor_acct_id: str | None = None
class-attribute
instance-attribute
acct uri of the Application Actor used to fetch public keys
actor_id: str | None = None
class-attribute
instance-attribute
actor_id for the Application actor used to fetch public keys
domain_blocks: set = Field(default_factory=set)
class-attribute
instance-attribute
Set of blocked domains
enabled: bool = False
class-attribute
instance-attribute
Enables the auth router
private_key: str | None = None
class-attribute
instance-attribute
Private key of the Application actor
public_key: str | None = None
class-attribute
instance-attribute
Public key of the Application actor
Config
Bases: BaseModel
Configuration of CattleGrid
>>> import tomli_w
>>> config = Config()
>>> print(tomli_w.dumps(config.model_dump(exclude_none=True)))
version = 2
amqp_uri = "amqp://guest:guest@rabbitmq:5672/"
db_uri = "sqlite://cattle_grid.db"
enable_reporting = false
<BLANKLINE>
[auth]
enabled = false
public_key = "..."
private_key = "..."
domain_blocks = []
<BLANKLINE>
[gateway]
enable = false
enable_authentication = true
<BLANKLINE>
[gateway.admin]
enable_reset = false
enable = false
<BLANKLINE>
[manage]
enable = false
exchange = "manage"
<BLANKLINE>
Source code in cattle_grid/config/__init__.py
enable_reporting: bool = False
class-attribute
instance-attribute
Set to true to enable reporting
GatewayAdminConfig
Bases: BaseModel
Controls the Admin features of the Gateway
Source code in cattle_grid/config/__init__.py
enable: bool = False
class-attribute
instance-attribute
Enables the gateway
enable_reset: bool = False
class-attribute
instance-attribute
Enables deleting all users and actors, useful for testing
GatewayConfig
Bases: BaseModel
Controls the Gateway
Source code in cattle_grid/config/__init__.py
admin: GatewayAdminConfig = Field(default_factory=GatewayAdminConfig)
class-attribute
instance-attribute
admin configuration
enable: bool = False
class-attribute
instance-attribute
enables the gateway
enable_authentication: bool = True
class-attribute
instance-attribute
Enable the endpoints provided by [rabbit_blueprint][cattle_grid.gateway.auth.rabbit_blueprint] to be used with rabbitmq http authentication
ManageConfig
Bases: BaseModel
Configures managing
Source code in cattle_grid/config/__init__.py
enable: bool = False
class-attribute
instance-attribute
Set to true to enable
exchange: str = 'manage'
class-attribute
instance-attribute
RabbitMQ exchange name
load_config(filename='cattle_grid.toml')
loads the configuration from file
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
|
'cattle_grid.toml'
|
Returns:
| Type | Description |
|---|---|
Config
|
|