Server reference
tessera_server
Agent Tessera server: registry, credentials, policy distribution, and audit.
tessera_server.config
Process settings for the control plane.
WorkloadBinding
Bases: BaseModel
One workload-identity assertion that may bootstrap an agent.
Attributes:
| Name | Type | Description |
|---|---|---|
issuer |
str
|
Identity provider the assertion must come from. |
audience |
str
|
Audience the assertion must carry. |
agent |
str
|
Agent slug this binding may start. |
environment |
str
|
Environment that agent runs in. |
claim |
str
|
Claim that must be a non-empty string. Defaults to |
Settings
Bases: BaseModel
Configuration the server reads once at startup.
Attributes:
| Name | Type | Description |
|---|---|---|
database_url |
str
|
SQLAlchemy URL for SQLite or Postgres. |
issuer |
str
|
Public base URL of this server, without a trailing slash. |
org |
str
|
Organization slug used in agent URIs. |
kek |
bytes
|
32-byte key that encrypts signing keys at rest. |
dev |
bool
|
Whether loopback requests may skip admin authentication. |
token_ttl |
int
|
Runtime token lifetime in seconds. |
bundle_ttl |
int
|
Policy bundle lifetime in seconds. |
lease_ttl |
int
|
Token-lease lifetime in seconds. |
webhook_url |
str | None
|
Catch-all webhook registered at startup. |
webhook_secret |
str | None
|
HMAC secret for webhooks that do not set their own. |
oidc_issuer |
str | None
|
Identity provider issuer for admin SSO. |
oidc_client_id |
str | None
|
OAuth client id for the admin login. |
oidc_client_secret |
str | None
|
OAuth client secret for the admin login. |
oidc_redirect_url |
str | None
|
Callback URL. |
oidc_required |
bool
|
When true, the admin-key form is rejected. |
oidc_admin_group |
str | None
|
Optional group claim required for admin SSO. |
workload_bindings |
tuple[WorkloadBinding, ...]
|
Assertions that may bootstrap an agent without a registration token. The first match wins. |
session_idle |
int
|
Admin UI session idle timeout in seconds. |
session_max |
int
|
Admin UI session absolute lifetime in seconds. |
trace_url |
str | None
|
Optional OTel/backend URL template with |
from_env
classmethod
from_env(*, dev: bool = False) -> Settings
Build settings from the environment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dev
|
bool
|
Use development defaults and a key file under |
False
|
Returns:
| Type | Description |
|---|---|
Settings
|
Frozen settings. The development key file is created mode |
Settings
|
when it does not already exist. |
Raises:
| Type | Description |
|---|---|
ConfigError
|
If a required variable is missing, the key is not 32 bytes of base64, or a session lifetime is not a duration. The message names the variable. |
Example
settings = Settings.from_env(dev=True)
assert settings.dev is True
assert len(settings.kek) == 32
tessera_server.app
FastAPI application factory.
create_app
create_app(settings: Settings) -> FastAPI
Build the control-plane application.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
settings
|
Settings
|
Process settings stored on |
required |
Returns:
| Type | Description |
|---|---|
FastAPI
|
An application that serves health, the JSON API, and the admin UI. |
Example
from tessera_server.app import create_app
from tessera_server.config import Settings
app = create_app(Settings.from_env(dev=True))
assert app.state.settings.dev is True