generated

package
v0.45.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package generated holds the backend configuration struct generated by go-jsonschema from the vendored config schema (config.go, regenerated via `make generate-config`), plus a hand-written stable alias (this file). It is read-only generated code — never hand-edit config.go; change the AppConfig model and regenerate (impl/6.0 §2).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminAuthConfig

type AdminAuthConfig struct {
	// Maximum seconds a password or OAuth client-secret hash or verification waits
	// for one of the “argon2_max_concurrency“ slots before failing with HTTP 503
	// and a “Retry-After“ header.
	Argon2AcquireTimeoutS float64 `json:"argon2_acquire_timeout_s" yaml:"argon2_acquire_timeout_s" mapstructure:"argon2_acquire_timeout_s"`

	// Per-process cap on concurrent argon2id password and OAuth client-secret hashes
	// and verifications across all surfaces. Each argon2id call allocates 64 MiB
	// (“memory_cost=65536“), so the default of 4 bounds peak argon2 memory at 256
	// MiB per process. Calls beyond the cap wait up to “argon2_acquire_timeout_s“
	// for a slot and then fail with HTTP 503 + “Retry-After“ instead of allocating
	// another 64 MiB buffer.
	Argon2MaxConcurrency int `json:"argon2_max_concurrency" yaml:"argon2_max_concurrency" mapstructure:"argon2_max_concurrency"`

	// How long a locked admin account stays locked before logins are accepted again.
	FailedLoginLockoutSeconds int `json:"failed_login_lockout_seconds" yaml:"failed_login_lockout_seconds" mapstructure:"failed_login_lockout_seconds"`

	// Consecutive failed logins after which an admin account is locked.
	FailedLoginLockoutThreshold int `json:"failed_login_lockout_threshold" yaml:"failed_login_lockout_threshold" mapstructure:"failed_login_lockout_threshold"`

	// HMAC secret that signs admin login JWTs. Required in production (empty or
	// placeholder values are rejected at startup); in development an ephemeral
	// per-process secret is generated when empty.
	JwtSecret string `json:"jwt_secret,omitempty,omitzero" yaml:"jwt_secret,omitempty" mapstructure:"jwt_secret,omitempty"`

	// Lifetime of one admin login JWT. “POST /auth/refresh“ re-mints the token, so
	// this bounds a single token, not the session.
	JwtTtlSeconds int `json:"jwt_ttl_seconds" yaml:"jwt_ttl_seconds" mapstructure:"jwt_ttl_seconds"`

	// Absolute cap on a web session: refresh re-mints the login JWT only while “now
	// - auth_time“ stays inside this window, so a leaked token cannot be kept alive
	// indefinitely. Must be >= “jwt_ttl_seconds“.
	SessionTtlSeconds int `json:"session_ttl_seconds" yaml:"session_ttl_seconds" mapstructure:"session_ttl_seconds"`
}

Admin authentication settings.

func (*AdminAuthConfig) UnmarshalJSON

func (j *AdminAuthConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type AdminConfig

type AdminConfig struct {
	// Auth corresponds to the JSON schema field "auth".
	Auth *AdminAuthConfig `json:"auth,omitempty,omitzero" yaml:"auth,omitempty" mapstructure:"auth,omitempty"`

	// Events corresponds to the JSON schema field "events".
	Events *AdminEventsConfig `json:"events,omitempty,omitzero" yaml:"events,omitempty" mapstructure:"events,omitempty"`

	// Invite corresponds to the JSON schema field "invite".
	Invite *AdminInviteConfig `json:"invite,omitempty,omitzero" yaml:"invite,omitempty" mapstructure:"invite,omitempty"`
}

Admin surface configuration.

type AdminEventsConfig added in v0.44.0

type AdminEventsConfig struct {
	// Minimum seconds between re-verifications of an open “GET /events/stream“: its
	// credential, “events:read“ / “org:admin“ permission, and the scope of the
	// events it delivers. Checks run only at a poll or page boundary, so a check
	// happens at the first poll or page after the interval elapses; an idle stream
	// polls every few seconds, so a value below its poll interval behaves as that
	// interval. A disabled caller, a revoked or expired token, or a revoked
	// permission ends the stream at that check; a narrower permission set narrows it.
	// Permissions are those the credential carries: API keys and “at_“ access
	// tokens resolve them live (an ephemeral agent “at_“ keeps the subset it was
	// minted with). A login session JWT carries the set it was issued with, but
	// removing any of a user's effective permissions revokes their login sessions, so
	// a stream opened with one ends at that check. The stream re-verifies the token
	// it was opened with, so a permission added to a user reaches a login-session
	// stream once the client reconnects with a newer login JWT.
	StreamRecheckSeconds float64 `json:"stream_recheck_seconds" yaml:"stream_recheck_seconds" mapstructure:"stream_recheck_seconds"`
}

Admin event-stream settings.

func (*AdminEventsConfig) UnmarshalJSON added in v0.44.0

func (j *AdminEventsConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type AdminInviteConfig

type AdminInviteConfig struct {
	// HMAC key for stored invite-token hashes. Required in production (empty or
	// placeholder values are rejected at startup); in development an ephemeral
	// per-process value is generated when empty. Changing it invalidates every
	// outstanding invite.
	Pepper string `json:"pepper,omitempty,omitzero" yaml:"pepper,omitempty" mapstructure:"pepper,omitempty"`

	// Days an admin invite token stays redeemable after it is issued.
	TtlDays int `json:"ttl_days" yaml:"ttl_days" mapstructure:"ttl_days"`
}

Admin invite token settings.

func (*AdminInviteConfig) UnmarshalJSON

func (j *AdminInviteConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type AuthConfig

type AuthConfig struct {
	// Lifetime (seconds) of an OAuth access token issued by the auth surface.
	AccessTtlSeconds int `json:"access_ttl_seconds" yaml:"access_ttl_seconds" mapstructure:"access_ttl_seconds"`

	// Furthest in the future (seconds) a JWT-Bearer client assertion's “exp“ may
	// be; assertions expiring later are rejected.
	AssertionMaxTtlSeconds int `json:"assertion_max_ttl_seconds" yaml:"assertion_max_ttl_seconds" mapstructure:"assertion_max_ttl_seconds"`

	// Lifetime (seconds) of an OAuth authorization code before it must be exchanged.
	AuthCodeTtlSeconds int `json:"auth_code_ttl_seconds" yaml:"auth_code_ttl_seconds" mapstructure:"auth_code_ttl_seconds"`

	// Public origin of the auth surface (“scheme://host[:port]“, no path), used for
	// the OIDC issuer, the JWT-Bearer assertion audience and the SPA login callback.
	// Unset falls back to “server.public_base_url“, then the request or bind
	// origin. A value with a path breaks the OAuth well-known discovery routes.
	CanonicalBaseUrl string `json:"canonical_base_url,omitempty,omitzero" yaml:"canonical_base_url,omitempty" mapstructure:"canonical_base_url,omitempty"`

	// Lifetime (seconds) of the agent-ownership claim token minted at agent
	// registration. Has no effect unless a claim-token minter is installed; the
	// default build mints none.
	ClaimTtlSeconds int `json:"claim_ttl_seconds" yaml:"claim_ttl_seconds" mapstructure:"claim_ttl_seconds"`

	// ES256 keys for signing OIDC ID tokens. The first entry signs; every entry is
	// published in the JWKS, so append the next key and later move it first to
	// rotate. The local-dev key is rejected in production.
	IdSigning []SigningKeyConfig `json:"id_signing,omitempty,omitzero" yaml:"id_signing,omitempty" mapstructure:"id_signing,omitempty"`

	// Idp corresponds to the JSON schema field "idp".
	Idp *IdpConfig `json:"idp,omitempty,omitzero" yaml:"idp,omitempty" mapstructure:"idp,omitempty"`

	// LocalLogin corresponds to the JSON schema field "local_login".
	LocalLogin *LocalLoginConfig `json:"local_login,omitempty,omitzero" yaml:"local_login,omitempty" mapstructure:"local_login,omitempty"`

	// OauthRateLimit corresponds to the JSON schema field "oauth_rate_limit".
	OauthRateLimit *OAuthRateLimitConfig `json:"oauth_rate_limit,omitempty,omitzero" yaml:"oauth_rate_limit,omitempty" mapstructure:"oauth_rate_limit,omitempty"`

	// Static first-party OAuth clients that authenticate with PKCE only (no secret).
	// When “auth.canonical_base_url“ is set, the operator SPA (“jentic-one-spa“)
	// is added automatically if not listed.
	PlatformClients []PlatformClientConfig `json:"platform_clients,omitempty,omitzero" yaml:"platform_clients,omitempty" mapstructure:"platform_clients,omitempty"`

	// Lifetime (seconds) of the registration access token returned when an agent
	// registers, which the agent uses to check its registration status.
	RatTtlSeconds int `json:"rat_ttl_seconds" yaml:"rat_ttl_seconds" mapstructure:"rat_ttl_seconds"`

	// Maximum absolute lifetime (seconds, default 90 days) of an OAuth refresh-token
	// family from initial mint, across rotations. Set to null to disable the family
	// cap.
	RefreshFamilyMaxAgeSeconds interface{} `json:"refresh_family_max_age_seconds" yaml:"refresh_family_max_age_seconds" mapstructure:"refresh_family_max_age_seconds"`

	// Lifetime (seconds, default 7 days) of an OAuth refresh token; each refresh
	// rotates it and the new token gets a fresh lifetime.
	RefreshTtlSeconds int `json:"refresh_ttl_seconds" yaml:"refresh_ttl_seconds" mapstructure:"refresh_ttl_seconds"`
}

Platform-actors OAuth surface configuration.

func (*AuthConfig) UnmarshalJSON

func (j *AuthConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type AuthConfigRefreshFamilyMaxAgeSeconds_0 added in v0.45.1

type AuthConfigRefreshFamilyMaxAgeSeconds_0 *int

type BackendConfig

type BackendConfig = ConfigSchemaJson

BackendConfig is the stable name the installer/binder/doctor refer to for the generated backend configuration root (impl/6.0 §2). go-jsonschema derives the root type name from the schema file (config-schema.json → ConfigSchemaJson); this alias pins the name the rest of the CLI uses so a future generator quirk or filename change can't ripple through internal/cli/ctl. It is a type ALIAS (not a defined type), so BackendConfig and ConfigSchemaJson are identical for reflection, JSON, and method-set purposes — the binder walks either interchangeably.

This file is hand-written and lives beside the generated config.go precisely so the generator never overwrites it.

type BaseModel

type BaseModel map[string]interface{}

type BrokerConfig

type BrokerConfig struct {
	// Egress corresponds to the JSON schema field "egress".
	Egress *EgressConfig `json:"egress,omitempty,omitzero" yaml:"egress,omitempty" mapstructure:"egress,omitempty"`

	// Idempotency corresponds to the JSON schema field "idempotency".
	Idempotency *IdempotencyConfig `json:"idempotency,omitempty,omitzero" yaml:"idempotency,omitempty" mapstructure:"idempotency,omitempty"`

	// Public base URL of the admin API (e.g. “https://api.example.com“), used for
	// the links a broker returns for async and held executions (“/jobs/{id}“,
	// “/executions/holds/{id}“, the approval review page). Unset, they are relative
	// to the broker's own origin (the review page link tries
	// “server.public_base_url“ first); set it when the broker runs without the
	// admin surface.
	JobsApiBaseUrl interface{} `json:"jobs_api_base_url,omitempty,omitzero" yaml:"jobs_api_base_url,omitempty" mapstructure:"jobs_api_base_url,omitempty"`

	// HS256 shared secret for verifying self-contained JWTs at the broker (signature
	// and “exp“ only), for development and tests. Unset disables this path;
	// “jwt_verification.trusted_issuers“ takes precedence when set and is the
	// production option.
	JwtSecret interface{} `json:"jwt_secret,omitempty,omitzero" yaml:"jwt_secret,omitempty" mapstructure:"jwt_secret,omitempty"`

	// JwtVerification corresponds to the JSON schema field "jwt_verification".
	JwtVerification *JwtVerificationConfig `json:"jwt_verification,omitempty,omitzero" yaml:"jwt_verification,omitempty" mapstructure:"jwt_verification,omitempty"`

	// Resilience corresponds to the JSON schema field "resilience".
	Resilience *BrokerResilienceConfig `json:"resilience,omitempty,omitzero" yaml:"resilience,omitempty" mapstructure:"resilience,omitempty"`

	// Seconds the broker caches a token or API-key validation verdict (and a JWT
	// caller's active status) in process. Bounds how long a revoked token or disabled
	// agent keeps working on each broker; 0 disables the cache.
	ResolveCacheTtlSeconds float64 `json:"resolve_cache_ttl_seconds" yaml:"resolve_cache_ttl_seconds" mapstructure:"resolve_cache_ttl_seconds"`

	// Maximum entries in each broker process's permission-rule cache, one per active
	// (agent, credential) binding; least recently used entries are evicted first.
	RuleCacheMaxEntries int `json:"rule_cache_max_entries" yaml:"rule_cache_max_entries" mapstructure:"rule_cache_max_entries"`

	// Seconds the broker caches the permission rules of an (agent, credential)
	// binding in process; a rule change reaches each broker within this long. 0
	// disables the cache.
	RuleCacheTtlS float64 `json:"rule_cache_ttl_s" yaml:"rule_cache_ttl_s" mapstructure:"rule_cache_ttl_s"`

	// Emit a W3C “Server-Timing“ header on execute responses with per-stage
	// durations (“jentic-auth“, “jentic-egress“, “jentic-discover“,
	// “jentic-rules“, “jentic-body“, “jentic-idempotency“, “jentic-cred“,
	// “jentic-upstream“, “jentic-persist“, “jentic-total“) for authenticated
	// callers. A broker-generated error raised before the upstream call lists the
	// stages that ran without durations. “jentic-upstream“ includes the
	// circuit-breaker check, so a circuit-open “503“ carries durations even though
	// no upstream request was sent. Off by default: timing data aids side-channel
	// probing and fingerprinting, so enable it only where callers are trusted with it
	// (e.g. while diagnosing latency). Streaming responses carry only the stages
	// known before the headers are sent (no “jentic-persist“).
	ServerTiming bool `json:"server_timing,omitempty,omitzero" yaml:"server_timing,omitempty" mapstructure:"server_timing,omitempty"`

	// How long (seconds) a streaming execution persist waits for one of the
	// “broker.streaming_persist_max_concurrency“ slots. Past it the record is
	// abandoned: logged as “streaming_execution_persist_abandoned“ and counted on
	// “broker.streaming_execution.persist_failures“ (“reason=backlog_timeout“).
	// The wait runs after the response is complete or the client has disconnected,
	// when the request no longer holds its admission slot, so the wait delays neither
	// the client nor “/ready“. The timeout bounds how long a stalled admin database
	// can keep records queued in memory, including at shutdown; it does not bound the
	// write itself once a slot is held.
	StreamingPersistAcquireTimeoutS float64 `` /* 136-byte string literal not displayed */

	// Per-process cap on concurrent post-response persists of streaming execution
	// records (each holds one admin-DB connection). Excess persists wait for a slot,
	// up to “broker.streaming_persist_acquire_timeout_s“; the waiting and writing
	// counts are exported as “broker.streaming_execution.persist_pending“. The
	// effective cap is clamped to “databases.admin.pool_max - 1“ (minimum 1; a
	// “streaming_persist_limit_clamped“ warning is logged when it applies), so with
	// “pool_max >= 2“ persists never take every connection of the admin base pool.
	// “pool_max“ is the base pool size only; SQLAlchemy's default overflow can open
	// up to 10 more connections on top of it.
	StreamingPersistMaxConcurrency int `` /* 130-byte string literal not displayed */

	// Budget (seconds) for writing one streaming execution's record and lifecycle
	// event. The write runs after the response, off the request, so it never delays
	// the client; past the budget it is abandoned, logged and counted on
	// “app.background_tasks“ (“kind=streaming_execution_persist“,
	// “outcome=timed_out“).
	StreamingPersistTimeoutS float64 `json:"streaming_persist_timeout_s" yaml:"streaming_persist_timeout_s" mapstructure:"streaming_persist_timeout_s"`

	// Seconds the broker caches an agent's derived credential bindings in process.
	// The cache is per instance, so a grant or revoke takes effect cluster-wide only
	// once this lapses on every broker; 0 disables the cache.
	ToolkitCacheTtlS float64 `json:"toolkit_cache_ttl_s" yaml:"toolkit_cache_ttl_s" mapstructure:"toolkit_cache_ttl_s"`

	// Timeout (seconds) handed to the execution runner for one upstream call on the
	// buffered sync path and the async job worker. Distinct from the transport-level
	// “broker.resilience.upstream“ timeouts and the “request_deadline_s“
	// envelope.
	UpstreamTimeoutS float64 `json:"upstream_timeout_s" yaml:"upstream_timeout_s" mapstructure:"upstream_timeout_s"`
}

Broker surface configuration.

func (*BrokerConfig) UnmarshalJSON

func (j *BrokerConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type BrokerConfigJobsApiBaseUrl_0

type BrokerConfigJobsApiBaseUrl_0 *string

type BrokerConfigJwtSecret_0

type BrokerConfigJwtSecret_0 *string

type BrokerResilienceConfig

type BrokerResilienceConfig struct {
	// CircuitBreaker corresponds to the JSON schema field "circuit_breaker".
	CircuitBreaker *CircuitBreakerConfig `json:"circuit_breaker,omitempty,omitzero" yaml:"circuit_breaker,omitempty" mapstructure:"circuit_breaker,omitempty"`

	// Hard admission cap on concurrently executing brokered calls, **per broker
	// process** — replicas multiply it. At the cap, new requests are shed with 503 +
	// “Retry-After: shed_retry_after_s“.
	MaxInFlight int `json:"max_in_flight" yaml:"max_in_flight" mapstructure:"max_in_flight"`

	// RateLimit corresponds to the JSON schema field "rate_limit".
	RateLimit *RateLimitConfig `json:"rate_limit,omitempty,omitzero" yaml:"rate_limit,omitempty" mapstructure:"rate_limit,omitempty"`

	// Fraction of “max_in_flight“ at/above which “/ready“ reports unready, so the
	// LB drains this instance before it hits the hard admission shed wall. Kept < 1.0
	// for that headroom.
	ReadinessSaturationThreshold float64 `json:"readiness_saturation_threshold" yaml:"readiness_saturation_threshold" mapstructure:"readiness_saturation_threshold"`

	// Overall wall-clock budget (seconds) for one upstream call, enforced by the
	// always-on DeadlineRunner outside the circuit breaker — distinct from the
	// per-attempt connect/read timeout on the transport client. Exceeding it returns
	// 504 with a “wait“ agent directive; 0 disables the budget. Size ABOVE upstream
	// read timeouts so a single healthy slow attempt isn't pre-empted by the envelope
	// deadline.
	RequestDeadlineS float64 `json:"request_deadline_s" yaml:"request_deadline_s" mapstructure:"request_deadline_s"`

	// Retry corresponds to the JSON schema field "retry".
	Retry *RetryConfig `json:"retry,omitempty,omitzero" yaml:"retry,omitempty" mapstructure:"retry,omitempty"`

	// “Retry-After“ (seconds) returned with the 503 when admission sheds at
	// “max_in_flight“.
	ShedRetryAfterS int `json:"shed_retry_after_s" yaml:"shed_retry_after_s" mapstructure:"shed_retry_after_s"`

	// Upstream corresponds to the JSON schema field "upstream".
	Upstream *UpstreamClientConfig `json:"upstream,omitempty,omitzero" yaml:"upstream,omitempty" mapstructure:"upstream,omitempty"`
}

Resilience envelope: admission + rate limit / circuit.

The rate limiter and circuit breaker run on the process's shared-state backend (the top-level “state:“ section). Queue backpressure / async-credential / retention knobs are future work.

func (*BrokerResilienceConfig) UnmarshalJSON

func (j *BrokerResilienceConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CatalogConfig

type CatalogConfig struct {
	// Age (seconds) after which the cached catalog manifest is refreshed on the next
	// catalog read. 0 disables automatic refresh (only “POST /catalog:refresh“).
	ManifestMaxAgeSeconds int `json:"manifest_max_age_seconds" yaml:"manifest_max_age_seconds" mapstructure:"manifest_max_age_seconds"`

	// Manifest source for the public API catalog. Full default:
	// https://raw.githubusercontent.com/jentic/jentic-public-apis/main/apis/openapi/apis.json
	ManifestUrl string `json:"manifest_url" yaml:"manifest_url" mapstructure:"manifest_url"`

	// How long a failed catalog preview fetch (upstream unavailable, oversized or
	// unparseable spec) is remembered per spec URL before it is retried, so repeated
	// previews of a broken spec do not refetch it on every request. Zero retries on
	// the next request. Ignored when the preview cache is disabled.
	PreviewCacheFailureTtlSeconds int `` /* 130-byte string literal not displayed */

	// Maximum number of catalog spec projections held in memory per process (least
	// recently used evicted first). Zero disables the cache.
	PreviewCacheMaxEntries int `json:"preview_cache_max_entries" yaml:"preview_cache_max_entries" mapstructure:"preview_cache_max_entries"`

	// How long a catalog preview's upstream spec projection is reused before
	// refetching. Zero disables the cache. The cache is per process: `POST
	// /catalog:refresh` clears it only on the process that serves the refresh, so
	// other workers or replicas can serve the previous projection until this TTL
	// expires.
	PreviewCacheTtlSeconds int `json:"preview_cache_ttl_seconds" yaml:"preview_cache_ttl_seconds" mapstructure:"preview_cache_ttl_seconds"`

	// Seconds between update-check sweeps, which conditionally re-fetch the spec URLs
	// of upstream-tracked APIs and emit “catalog.update_available“ when an upstream
	// spec changed; each API is probed at most once per interval. “POST
	// /catalog:refresh“ also triggers a sweep. 0 disables the check entirely (no
	// events, no egress).
	UpdateCheckIntervalSeconds int `json:"update_check_interval_seconds" yaml:"update_check_interval_seconds" mapstructure:"update_check_interval_seconds"`

	// Wall-clock budget (seconds) for one update-check sweep; it stops when exceeded.
	UpdateSweepDeadlineSeconds int `json:"update_sweep_deadline_seconds" yaml:"update_sweep_deadline_seconds" mapstructure:"update_sweep_deadline_seconds"`

	// Random extra delay added to each sweep interval, as a fraction of it (next
	// sweep after “interval * (1 + uniform(0, ratio))“), so replicas started
	// together drift apart. 0 disables jitter.
	UpdateSweepJitterRatio float64 `json:"update_sweep_jitter_ratio" yaml:"update_sweep_jitter_ratio" mapstructure:"update_sweep_jitter_ratio"`

	// Maximum concurrent spec probes in one update-check sweep. Keep it below the
	// registry database pool size so sweeps never starve request traffic.
	UpdateSweepMaxConcurrency int `json:"update_sweep_max_concurrency" yaml:"update_sweep_max_concurrency" mapstructure:"update_sweep_max_concurrency"`
}

Public API catalog settings (manifest source + staleness).

func (*CatalogConfig) UnmarshalJSON

func (j *CatalogConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CircuitBreakerConfig

type CircuitBreakerConfig struct {
	// Seconds an open circuit fast-fails calls before the upstream is tried again.
	CooldownS int `json:"cooldown_s" yaml:"cooldown_s" mapstructure:"cooldown_s"`

	// Track upstream failures per host and fast-fail calls to a host whose circuit is
	// open (5xx responses and transport errors count as failures).
	Enabled bool `json:"enabled" yaml:"enabled" mapstructure:"enabled"`

	// “blocking“ fast-fails calls while the circuit is open; “observation“ still
	// calls the upstream and only counts “circuit_would_block_total“, to validate
	// thresholds before blocking.
	EnforcementMode CircuitBreakerConfigEnforcementMode `json:"enforcement_mode" yaml:"enforcement_mode" mapstructure:"enforcement_mode"`

	// Failure fraction within “window_s“ at which the circuit opens.
	FailureRatio float64 `json:"failure_ratio" yaml:"failure_ratio" mapstructure:"failure_ratio"`

	// Minimum calls in the window before the failure ratio can open the circuit, so a
	// single early failure does not trip it.
	MinCalls int `json:"min_calls" yaml:"min_calls" mapstructure:"min_calls"`

	// Rolling window (seconds) over which failures and totals are counted.
	WindowS int `json:"window_s" yaml:"window_s" mapstructure:"window_s"`
}

Per-upstream circuit breaker.

Counts failures/totals per rolling “window_s“ on the shared-state backend's atomic counters; when the failure ratio crosses “failure_ratio“ the circuit opens (a “set_if_absent“ latch) and fast-fails for “cooldown_s“. “observation“ mode tracks + emits “would_block“ but still calls the upstream (safe-rollout dry run).

func (*CircuitBreakerConfig) UnmarshalJSON

func (j *CircuitBreakerConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CircuitBreakerConfigEnforcementMode

type CircuitBreakerConfigEnforcementMode string
const CircuitBreakerConfigEnforcementModeBlocking CircuitBreakerConfigEnforcementMode = "blocking"
const CircuitBreakerConfigEnforcementModeObservation CircuitBreakerConfigEnforcementMode = "observation"

func (*CircuitBreakerConfigEnforcementMode) UnmarshalJSON

func (j *CircuitBreakerConfigEnforcementMode) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ConfigSchemaJson

type ConfigSchemaJson struct {
	// Admin corresponds to the JSON schema field "admin".
	Admin *AdminConfig `json:"admin,omitempty,omitzero" yaml:"admin,omitempty" mapstructure:"admin,omitempty"`

	// Surfaces this process serves: any of “registry“, “admin“, “control“,
	// “auth“, or “broker“ alone (the broker cannot be combined with other
	// surfaces). Also decides which secrets production requires.
	Apps []string `json:"apps,omitempty,omitzero" yaml:"apps,omitempty" mapstructure:"apps,omitempty"`

	// Auth corresponds to the JSON schema field "auth".
	Auth *AuthConfig `json:"auth,omitempty,omitzero" yaml:"auth,omitempty" mapstructure:"auth,omitempty"`

	// Broker corresponds to the JSON schema field "broker".
	Broker *BrokerConfig `json:"broker,omitempty,omitzero" yaml:"broker,omitempty" mapstructure:"broker,omitempty"`

	// Catalog corresponds to the JSON schema field "catalog".
	Catalog *CatalogConfig `json:"catalog,omitempty,omitzero" yaml:"catalog,omitempty" mapstructure:"catalog,omitempty"`

	// Control corresponds to the JSON schema field "control".
	Control *ControlSurfaceConfig `json:"control,omitempty,omitzero" yaml:"control,omitempty" mapstructure:"control,omitempty"`

	// Credentials corresponds to the JSON schema field "credentials".
	Credentials *CredentialsConfig `json:"credentials,omitempty,omitzero" yaml:"credentials,omitempty" mapstructure:"credentials,omitempty"`

	// Databases corresponds to the JSON schema field "databases".
	Databases DatabasesConfig `json:"databases" yaml:"databases" mapstructure:"databases"`

	// Entitlement corresponds to the JSON schema field "entitlement".
	Entitlement *EntitlementConfig `json:"entitlement,omitempty,omitzero" yaml:"entitlement,omitempty" mapstructure:"entitlement,omitempty"`

	// HeldExecutions corresponds to the JSON schema field "held_executions".
	HeldExecutions *HeldExecutionsConfig `json:"held_executions,omitempty,omitzero" yaml:"held_executions,omitempty" mapstructure:"held_executions,omitempty"`

	// Ingest corresponds to the JSON schema field "ingest".
	Ingest *IngestConfig `json:"ingest,omitempty,omitzero" yaml:"ingest,omitempty" mapstructure:"ingest,omitempty"`

	// Logging corresponds to the JSON schema field "logging".
	Logging *LoggingConfig `json:"logging,omitempty,omitzero" yaml:"logging,omitempty" mapstructure:"logging,omitempty"`

	// Observability corresponds to the JSON schema field "observability".
	Observability *ObservabilityConfig `json:"observability,omitempty,omitzero" yaml:"observability,omitempty" mapstructure:"observability,omitempty"`

	// ReleaseCheck corresponds to the JSON schema field "release_check".
	ReleaseCheck *ReleaseCheckConfig `json:"release_check,omitempty,omitzero" yaml:"release_check,omitempty" mapstructure:"release_check,omitempty"`

	// Runtime corresponds to the JSON schema field "runtime".
	Runtime *RuntimeConfig `json:"runtime,omitempty,omitzero" yaml:"runtime,omitempty" mapstructure:"runtime,omitempty"`

	// Search corresponds to the JSON schema field "search".
	Search *SearchConfig `json:"search,omitempty,omitzero" yaml:"search,omitempty" mapstructure:"search,omitempty"`

	// Security corresponds to the JSON schema field "security".
	Security *SecurityConfig `json:"security,omitempty,omitzero" yaml:"security,omitempty" mapstructure:"security,omitempty"`

	// Server corresponds to the JSON schema field "server".
	Server *ServerConfig `json:"server,omitempty,omitzero" yaml:"server,omitempty" mapstructure:"server,omitempty"`

	// Services corresponds to the JSON schema field "services".
	Services *ServicesConfig `json:"services,omitempty,omitzero" yaml:"services,omitempty" mapstructure:"services,omitempty"`

	// The process's shared-state backend, built once and shared by every surface the
	// process serves. The deprecated broker.resilience.backend section (and its
	// JENTIC__BROKER__RESILIENCE__BACKEND__* env vars) is still read into it for one
	// release.
	State *StateBackendConfig `json:"state,omitempty,omitzero" yaml:"state,omitempty" mapstructure:"state,omitempty"`

	// Telemetry corresponds to the JSON schema field "telemetry".
	Telemetry *TelemetryConfig `json:"telemetry,omitempty,omitzero" yaml:"telemetry,omitempty" mapstructure:"telemetry,omitempty"`

	// Vendors corresponds to the JSON schema field "vendors".
	Vendors *VendorRegistryConfig `json:"vendors,omitempty,omitzero" yaml:"vendors,omitempty" mapstructure:"vendors,omitempty"`

	// Worker corresponds to the JSON schema field "worker".
	Worker *WorkerConfig `json:"worker,omitempty,omitzero" yaml:"worker,omitempty" mapstructure:"worker,omitempty"`
}

Top-level application configuration.

func (*ConfigSchemaJson) UnmarshalJSON

func (j *ConfigSchemaJson) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ConnectConfig

type ConnectConfig struct {
	// Key that signs the OAuth connect “state“ parameter. Required in production
	// (empty or placeholder values are rejected at startup); in development an
	// ephemeral per-process value is generated when empty.
	StateSecret string `json:"state_secret,omitempty,omitzero" yaml:"state_secret,omitempty" mapstructure:"state_secret,omitempty"`

	// Seconds a signed connect “state“ (and its browser-binding cookie) stays
	// valid, i.e. how long a user has to finish the provider's consent screen.
	StateTtlSeconds int `json:"state_ttl_seconds" yaml:"state_ttl_seconds" mapstructure:"state_ttl_seconds"`
}

Configuration for the OAuth connect flow.

func (*ConnectConfig) UnmarshalJSON

func (j *ConnectConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ControlConnectConfig added in v0.42.0

type ControlConnectConfig struct {
	// Allow connect sessions that target a registry API (rather than a
	// vendor-registry key), where a human enters the credential, or brings an OAuth
	// app, when approving them in the dashboard. On by default; while off, `:connect`
	// refuses API targets with `manual_flows_disabled`.
	ManualFlowsEnabled bool `json:"manual_flows_enabled" yaml:"manual_flows_enabled" mapstructure:"manual_flows_enabled"`

	// Hours an API-target connect session (a human-entered credential, or an OAuth
	// API waiting for an app) stays open before it expires. Vendor OAuth sessions
	// keep their fixed 30-minute lifetime.
	ManualFlowsTtlHours int `json:"manual_flows_ttl_hours" yaml:"manual_flows_ttl_hours" mapstructure:"manual_flows_ttl_hours"`

	// Most open connect sessions one agent may hold at once while
	// `manual_flows_enabled` is on; one more `:connect` gets 429
	// `too_many_open_sessions`.
	MaxOpenSessionsPerAgent int `json:"max_open_sessions_per_agent" yaml:"max_open_sessions_per_agent" mapstructure:"max_open_sessions_per_agent"`

	// Most open connect sessions across one user and the agents they own while
	// `manual_flows_enabled` is on; one more `:connect` gets 429
	// `too_many_open_sessions`.
	MaxOpenSessionsPerOwner int `json:"max_open_sessions_per_owner" yaml:"max_open_sessions_per_owner" mapstructure:"max_open_sessions_per_owner"`

	// Hours after a human rejects an agent's connect or access-change request during
	// which the agent's repeat ask for the same target (or binding) gets 429
	// `recently_rejected`. Off (0) by default: an agent may ask again at once.
	RejectionCooldownHours int `` /* 142-byte string literal not displayed */
}

Agent connect-session settings on the control surface.

func (*ControlConnectConfig) UnmarshalJSON added in v0.42.0

func (j *ControlConnectConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ControlEgressConfig added in v0.44.0

type ControlEgressConfig struct {
	// Domain suffixes (e.g. “[".corp.internal"]“) whose resolved private IP is
	// permitted for these calls; unset inherits
	// `broker.egress.allowed_internal_domains`. The resolved IP must still fall in an
	// allowed subnet. Accepts a YAML list or a comma-separated string.
	AllowedInternalDomains *ControlEgressConfigAllowedInternalDomains `` /* 142-byte string literal not displayed */

	// CIDRs exempted from the private-IP block for these calls (e.g.
	// “["10.50.0.0/16"]“); unset inherits `broker.egress.allowed_private_subnets`,
	// and `[]` blocks every private range for these calls even when the broker allows
	// one. The cloud-metadata and platform-credential IPs are never exempted. Accepts
	// a YAML list or a comma-separated string.
	AllowedPrivateSubnets *ControlEgressConfigAllowedPrivateSubnets `` /* 139-byte string literal not displayed */
}

Private-network allowlist for the platform's OAuth and credential calls.

Holds only the two allowlist keys. A key left unset takes its value from the matching “broker.egress“ key. These calls always pin DNS, so there is no “dns_pinning_enabled“ key here, and unknown keys are rejected.

type ControlEgressConfigAllowedInternalDomains added in v0.44.0

type ControlEgressConfigAllowedInternalDomains []string

Domain suffixes (e.g. “[".corp.internal"]“) whose resolved private IP is permitted for these calls; unset inherits `broker.egress.allowed_internal_domains`. The resolved IP must still fall in an allowed subnet. Accepts a YAML list or a comma-separated string.

type ControlEgressConfigAllowedInternalDomains_0 added in v0.44.0

type ControlEgressConfigAllowedInternalDomains_0 []string

type ControlEgressConfigAllowedPrivateSubnets added in v0.44.0

type ControlEgressConfigAllowedPrivateSubnets []string

CIDRs exempted from the private-IP block for these calls (e.g. “["10.50.0.0/16"]“); unset inherits `broker.egress.allowed_private_subnets`, and `[]` blocks every private range for these calls even when the broker allows one. The cloud-metadata and platform-credential IPs are never exempted. Accepts a YAML list or a comma-separated string.

type ControlEgressConfigAllowedPrivateSubnets_0 added in v0.44.0

type ControlEgressConfigAllowedPrivateSubnets_0 []string

type ControlSurfaceConfig

type ControlSurfaceConfig struct {
	// Agent connect-session settings.
	Connect *ControlConnectConfig `json:"connect,omitempty,omitzero" yaml:"connect,omitempty" mapstructure:"connect,omitempty"`

	// Private-network allowlist for the platform's OAuth and credential calls: OAuth2
	// credential and OAuth app registration URL checks, own-client endpoints
	// confirmed on a connect session, token exchange and refresh, device
	// authorization, and the vendor identity probe. Each key left unset takes its
	// value from `broker.egress`; set a key (e.g. `allowed_private_subnets: []`) to
	// override it for these calls alone. These calls always pin DNS. The process
	// making the call reads it, and the broker surface makes token refresh calls, so
	// with one process per surface set it identically on the control and broker
	// surfaces.
	Egress *ControlEgressConfig `json:"egress,omitempty,omitzero" yaml:"egress,omitempty" mapstructure:"egress,omitempty"`
}

Control surface configuration.

“egress“ is the allowlist for the platform's outbound OAuth and credential calls. Each “control.egress“ key left unset takes its value from the matching “broker.egress“ key. The policy is read by whichever process makes the call: the control surface for credential and OAuth app writes, the connect-session confirm, code exchange, device authorization and the identity probe, and the broker surface for the token refresh it runs before injecting a credential. With one process per surface, set “control.egress“ (and the “broker.egress“ keys it inherits) identically on both.

Unknown subkeys of “control:“ are ignored, so a section written for another release keeps validating; “control.egress“ rejects unknown keys so a mistyped allowlist key fails at startup instead of silently allowing less.

type CredentialsConfig

type CredentialsConfig struct {
	// Connect corresponds to the JSON schema field "connect".
	Connect *ConnectConfig `json:"connect,omitempty,omitzero" yaml:"connect,omitempty" mapstructure:"connect,omitempty"`

	// Encryption corresponds to the JSON schema field "encryption".
	Encryption *EncryptionConfig `json:"encryption,omitempty,omitzero" yaml:"encryption,omitempty" mapstructure:"encryption,omitempty"`

	// Credential providers keyed by provider id, which credentials name in their
	// “provider“ field; “kind“ selects the provider type. The built-in “static“
	// and “device_authorization“ providers are always present, and the connect flow
	// uses the “direct_oauth2“ entry.
	Providers CredentialsConfigProviders `json:"providers,omitempty,omitzero" yaml:"providers,omitempty" mapstructure:"providers,omitempty"`
}

Credentials subsystem configuration.

type CredentialsConfigProviders

type CredentialsConfigProviders map[string]interface{}

Credential providers keyed by provider id, which credentials name in their “provider“ field; “kind“ selects the provider type. The built-in “static“ and “device_authorization“ providers are always present, and the connect flow uses the “direct_oauth2“ entry.

type DatabaseConfig

type DatabaseConfig struct {
	// Database engine for this connection: “postgres“ uses the server connection
	// fields; “sqlite“ uses “path“ and ignores them.
	Backend DatabaseConfigBackend `json:"backend" yaml:"backend" mapstructure:"backend"`

	// SQLite: per-connection wait for a held write lock, in milliseconds, before
	// failing with “database is locked“.
	BusyTimeoutMs int `json:"busy_timeout_ms" yaml:"busy_timeout_ms" mapstructure:"busy_timeout_ms"`

	// PostgreSQL server hostname.
	Host string `json:"host" yaml:"host" mapstructure:"host"`

	// SQLite journal mode (persistent per database file). “WAL“ lets a writer and
	// readers proceed concurrently instead of blocking each other.
	JournalMode string `json:"journal_mode" yaml:"journal_mode" mapstructure:"journal_mode"`

	// PostgreSQL database name. Required for the “postgres“ backend.
	Name string `json:"name,omitempty,omitzero" yaml:"name,omitempty" mapstructure:"name,omitempty"`

	// Password for the PostgreSQL role.
	Password string `json:"password,omitempty,omitzero" yaml:"password,omitempty" mapstructure:"password,omitempty"`

	// SQLite: filesystem path to the database file (“:memory:“ for in-memory).
	// Required for the “sqlite“ backend.
	Path interface{} `json:"path,omitempty,omitzero" yaml:"path,omitempty" mapstructure:"path,omitempty"`

	// Maximum connections in the PostgreSQL connection pool (ignored for SQLite).
	PoolMax int `json:"pool_max" yaml:"pool_max" mapstructure:"pool_max"`

	// PostgreSQL: test pooled connections on checkout and transparently replace a
	// dead one. By default the wire ping (three round trips on asyncpg: “BEGIN“,
	// “;“, “ROLLBACK“) runs only when the connection has sat idle in the pool for
	// at least “pool_pre_ping_idle_s“ seconds; active checkouts within that window
	// skip the wire ping unless the driver connection is already closed. With
	// “false“, “pool_recycle_s“ and TCP keepalive do not cover a Postgres restart
	// or failover, a pooler/proxy restart, or a terminated backend: after such an
	// event the first request on each pool per process can fail with an HTTP 503
	// (work run through the retrying transaction helper is re-run on a fresh
	// connection instead). Only disable it where those events are rare and that error
	// is acceptable. Ignored for SQLite.
	PoolPrePing bool `json:"pool_pre_ping" yaml:"pool_pre_ping" mapstructure:"pool_pre_ping"`

	// PostgreSQL: seconds a connection must sit idle in the pool before checkout runs
	// the “pool_pre_ping“ wire check. Active checkouts returning within this window
	// skip the wire ping unless the driver connection is already closed. “0“ pings
	// on every checkout. Only applies when “pool_pre_ping“ is “true“. Ignored for
	// SQLite.
	PoolPrePingIdleS float64 `json:"pool_pre_ping_idle_s" yaml:"pool_pre_ping_idle_s" mapstructure:"pool_pre_ping_idle_s"`

	// PostgreSQL: replace a pooled connection once it is this many seconds old, on
	// its next checkout, so a connection silently dropped by a middlebox or left
	// behind by a server restart is retired before use. Keep it below any server,
	// proxy, or NAT idle timeout on the path. “0“ disables recycling. Ignored for
	// SQLite.
	PoolRecycleS int `json:"pool_recycle_s" yaml:"pool_recycle_s" mapstructure:"pool_recycle_s"`

	// PostgreSQL server port.
	Port int `json:"port" yaml:"port" mapstructure:"port"`

	// PostgreSQL schema for this connection: created if missing by the migration
	// runner (“CREATE SCHEMA IF NOT EXISTS“) and put first on “search_path“, so
	// several connections can share one database.
	SchemaName string `json:"schema_name" yaml:"schema_name" mapstructure:"schema_name"`

	// PostgreSQL: enable TCP keepalive on each pooled connection's client socket so a
	// peer that vanished while the connection sat idle is detected in about
	// “tcp_keepalive_idle_s + tcp_keepalive_count * tcp_keepalive_interval_s“
	// seconds instead of the OS default of hours. “false“ leaves the socket at the
	// OS defaults. Ignored for SQLite.
	TcpKeepalive bool `json:"tcp_keepalive" yaml:"tcp_keepalive" mapstructure:"tcp_keepalive"`

	// PostgreSQL: unanswered TCP keepalive probes before the connection is declared
	// dead (“TCP_KEEPCNT“). Only applies when “tcp_keepalive“ is “true“.
	// Ignored for SQLite.
	TcpKeepaliveCount int `json:"tcp_keepalive_count" yaml:"tcp_keepalive_count" mapstructure:"tcp_keepalive_count"`

	// PostgreSQL: seconds a connection may sit idle before the first TCP keepalive
	// probe is sent (“TCP_KEEPIDLE“; “TCP_KEEPALIVE“ on macOS). Only applies when
	// “tcp_keepalive“ is “true“. Ignored for SQLite.
	TcpKeepaliveIdleS int `json:"tcp_keepalive_idle_s" yaml:"tcp_keepalive_idle_s" mapstructure:"tcp_keepalive_idle_s"`

	// PostgreSQL: seconds between unanswered TCP keepalive probes
	// (“TCP_KEEPINTVL“). Only applies when “tcp_keepalive“ is “true“. Ignored
	// for SQLite.
	TcpKeepaliveIntervalS int `json:"tcp_keepalive_interval_s" yaml:"tcp_keepalive_interval_s" mapstructure:"tcp_keepalive_interval_s"`

	// PostgreSQL role to connect as.
	User string `json:"user" yaml:"user" mapstructure:"user"`
}

Connection parameters for a single database.

Supports two backends:

  • “postgres“ (default): uses host/port/user/password/name + schema_name.
  • “sqlite“: uses “path“ (a single-file database). The Postgres connection fields are ignored.

func (*DatabaseConfig) UnmarshalJSON

func (j *DatabaseConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type DatabaseConfigBackend

type DatabaseConfigBackend string
const DatabaseConfigBackendPostgres DatabaseConfigBackend = "postgres"
const DatabaseConfigBackendSqlite DatabaseConfigBackend = "sqlite"

func (*DatabaseConfigBackend) UnmarshalJSON

func (j *DatabaseConfigBackend) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type DatabaseConfigPath_0

type DatabaseConfigPath_0 *string

type DatabasesConfig

type DatabasesConfig struct {
	// Admin corresponds to the JSON schema field "admin".
	Admin DatabaseConfig `json:"admin" yaml:"admin" mapstructure:"admin"`

	// Control corresponds to the JSON schema field "control".
	Control DatabaseConfig `json:"control" yaml:"control" mapstructure:"control"`

	// Registry corresponds to the JSON schema field "registry".
	Registry DatabaseConfig `json:"registry" yaml:"registry" mapstructure:"registry"`
}

Named database connections.

func (*DatabasesConfig) UnmarshalJSON

func (j *DatabasesConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type DirectOAuth2ProviderConfig

type DirectOAuth2ProviderConfig struct {
	// Extra query parameters appended to every authorize URL. The defaults force the
	// consent screen and ask Google for a refresh token; for Microsoft, Okta or Auth0
	// add the “offline_access“ scope to “default_scopes“ instead. Keys that
	// collide with the OAuth2 parameters the provider builds (“response_type“,
	// “client_id“, “redirect_uri“, “state“, “scope“) override them and break
	// the connect flow.
	AuthorizeExtraParams DirectOAuth2ProviderConfigAuthorizeExtraParams `` /* 136-byte string literal not displayed */

	// Scopes requested on the authorize URL when a connect request names none.
	DefaultScopes []string `json:"default_scopes,omitempty,omitzero" yaml:"default_scopes,omitempty" mapstructure:"default_scopes,omitempty"`

	// How many seconds before an access token's real expiry the broker refreshes it.
	// Applied at comparison time; the stored expiry is never shifted.
	ExpirySkewSeconds int `json:"expiry_skew_seconds" yaml:"expiry_skew_seconds" mapstructure:"expiry_skew_seconds"`

	// Kind corresponds to the JSON schema field "kind".
	Kind string `json:"kind" yaml:"kind" mapstructure:"kind"`

	// OAuth callback URL registered with the IdP. Unset, it is derived per request as
	// “{server.public_base_url or request origin}/credentials/oauth/callback“; set
	// it only when the public origin differs from “server.public_base_url“ (e.g. a
	// proxy the app cannot see). Matched byte-for-byte by the IdP.
	RedirectUri interface{} `json:"redirect_uri,omitempty,omitzero" yaml:"redirect_uri,omitempty" mapstructure:"redirect_uri,omitempty"`
}

Configuration for a direct OAuth2 provider.

func (*DirectOAuth2ProviderConfig) UnmarshalJSON

func (j *DirectOAuth2ProviderConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type DirectOAuth2ProviderConfigAuthorizeExtraParams

type DirectOAuth2ProviderConfigAuthorizeExtraParams map[string]string

Extra query parameters appended to every authorize URL. The defaults force the consent screen and ask Google for a refresh token; for Microsoft, Okta or Auth0 add the “offline_access“ scope to “default_scopes“ instead. Keys that collide with the OAuth2 parameters the provider builds (“response_type“, “client_id“, “redirect_uri“, “state“, “scope“) override them and break the connect flow.

type DirectOAuth2ProviderConfigRedirectUri_0 added in v0.40.0

type DirectOAuth2ProviderConfigRedirectUri_0 *string

type EgressConfig

type EgressConfig struct {
	// Domain suffixes (e.g. “[".svc.cluster.local"]“) whose resolved private IP is
	// permitted. The resolved IP must still fall in an allowed subnet. Accepts a YAML
	// list or a comma-separated string.
	AllowedInternalDomains []string `` /* 142-byte string literal not displayed */

	// CIDRs exempted from the private-IP egress block (e.g. “["10.50.0.0/16"]“).
	// The cloud-metadata and platform-credential IPs (e.g. 169.254.169.254,
	// 169.254.170.2, fd00:ec2::254, 100.100.100.200) are never exempted, even when a
	// listed range covers them. Accepts a YAML list or a comma-separated string.
	AllowedPrivateSubnets []string `` /* 139-byte string literal not displayed */

	// Pin the outbound connection to the IP validated at connect time, closing the
	// DNS-rebinding TOCTOU between pre-request validation and the runner's own
	// resolution. Disable only to debug egress issues.
	DnsPinningEnabled bool `json:"dns_pinning_enabled" yaml:"dns_pinning_enabled" mapstructure:"dns_pinning_enabled"`
}

Outbound SSRF/egress policy for upstream calls.

Defaults are **strict** (both lists empty): every private range and the cloud-metadata host are blocked. The two allowlists exist because the broker is frequently installed *inside* a corporate network to bridge to internal/legacy APIs, where the default block is a false positive. Both are opt-in, auditable operator decisions; the cloud-metadata IP is a **hard, non-overridable** deny so a credential-stealing SSRF can never be allowlisted by accident.

func (*EgressConfig) UnmarshalJSON

func (j *EgressConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type EncryptionConfig

type EncryptionConfig struct {
	// Id of the key that encrypts new values; must match an entry in “entries“.
	// Older keys stay usable for decryption, so rotate by adding a key and switching
	// this id.
	ActiveId string `json:"active_id" yaml:"active_id" mapstructure:"active_id"`

	// AES-256-GCM keys (32 bytes, base64) for credentials at rest. Every entry can
	// decrypt; ids must be unique. Empty still boots, but credential writes and
	// approval-gated executions then fail. Never remove a key that still has data
	// encrypted under it.
	Entries []EncryptionKey `json:"entries,omitempty,omitzero" yaml:"entries,omitempty" mapstructure:"entries,omitempty"`
}

Envelope-encryption keyset configuration.

func (*EncryptionConfig) UnmarshalJSON

func (j *EncryptionConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type EncryptionKey

type EncryptionKey struct {
	// Key id (“[a-zA-Z0-9_-]+“), stored as the prefix of every value encrypted with
	// this key so it can be decrypted after rotation.
	Id string `json:"id" yaml:"id" mapstructure:"id"`

	// Base64-encoded key material, inline in the config.
	Material interface{} `json:"material,omitempty,omitzero" yaml:"material,omitempty" mapstructure:"material,omitempty"`

	// Name of an environment variable holding the base64-encoded key material.
	MaterialEnv interface{} `json:"material_env,omitempty,omitzero" yaml:"material_env,omitempty" mapstructure:"material_env,omitempty"`

	// Path to a regular file holding the base64-encoded key material (docker/k8s
	// secret mount, systemd LoadCredential path).
	MaterialFile interface{} `json:"material_file,omitempty,omitzero" yaml:"material_file,omitempty" mapstructure:"material_file,omitempty"`
}

A single named encryption key.

Key material comes from exactly ONE source:

  • “material“ — inline in the config (local dev / vault-templated files),
  • “material_env“ — the name of an environment variable holding the key,
  • “material_file“ — a regular file to read the key from (docker/k8s secret mounts, systemd “LoadCredential“ paths). Pipes and “/dev/fd“ sources are rejected: config may be validated more than once per process, and a source that cannot be re-read would hang or fail the second load.

“material_env“/“material_file“ are resolved once, at config load, into “material“ — consumers keep reading “resolved_material“ and never learn where the bytes came from (the source field is cleared after resolution, so a resolved key re-validates cleanly and never re-reads the environment or the file). Resolution failures (unset variable, unreadable file, empty value) fail validation loudly rather than booting a server that cannot decrypt its own credentials.

func (*EncryptionKey) UnmarshalJSON

func (j *EncryptionKey) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type EncryptionKeyMaterialEnv_0 added in v0.40.0

type EncryptionKeyMaterialEnv_0 *string

type EncryptionKeyMaterialFile_0 added in v0.40.0

type EncryptionKeyMaterialFile_0 *string

type EncryptionKeyMaterial_0 added in v0.40.0

type EncryptionKeyMaterial_0 *string

type EntitlementConfig

type EntitlementConfig struct {
	// Gate the HTTP surface on an active AWS Marketplace subscription (503 except
	// health checks when AWS reports the deployment is not entitled). Off makes no
	// AWS calls.
	Enabled bool `json:"enabled,omitempty,omitzero" yaml:"enabled,omitempty" mapstructure:"enabled,omitempty"`

	// Endpoint corresponds to the JSON schema field "endpoint".
	Endpoint interface{} `json:"endpoint,omitempty,omitzero" yaml:"endpoint,omitempty" mapstructure:"endpoint,omitempty"`

	// How long (seconds) the last definitive verdict holds while the AWS API is
	// unreachable or erroring, before the gate fails closed. An explicit "not
	// entitled" answer locks out immediately.
	GracePeriodSeconds int `json:"grace_period_seconds" yaml:"grace_period_seconds" mapstructure:"grace_period_seconds"`

	// Contract pricing only: entitlement dimension keys checked out from the buyer's
	// license; every one must be granted. Accepts a YAML list or a comma-separated
	// string.
	LicenseDimensions []string `json:"license_dimensions,omitempty,omitzero" yaml:"license_dimensions,omitempty" mapstructure:"license_dimensions,omitempty"`

	// Contract pricing only: the Marketplace product ID from the portal
	// (“CheckoutLicense“ “ProductSKU“) — not the product code; the portal issues
	// both. Required when “pricing_model“ is “contract“.
	LicenseSku interface{} `json:"license_sku,omitempty,omitzero" yaml:"license_sku,omitempty" mapstructure:"license_sku,omitempty"`

	// Which Marketplace API the check calls: “contract“ uses License Manager
	// “CheckoutLicense“ (requires “license_sku“); “usage“ uses Metering Service
	// “RegisterUsage“ (hourly/usage pricing).
	PricingModel EntitlementConfigPricingModel `json:"pricing_model" yaml:"pricing_model" mapstructure:"pricing_model"`

	// Marketplace product code issued by the AWS Marketplace portal for the container
	// product. Required when “enabled“.
	ProductCode interface{} `json:"product_code,omitempty,omitzero" yaml:"product_code,omitempty" mapstructure:"product_code,omitempty"`

	// Seconds between entitlement re-checks after the one at startup.
	RefreshIntervalSeconds int `json:"refresh_interval_seconds" yaml:"refresh_interval_seconds" mapstructure:"refresh_interval_seconds"`

	// AWS region the License Manager / Metering Service calls go to.
	Region string `json:"region" yaml:"region" mapstructure:"region"`
}

AWS Marketplace license gate for the Marketplace-listed deployment.

Powers the entitlement checker (“integrations/aws_marketplace“): on startup, and every “refresh_interval_seconds“ after, the process asks AWS whether this deployment's Marketplace subscription is still active, and locks the HTTP surface (503, health excepted) when it definitively is not. Defaults to **OFF**: a non-Marketplace install that omits this block wires nothing and never makes an AWS call.

Failure posture: an *unreachable* or *erroring* AWS API is never grounds for lockout by itself — the last definitive verdict holds for “grace_period_seconds“ before the gate fails closed. Only an explicit "not entitled" answer from AWS locks out immediately.

func (*EntitlementConfig) UnmarshalJSON

func (j *EntitlementConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type EntitlementConfigEndpoint_0

type EntitlementConfigEndpoint_0 *string

type EntitlementConfigLicenseSku_0

type EntitlementConfigLicenseSku_0 *string

type EntitlementConfigPricingModel

type EntitlementConfigPricingModel string
const EntitlementConfigPricingModelContract EntitlementConfigPricingModel = "contract"
const EntitlementConfigPricingModelUsage EntitlementConfigPricingModel = "usage"

func (*EntitlementConfigPricingModel) UnmarshalJSON

func (j *EntitlementConfigPricingModel) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type EntitlementConfigProductCode_0

type EntitlementConfigProductCode_0 *string

type HeldExecutionsConfig added in v0.44.0

type HeldExecutionsConfig struct {
	// Maximum pending approvals per agent. An execute call that would file another
	// hold beyond this is denied with the “approval_pending_limit_reached“ problem
	// type.
	MaxPendingPerAgent int `json:"max_pending_per_agent" yaml:"max_pending_per_agent" mapstructure:"max_pending_per_agent"`

	// Seconds the result of an approved execution stays readable via “GET
	// /jobs/{id}/result“ before the result sweep removes it. Defaults to 24 hours.
	ResultRetentionSeconds int `json:"result_retention_seconds" yaml:"result_retention_seconds" mapstructure:"result_retention_seconds"`

	// Seconds a pending approval lives before the expiry sweep marks it “expired“
	// and fails its held job with a permission-denied result. Defaults to 24 hours.
	TtlSeconds int `json:"ttl_seconds" yaml:"ttl_seconds" mapstructure:"ttl_seconds"`
}

Require-approval holds: held execution jobs awaiting a human reviewer.

An execute call matching a permission rule with “effect="require-approval"“ is enqueued as a “held“ job with a “pending“ approval; a reviewer (the agent's owner or an “org:admin“) approves or denies it, or it expires.

func (*HeldExecutionsConfig) UnmarshalJSON added in v0.44.0

func (j *HeldExecutionsConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type IdempotencyConfig

type IdempotencyConfig struct {
	// Honour the “Idempotency-Key“ request header on broker executions: a repeat of
	// a completed key replays the stored response instead of calling the upstream
	// again. Off ignores the header.
	Enabled bool `json:"enabled" yaml:"enabled" mapstructure:"enabled"`

	// Largest response body (bytes) stored for byte-for-byte replay. Larger responses
	// are recorded without their body: a replay still prevents the duplicate call but
	// does not return the body.
	MaxResponseBytes int `json:"max_response_bytes" yaml:"max_response_bytes" mapstructure:"max_response_bytes"`

	// Lifetime (seconds) of the in-flight claim on an “Idempotency-Key“, so a
	// broker killed mid-request frees the key within seconds. Size it just above
	// “broker.resilience.request_deadline_s“.
	PendingTtlS float64 `json:"pending_ttl_s" yaml:"pending_ttl_s" mapstructure:"pending_ttl_s"`

	// Replay window of a completed Idempotency-Key record, in seconds. Unset, it is
	// 3600 (1 h) on the memory shared-state backend and 86400 (24 h) on any other
	// backend. On memory, every record is held in process for this long, so the TTL
	// divides the sustained idempotent request rate the idem budget can hold.
	TtlS interface{} `json:"ttl_s,omitempty,omitzero" yaml:"ttl_s,omitempty" mapstructure:"ttl_s,omitempty"`
}

“Idempotency-Key“ replay store.

Sync “FULL“-mode replay over the shared-state “AtomicStore“ (the “state:“ backend). Two TTLs: a *short* “pending_ttl_s“ claim (sized to the request deadline + buffer, so a crash mid-flight frees the key in seconds rather than the full replay window) promoted to the *long* “ttl_s“ only once the response is stored. Responses over “max_response_bytes“ are recorded without their body (replay still prevents a duplicate side-effect; only byte-for-byte body replay is dropped).

Compliance modes (“metadata_only“ / kill-switch), “require_for_mutations“, async same-“job_id“ replay, and at-rest encryption are future work.

func (*IdempotencyConfig) UnmarshalJSON

func (j *IdempotencyConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type IdempotencyConfigTtlS_0 added in v0.44.0

type IdempotencyConfigTtlS_0 *float64

type IdpConfig

type IdpConfig struct {
	// Explicit IdP authorization endpoint URL; overrides the issuer-derived or
	// provider well-known default.
	AuthorizationEndpoint interface{} `` /* 136-byte string literal not displayed */

	// OAuth client ID registered with the identity provider.
	ClientId string `json:"client_id,omitempty,omitzero" yaml:"client_id,omitempty" mapstructure:"client_id,omitempty"`

	// OAuth client secret, sent on the authorization-code exchange.
	ClientSecret string `json:"client_secret,omitempty,omitzero" yaml:"client_secret,omitempty" mapstructure:"client_secret,omitempty"`

	// Enable login via an external OIDC identity provider. When false no IdP adapter
	// is built; /authorize stays routed and (unless auth.local_login.enabled provides
	// the password form) ends in an OAuth server_error redirect because no sign-in
	// path exists.
	Enabled bool `json:"enabled,omitempty,omitzero" yaml:"enabled,omitempty" mapstructure:"enabled,omitempty"`

	// Explicit IdP token (code-exchange) endpoint URL; overrides the issuer-derived
	// or provider well-known default.
	ExchangeEndpoint interface{} `json:"exchange_endpoint,omitempty,omitzero" yaml:"exchange_endpoint,omitempty" mapstructure:"exchange_endpoint,omitempty"`

	// Google “hd“ (hosted-domain) hint. **Not an access control in the OSS build**:
	// the claim is surfaced (see IdpClaims.hosted_domain) but never compared — the
	// default admission policy admits every brand-new email (with zero permissions
	// until an operator grants some). Restricting sign-in to a domain requires
	// configuring it at the IdP or installing a custom admission policy.
	HostedDomain interface{} `json:"hosted_domain,omitempty,omitzero" yaml:"hosted_domain,omitempty" mapstructure:"hosted_domain,omitempty"`

	// OIDC issuer base URL. Default authorization/token/userinfo endpoints are
	// derived from it when the explicit “*_endpoint“ keys are unset.
	Issuer string `json:"issuer,omitempty,omitzero" yaml:"issuer,omitempty" mapstructure:"issuer,omitempty"`

	// Adapter selector: “google“ supplies Google's well-known endpoints and “hd“
	// claim handling; any other value uses the generic standards-compliant OIDC
	// adapter.
	Provider string `json:"provider" yaml:"provider" mapstructure:"provider"`

	// OAuth scopes requested on the IdP authorization redirect.
	Scopes []string `json:"scopes,omitempty,omitzero" yaml:"scopes,omitempty" mapstructure:"scopes,omitempty"`

	// Explicit IdP userinfo endpoint URL; overrides the issuer-derived or provider
	// well-known default.
	UserinfoEndpoint interface{} `json:"userinfo_endpoint,omitempty,omitzero" yaml:"userinfo_endpoint,omitempty" mapstructure:"userinfo_endpoint,omitempty"`
}

External OIDC identity provider configuration.

func (*IdpConfig) UnmarshalJSON

func (j *IdpConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type IdpConfigAuthorizationEndpoint_0

type IdpConfigAuthorizationEndpoint_0 *string

type IdpConfigExchangeEndpoint_0

type IdpConfigExchangeEndpoint_0 *string

type IdpConfigHostedDomain_0

type IdpConfigHostedDomain_0 *string

type IdpConfigUserinfoEndpoint_0

type IdpConfigUserinfoEndpoint_0 *string

type IngestConfig

type IngestConfig struct {
	// Egress corresponds to the JSON schema field "egress".
	Egress *EgressConfig `json:"egress,omitempty,omitzero" yaml:"egress,omitempty" mapstructure:"egress,omitempty"`

	// Timeout (seconds) for fetching a spec or the catalog manifest from a URL.
	FetchTimeoutS float64 `json:"fetch_timeout_s" yaml:"fetch_timeout_s" mapstructure:"fetch_timeout_s"`

	// Cap on the raw `POST /apis` request body (all sources together). Unset means
	// twice `max_spec_bytes`, which covers one maximum-size inline spec with typical
	// JSON-string escaping; raise it for batches of heavily escaped specs (`\uXXXX`
	// or HTML-escaped content). Each inline source's content is separately capped at
	// `max_spec_bytes`.
	MaxImportRequestBytes interface{} `` /* 142-byte string literal not displayed */

	// Maximum HTTP redirects followed when fetching a spec or the catalog manifest;
	// each hop is re-checked against the egress policy.
	MaxRedirects int `json:"max_redirects" yaml:"max_redirects" mapstructure:"max_redirects"`

	// Largest API spec (bytes) accepted from a URL fetch or an inline import source,
	// fetched for a catalog preview, or produced by applying an overlay (default 25
	// MiB).
	MaxSpecBytes int `json:"max_spec_bytes" yaml:"max_spec_bytes" mapstructure:"max_spec_bytes"`
}

Spec ingestion settings (fetch limits, timeouts, egress policy).

func (*IngestConfig) UnmarshalJSON

func (j *IngestConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type IngestConfigMaxImportRequestBytes_0 added in v0.44.0

type IngestConfigMaxImportRequestBytes_0 *int

type JwtVerificationConfig

type JwtVerificationConfig struct {
	// Required “aud“ claim on trusted-issuer JWTs. Unset, tokens must not carry an
	// “aud“ claim at all (any token with one is rejected).
	Audience interface{} `json:"audience,omitempty,omitzero" yaml:"audience,omitempty" mapstructure:"audience,omitempty"`

	// Clock-skew tolerance (seconds) applied to “exp“, “nbf“ and “iat“.
	LeewayS float64 `json:"leeway_s" yaml:"leeway_s" mapstructure:"leeway_s"`

	// Identity providers whose self-contained JWTs the broker accepts, each verified
	// against its published JWKS. When non-empty this takes precedence over
	// “broker.jwt_secret“; empty leaves the JWKS path off.
	TrustedIssuers []TrustedIssuerConfig `json:"trusted_issuers,omitempty,omitzero" yaml:"trusted_issuers,omitempty" mapstructure:"trusted_issuers,omitempty"`
}

Hardened inbound-JWT verification for the broker edge.

When “trusted_issuers“ is non-empty the broker verifies self-contained JWTs against the issuers' published JWKS (asymmetric, key-rotation-aware) and enforces “iss“ (trusted set), “aud“ (“audience“), and “exp“/“nbf“ with “leeway_s“ clock-skew. Empty (the default) leaves the asymmetric path off — the legacy HS256 “broker.jwt_secret“ path (dev/test) still applies.

func (*JwtVerificationConfig) UnmarshalJSON

func (j *JwtVerificationConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type JwtVerificationConfigAudience_0

type JwtVerificationConfigAudience_0 *string

type LocalLoginConfig added in v0.39.0

type LocalLoginConfig struct {
	// Offer a first-party password login form on the /authorize flow. Off by default;
	// when auth.idp.enabled is true the external IdP always wins and the form is
	// never offered.
	Enabled bool `json:"enabled,omitempty,omitzero" yaml:"enabled,omitempty" mapstructure:"enabled,omitempty"`
}

Local-account login form on the “/authorize“ flow (no external IdP).

Default **off**: “/authorize“ behaviour is byte-identical (including the “server_error“ redirect when no IdP is configured) and “GET|POST /login“ answer the framework's plain 404. Enabling it makes the standards-track native-app sign-in flow (RFC 8252: DCR + system browser + loopback redirect + PKCE) work against the first-party password account store, without any client ever handling a password. An external IdP always wins: when “auth.idp.enabled“ is true the login form is never offered (no mixed mode in v1).

func (*LocalLoginConfig) UnmarshalJSON added in v0.39.0

func (j *LocalLoginConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type LoggingConfig

type LoggingConfig struct {
	// Number of rotated log files kept beside the active one; older ones are deleted.
	FileBackupCount int `json:"file_backup_count" yaml:"file_backup_count" mapstructure:"file_backup_count"`

	// Directory for the log file (relative paths resolve against the working
	// directory); created at startup if missing.
	FileDir string `json:"file_dir" yaml:"file_dir" mapstructure:"file_dir"`

	// Also write logs to a size-rotated file. The file is always JSON lines, whatever
	// “runtime.debug“ selects for stdout.
	FileEnabled bool `json:"file_enabled,omitempty,omitzero" yaml:"file_enabled,omitempty" mapstructure:"file_enabled,omitempty"`

	// Size in bytes at which the log file is rotated (default 10 MiB); 0 never
	// rotates.
	FileMaxBytes int `json:"file_max_bytes" yaml:"file_max_bytes" mapstructure:"file_max_bytes"`

	// Log file name inside “file_dir“.
	FileName string `json:"file_name" yaml:"file_name" mapstructure:"file_name"`

	// Let the outbound wire-trace DEBUG loggers (httpcore, hpack) through when the
	// log level is DEBUG. Off by default: those lines can quote outbound header
	// values and request paths with their query strings, including injected
	// credentials, unredacted. Not safe for production; enable only for short-lived
	// local debugging.
	HttpWireTrace bool `json:"http_wire_trace,omitempty,omitzero" yaml:"http_wire_trace,omitempty" mapstructure:"http_wire_trace,omitempty"`
}

File logging sink (in addition to stdout).

func (*LoggingConfig) UnmarshalJSON

func (j *LoggingConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type McpConfig added in v0.38.0

type McpConfig struct {
	// Broker base URL the MCP “execute“ tools forward calls to, carrying the
	// caller's bearer token. The default matches the local install (loopback broker
	// on port 8100); split deployments set the broker service's URL. Plain
	// “http://“ is refused for non-loopback hosts.
	BrokerUrl string `json:"broker_url" yaml:"broker_url" mapstructure:"broker_url"`

	// Serve the Streamable HTTP MCP endpoint at “/mcp“. Off, “/mcp“ answers a
	// plain 404, unless “oauth.enabled“ keeps its 401 + “WWW-Authenticate“
	// discovery challenge so OAuth clients can walk the RFC 9728 chain before the
	// endpoint is turned on.
	Enabled bool `json:"enabled,omitempty,omitzero" yaml:"enabled,omitempty" mapstructure:"enabled,omitempty"`

	// Oauth corresponds to the JSON schema field "oauth".
	Oauth *McpOAuthConfig `json:"oauth,omitempty,omitzero" yaml:"oauth,omitempty" mapstructure:"oauth,omitempty"`
}

“server.mcp“ sub-config.

func (*McpConfig) UnmarshalJSON added in v0.38.0

func (j *McpConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type McpOAuthConfig added in v0.38.0

type McpOAuthConfig struct {
	// Activate dynamically registered OAuth clients immediately. Off, a new
	// registration lands pending and inactive in the admin queue until an operator
	// approves it; enable only where self-registered clients are acceptable without
	// review (e.g. a single-user self-hosted install).
	AutoApproveClients bool `` /* 130-byte string literal not displayed */

	// Serve the MCP interactive-OAuth surface: anonymous dynamic client registration
	// (“POST /oauth-clients“) and the “/mcp“-scoped OAuth discovery documents.
	// Off, those routes answer a plain 404.
	Enabled bool `json:"enabled,omitempty,omitzero" yaml:"enabled,omitempty" mapstructure:"enabled,omitempty"`

	// RegistrationGcDays corresponds to the JSON schema field "registration_gc_days".
	RegistrationGcDays int `json:"registration_gc_days" yaml:"registration_gc_days" mapstructure:"registration_gc_days"`
}

Interactive-OAuth settings for the MCP surface.

Minimal seam: the full “server.mcp“ sub-config (“server.mcp.enabled“ etc.) extends this model in place — fields here must keep their names and defaults.

func (*McpOAuthConfig) UnmarshalJSON added in v0.38.0

func (j *McpOAuthConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type MemoryBackendConfig added in v0.44.0

type MemoryBackendConfig struct {
	// Default most approximate bytes (key + value + about 750 bytes of per-entry
	// overhead) one key namespace may hold before its writes are refused.
	MaxBytesPerNamespace int `json:"max_bytes_per_namespace" yaml:"max_bytes_per_namespace" mapstructure:"max_bytes_per_namespace"`

	// Default most live entries one key namespace may hold before its writes are
	// refused.
	MaxEntriesPerNamespace int `json:"max_entries_per_namespace" yaml:"max_entries_per_namespace" mapstructure:"max_entries_per_namespace"`

	// Most approximate bytes all namespaces of the memory backend may hold together
	// (201326592, 192 MiB, by default); a write past it is refused like a full
	// namespace, never by evicting a live entry. A process builds one backend shared
	// by every surface it serves, so this caps the whole process's shared state.
	// Raise the container memory limit together with it.
	MaxTotalBytes int `json:"max_total_bytes" yaml:"max_total_bytes" mapstructure:"max_total_bytes"`

	// Per-namespace budget overrides, keyed by namespace (the key prefix before the
	// first “:“). Unless overridden here, idem (Idempotency-Key records) is 250000
	// entries / 134217728 bytes (128 MiB) and idem-body (their stored response
	// bodies) 1000000 entries / 33554432 bytes (32 MiB), each with a 0.1 per-caller
	// share; login-csrf (login page CSRF nonces) uses max_entries_per_namespace /
	// max_bytes_per_namespace with a 0.02 per-client share, about 370 live nonces per
	// IPv4 address or IPv6 /64 at the defaults (about 900 bytes each, 5-minute TTL),
	// twice what the default authorize rate limit lets one client network request in
	// that time; repeated_failure (the broker's repeated-failure counters, which gate
	// the execution.repeated_failure database scan) is 10000 entries / 8780000 bytes
	// (about 8.4 MiB), about 2500 concurrently failing actor + credential + operation
	// keys, and fails open when full (every failure runs the scan); every other
	// namespace uses max_entries_per_namespace / max_bytes_per_namespace. The
	// sustained idempotent request rate idem can hold is min(max_entries, max_bytes /
	// record_bytes) / broker.idempotency.ttl_s, where record_bytes is about 1000
	// bytes plus the response headers (capped at 512 bytes): about 30 req/s at the
	// defaults and a 1 h TTL, and a tenth of that per caller. Above it,
	// Idempotency-Key requests get 503 idempotency_unavailable; bodies (about 830
	// bytes + body length each) stop being stored for replay sooner, about 5 req/s of
	// 1 KiB bodies, without refusing requests.
	Namespaces MemoryBackendConfigNamespaces `json:"namespaces,omitempty,omitzero" yaml:"namespaces,omitempty" mapstructure:"namespaces,omitempty"`
}

Bounds for the in-process (“memory“) shared-state backend.

Every key belongs to a namespace, its prefix up to the first “:“ (“idem“ for Idempotency-Key records, “idem-body“ for their stored response bodies, “auth“ for the auth surface's single-use markers, “login-csrf“ for login CSRF nonces, “cb“ for circuit-breaker counters and their open-circuit report claims, “broker-authfail“ and “broker-authfail-emit“ for the broker's auth-failure counters, “mcp-session“ and “mcp-session-cap“ for the MCP session-event dedupe, “repeated_failure“ for the broker's repeated-failure counters, and so on). Each namespace has its own budget, so one key kind filling up never starves another. A namespace that is full of live entries refuses new writes (the request that needed it gets a 503) rather than evicting a live entry; the telemetry namespaces (“broker-authfail*“, the “cb“ report claims, “mcp-session*“) only skip the count or fall back to the database dedupe instead. Ignored by every other backend.

func (*MemoryBackendConfig) UnmarshalJSON added in v0.44.0

func (j *MemoryBackendConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type MemoryBackendConfigNamespaces added in v0.44.0

type MemoryBackendConfigNamespaces map[string]MemoryNamespaceBudgetConfig

Per-namespace budget overrides, keyed by namespace (the key prefix before the first “:“). Unless overridden here, idem (Idempotency-Key records) is 250000 entries / 134217728 bytes (128 MiB) and idem-body (their stored response bodies) 1000000 entries / 33554432 bytes (32 MiB), each with a 0.1 per-caller share; login-csrf (login page CSRF nonces) uses max_entries_per_namespace / max_bytes_per_namespace with a 0.02 per-client share, about 370 live nonces per IPv4 address or IPv6 /64 at the defaults (about 900 bytes each, 5-minute TTL), twice what the default authorize rate limit lets one client network request in that time; repeated_failure (the broker's repeated-failure counters, which gate the execution.repeated_failure database scan) is 10000 entries / 8780000 bytes (about 8.4 MiB), about 2500 concurrently failing actor + credential + operation keys, and fails open when full (every failure runs the scan); every other namespace uses max_entries_per_namespace / max_bytes_per_namespace. The sustained idempotent request rate idem can hold is min(max_entries, max_bytes / record_bytes) / broker.idempotency.ttl_s, where record_bytes is about 1000 bytes plus the response headers (capped at 512 bytes): about 30 req/s at the defaults and a 1 h TTL, and a tenth of that per caller. Above it, Idempotency-Key requests get 503 idempotency_unavailable; bodies (about 830 bytes + body length each) stop being stored for replay sooner, about 5 req/s of 1 KiB bodies, without refusing requests.

type MemoryNamespaceBudgetConfig added in v0.44.0

type MemoryNamespaceBudgetConfig struct {
	// Most approximate bytes (key + value + about 750 bytes of per-entry overhead)
	// the namespace may hold.
	MaxBytes int `json:"max_bytes" yaml:"max_bytes" mapstructure:"max_bytes"`

	// Most live entries the namespace may hold.
	MaxEntries int `json:"max_entries" yaml:"max_entries" mapstructure:"max_entries"`

	// Most of max_entries and max_bytes that one owner (the key's second “:“
	// segment: for idem and idem-body the calling actor, for login-csrf the client's
	// IPv4 address or IPv6 /64) may hold; an owner over its share is refused without
	// affecting the others. Unset, it is 0.1 for idem and idem-body, 0.02 for
	// login-csrf and unlimited elsewhere; 1.0 lets one owner use the whole namespace.
	MaxOwnerShare interface{} `json:"max_owner_share,omitempty,omitzero" yaml:"max_owner_share,omitempty" mapstructure:"max_owner_share,omitempty"`
}

Entry-count and approximate byte budget for one memory-backend key namespace.

func (*MemoryNamespaceBudgetConfig) UnmarshalJSON added in v0.44.0

func (j *MemoryNamespaceBudgetConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type MemoryNamespaceBudgetConfigMaxOwnerShare_0 added in v0.44.0

type MemoryNamespaceBudgetConfigMaxOwnerShare_0 *float64

type MetricsConfig

type MetricsConfig struct {
	// Seconds between OTLP metric pushes. Ignored unless “exporter“ is “otlp“.
	ExportIntervalSeconds int `json:"export_interval_seconds" yaml:"export_interval_seconds" mapstructure:"export_interval_seconds"`

	// Where metrics go: “otlp“ pushes to the OTLP endpoint named by the standard
	// “OTEL_EXPORTER_OTLP_*“ environment variables, “prometheus“ serves a scrape
	// endpoint at “/metrics“, and “none“ records nothing.
	Exporter MetricsConfigExporter `json:"exporter" yaml:"exporter" mapstructure:"exporter"`

	// Explicit histogram bucket boundaries (milliseconds, strictly increasing, all >
	// 0) for the request-latency histograms listed in docs/operations/monitoring.md;
	// seconds-unit histograms get the list divided by 1000. Must be identical on
	// every process whose series are aggregated together. As an env var, a
	// comma-separated list.
	LatencyBucketsMs []float64 `json:"latency_buckets_ms" yaml:"latency_buckets_ms" mapstructure:"latency_buckets_ms"`
}

Metrics exporter configuration.

func (*MetricsConfig) UnmarshalJSON

func (j *MetricsConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type MetricsConfigExporter

type MetricsConfigExporter string
const MetricsConfigExporterNone MetricsConfigExporter = "none"
const MetricsConfigExporterOtlp MetricsConfigExporter = "otlp"
const MetricsConfigExporterPrometheus MetricsConfigExporter = "prometheus"

func (*MetricsConfigExporter) UnmarshalJSON

func (j *MetricsConfigExporter) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type OAuthRateLimitConfig added in v0.38.0

type OAuthRateLimitConfig struct {
	// Burst allowance on top of “approval_status_rpm“.
	ApprovalStatusBurst int `json:"approval_status_burst" yaml:"approval_status_burst" mapstructure:"approval_status_burst"`

	// Sustained requests/minute allowed on the approval-pending status poll (“GET
	// /oauth/approval/status“). Its own namespace, so polling can never drain the
	// “/authorize“ or registration quota: one pending tab polls at 12 rpm, so the
	// default keeps ~10 concurrent pending tabs behind one NAT inside the bucket, and
	// the page honors “Retry-After“ with backoff, so saturation degrades to a
	// slower cadence rather than a thundering retry.
	ApprovalStatusRpm int `json:"approval_status_rpm" yaml:"approval_status_rpm" mapstructure:"approval_status_rpm"`

	// Burst allowance on top of “authorize_rpm“.
	AuthorizeBurst int `json:"authorize_burst" yaml:"authorize_burst" mapstructure:"authorize_burst"`

	// Sustained requests/minute allowed per client network (IPv4 address or IPv6 /64)
	// across the unauthenticated authorization flow: “/authorize“, the IdP
	// callback, the consent page, its submit and inline agent create, and the
	// local-login form share one bucket, whatever “client_id“ they name. A sign-in
	// spends two to six requests (more after a mistyped password), so the defaults
	// admit at least five back-to-back sign-ins and then at least five a minute per
	// network; raise both for a large shared NAT or egress IP. Behind a proxy, set
	// “auth.oauth_rate_limit.trusted_proxies“ or every client shares the proxy's
	// bucket.
	AuthorizeRpm int `json:"authorize_rpm" yaml:"authorize_rpm" mapstructure:"authorize_rpm"`

	// Burst allowance on top of “exchange_rpm“.
	ExchangeBurst int `json:"exchange_burst" yaml:"exchange_burst" mapstructure:"exchange_burst"`

	// Sustained requests/minute allowed per “client_id“ + client network (IPv4
	// address or IPv6 /64) on the token endpoint (also reused per client network for
	// token revocation).
	ExchangeRpm int `json:"exchange_rpm" yaml:"exchange_rpm" mapstructure:"exchange_rpm"`

	// Burst allowance on top of “registration_rpm“.
	RegistrationBurst int `json:"registration_burst" yaml:"registration_burst" mapstructure:"registration_burst"`

	// Sustained requests/minute allowed per client network (IPv4 address or IPv6 /64)
	// on anonymous dynamic client registration (“POST /oauth-clients“) and agent
	// self-registration (“POST /register“), in its own bucket.
	RegistrationRpm int `json:"registration_rpm" yaml:"registration_rpm" mapstructure:"registration_rpm"`

	// Reverse proxies whose “X-Forwarded-For“ header is honored when deriving the
	// per-client rate-limit identity: IP addresses or CIDR networks (e.g.
	// “10.0.0.0/8“, “fd00::/8“), matched against the socket address and each
	// forwarded hop by network membership. Accepts a YAML list or a comma-separated
	// string. Invalid entries fail config load. Empty (default) means the socket
	// address is used as-is — behind a reverse proxy every request then carries the
	// proxy's IP and all clients share one bucket, so list the proxy IPs or pod CIDR
	// when deploying behind one. Only list ranges your proxies alone hold: any host
	// inside a trusted network can choose its own rate-limit identity.
	TrustedProxies []string `json:"trusted_proxies,omitempty,omitzero" yaml:"trusted_proxies,omitempty" mapstructure:"trusted_proxies,omitempty"`
}

Pre-auth rate limit tunables for OAuth endpoints.

func (*OAuthRateLimitConfig) UnmarshalJSON added in v0.38.0

func (j *OAuthRateLimitConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ObservabilityConfig

type ObservabilityConfig struct {
	// Metrics corresponds to the JSON schema field "metrics".
	Metrics *MetricsConfig `json:"metrics,omitempty,omitzero" yaml:"metrics,omitempty" mapstructure:"metrics,omitempty"`

	// Tracing corresponds to the JSON schema field "tracing".
	Tracing *TracingConfig `json:"tracing,omitempty,omitzero" yaml:"tracing,omitempty" mapstructure:"tracing,omitempty"`
}

Observability settings (metrics, tracing knobs).

type PipedreamProviderConfig

type PipedreamProviderConfig struct {
	// Pipedream OAuth client id.
	ClientId string `json:"client_id" yaml:"client_id" mapstructure:"client_id"`

	// Pipedream OAuth client secret.
	ClientSecret string `json:"client_secret" yaml:"client_secret" mapstructure:"client_secret"`

	// Base URL of the Pipedream Connect API.
	ConnectBaseUrl string `json:"connect_base_url" yaml:"connect_base_url" mapstructure:"connect_base_url"`

	// Pipedream project environment the connections live in.
	Environment PipedreamProviderConfigEnvironment `json:"environment" yaml:"environment" mapstructure:"environment"`

	// How many seconds before an access token's real expiry the broker refreshes it.
	// Applied at comparison time; the stored expiry is never shifted.
	ExpirySkewSeconds int `json:"expiry_skew_seconds" yaml:"expiry_skew_seconds" mapstructure:"expiry_skew_seconds"`

	// Kind corresponds to the JSON schema field "kind".
	Kind string `json:"kind" yaml:"kind" mapstructure:"kind"`

	// Pipedream project id.
	ProjectId string `json:"project_id" yaml:"project_id" mapstructure:"project_id"`
}

Configuration for a Pipedream-hosted OAuth provider.

func (*PipedreamProviderConfig) UnmarshalJSON

func (j *PipedreamProviderConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type PipedreamProviderConfigEnvironment

type PipedreamProviderConfigEnvironment string
const PipedreamProviderConfigEnvironmentDevelopment PipedreamProviderConfigEnvironment = "development"
const PipedreamProviderConfigEnvironmentProduction PipedreamProviderConfigEnvironment = "production"

func (*PipedreamProviderConfigEnvironment) UnmarshalJSON

func (j *PipedreamProviderConfigEnvironment) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type PlatformClientConfig added in v0.38.0

type PlatformClientConfig struct {
	// OAuth client id the first-party client presents.
	ClientId string `json:"client_id" yaml:"client_id" mapstructure:"client_id"`

	// Allowed absolute redirect URIs (exact match). “https“ is required except for
	// “localhost“ / “127.0.0.1“, where “http“ is accepted.
	RedirectUris []string `json:"redirect_uris" yaml:"redirect_uris" mapstructure:"redirect_uris"`
}

A static first-party OAuth client (e.g. the operator SPA).

Platform clients authenticate via PKCE only — no client secret. They are defined in config (not the oauth_clients DB table) because they are deployment-time constants, not admin-managed dynamic registrations.

func (*PlatformClientConfig) UnmarshalJSON added in v0.38.0

func (j *PlatformClientConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type RateLimitConfig

type RateLimitConfig struct {
	// Token-bucket capacity: the most requests a caller can spend at once. Also the
	// “RateLimit-Limit“ header value.
	Burst int `json:"burst" yaml:"burst" mapstructure:"burst"`

	// Sustained refill rate of each caller's token bucket, in requests per minute.
	DefaultRpm int `json:"default_rpm" yaml:"default_rpm" mapstructure:"default_rpm"`

	// Rate-limit broker executions per caller; over the limit the broker answers 429
	// with “RateLimit-*“ and “Retry-After“ headers. Per instance on the memory
	// state backend, cluster-wide on Redis.
	Enabled bool `json:"enabled" yaml:"enabled" mapstructure:"enabled"`
}

Per-caller token-bucket rate limit.

Keyed on the resolved “actor_id“ and enforced in a post-auth dependency (the actor isn't known at admission time, so this can't be a plain pre-auth middleware). The token bucket itself lives on the shared-state backend (“RateLimitStore“); with the memory backend the limit is per-instance, with Redis it is cluster-wide — no call-site change.

func (*RateLimitConfig) UnmarshalJSON

func (j *RateLimitConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ReleaseCheckConfig

type ReleaseCheckConfig struct {
	// Seconds the latest-release lookup is cached in process (default 6 h), so at
	// most one GitHub request is made per TTL. 0 disables the check entirely
	// (air-gapped installs, no egress).
	CacheTtlSeconds int `json:"cache_ttl_seconds" yaml:"cache_ttl_seconds" mapstructure:"cache_ttl_seconds"`

	// Check GitHub for a newer jentic-one release so the web console can show an
	// "update available" banner. Runs only when “server.backend“ is “local“.
	Enabled bool `json:"enabled" yaml:"enabled" mapstructure:"enabled"`

	// Repo corresponds to the JSON schema field "repo".
	Repo string `json:"repo" yaml:"repo" mapstructure:"repo"`
}

"Update available" check for the running jentic-one build itself.

Powers “GET /system/version“: the backend asks GitHub for the newest published release of “repo“ and compares it against the running build so the web console can surface an "update available" banner (and the user menu can always show the current version). This covers *jentic-one's own* release; “CatalogConfig“ tracks the public *API catalog* instead.

Runs only on a “local“ backend (a self-hosted install the operator can actually update); the hosted platform (“server.backend == "remote"“) skips it. The result is cached in-process for “cache_ttl_seconds“ (fetch-on-read, no background job), so at most one GitHub request happens per TTL regardless of how many clients poll. Every failure degrades to "latest unknown" (no banner) rather than erroring — the version probe must never break the app.

func (*ReleaseCheckConfig) UnmarshalJSON

func (j *ReleaseCheckConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type RetryConfig

type RetryConfig struct {
	// Base delay (seconds) of the exponential backoff “base_backoff_s *
	// 2**(attempt-1)“, capped at “max_backoff_s“, then fully jittered and clamped
	// to the request deadline.
	BaseBackoffS float64 `json:"base_backoff_s" yaml:"base_backoff_s" mapstructure:"base_backoff_s"`

	// Retry failed upstream attempts when safe: connect failures for any method,
	// post-send failures (read timeouts, “retry_statuses“) only for idempotent HTTP
	// methods. Bounded by the request deadline. Streamed executions are never
	// retried, and streaming is the default synchronous path while
	// “broker.resilience.upstream.stream_passthrough_enabled“ is true.
	Enabled bool `json:"enabled,omitempty,omitzero" yaml:"enabled,omitempty" mapstructure:"enabled,omitempty"`

	// Total attempts including the first (3 = the initial call plus up to 2 retries).
	MaxAttempts int `json:"max_attempts" yaml:"max_attempts" mapstructure:"max_attempts"`

	// Cap (seconds) on one retry backoff before jitter.
	MaxBackoffS float64 `json:"max_backoff_s" yaml:"max_backoff_s" mapstructure:"max_backoff_s"`

	// Upstream status codes treated as transient and retried; an upstream
	// “Retry-After“ on them is honoured, capped at the request deadline.
	RetryStatuses []int `json:"retry_statuses,omitempty,omitzero" yaml:"retry_statuses,omitempty" mapstructure:"retry_statuses,omitempty"`
}

Idempotency-aware upstream retry.

The “RetryRunner“ decorator retries a failed attempt **only** when it is safe to do so: a connect-phase failure (no bytes on the wire) is retryable for any method, while a post-send failure (read timeout, mirrored “429“/ “503“) is retried only for idempotent HTTP methods — “Idempotency-Key“ is broker-consumed and stripped from outbound headers, so a post-send “POST“ or “PATCH“ retry would double-spend (#1799). Each attempt still flows through the circuit breaker (retry *outside*, breaker *inside*); the whole loop is bounded by the request deadline.

func (*RetryConfig) UnmarshalJSON

func (j *RetryConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type RuntimeConfig

type RuntimeConfig struct {
	// Render stdout logs with the human-readable console renderer instead of JSON
	// lines. For local development.
	Debug bool `json:"debug,omitempty,omitzero" yaml:"debug,omitempty" mapstructure:"debug,omitempty"`

	// Root log level: an uppercase Python level name such as “DEBUG“, “INFO“ or
	// “WARNING“.
	LogLevel string `json:"log_level" yaml:"log_level" mapstructure:"log_level"`

	// MaintenanceMode corresponds to the JSON schema field "maintenance_mode".
	MaintenanceMode bool `json:"maintenance_mode,omitempty,omitzero" yaml:"maintenance_mode,omitempty" mapstructure:"maintenance_mode,omitempty"`
}

Hot-reloadable runtime flags.

func (*RuntimeConfig) UnmarshalJSON

func (j *RuntimeConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type SearchConfig

type SearchConfig struct {
	// Build the lexical search text for operations at import time. APIs imported
	// while this is off are not findable by lexical search until re-imported.
	Enabled bool `json:"enabled" yaml:"enabled" mapstructure:"enabled"`

	// Serve search queries. Off, search requests fail with a search-disabled error;
	// indexing at import is controlled separately by “enabled“.
	SearchEnabled bool `json:"search_enabled" yaml:"search_enabled" mapstructure:"search_enabled"`

	// Search strategy name, resolved per database dialect against the registered
	// strategies. “lexical“ (BM25 on SQLite, native full-text on PostgreSQL) is
	// built in; an unknown mode fails on first use with the available modes listed.
	SearchMode string `json:"search_mode" yaml:"search_mode" mapstructure:"search_mode"`
}

Search configuration.

The built-in mode is "lexical" (BM25 on SQLite, native full-text on PostgreSQL). “search_mode“ is validated against the registered SearchStrategy set at resolve time (“resolve_strategy“), so an unknown mode fails loudly with the available modes for the active dialect rather than at config load. Additional modes (e.g. "semantic", "vector") can be registered via “register_strategy“ without editing this schema.

func (*SearchConfig) UnmarshalJSON

func (j *SearchConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type SecurityConfig

type SecurityConfig struct {
	// Broker execute requests from one actor refused within a clock minute for
	// lacking the execute permission before a
	// “security.unauthorized_access_attempt“ event is emitted (at most one per
	// actor per minute).
	AuthFailureEventThreshold int `json:"auth_failure_event_threshold" yaml:"auth_failure_event_threshold" mapstructure:"auth_failure_event_threshold"`

	// Hours before an OAuth token's expiry at which “credential.expiring_soon“
	// events start; the token stays in that warning state until it expires.
	CredentialExpiringSoonWindowH int `` /* 130-byte string literal not displayed */

	// Run the credential-expiry scan every Nth worker tick. One tick is about
	// “worker.poll_interval_s“, so the default is roughly every 2 minutes.
	CredentialExpirySweepIntervalTicks int `` /* 145-byte string literal not displayed */

	// Failure count within the window at or above which the
	// “execution.repeated_failure“ event escalates from “error“ to “critical“
	// severity. Keep it above the base threshold.
	ExecutionRepeatedFailureCriticalThreshold int `` /* 166-byte string literal not displayed */

	// Failed executions for one actor, credential and operation within
	// “execution_repeated_failure_window_s“ before an
	// “execution.repeated_failure“ event is emitted.
	ExecutionRepeatedFailureThreshold int `` /* 139-byte string literal not displayed */

	// Rolling window (seconds) over which repeated failures are counted; at most one
	// “execution.repeated_failure“ event is emitted per window.
	ExecutionRepeatedFailureWindowS int `` /* 136-byte string literal not displayed */
}

Platform security event thresholds.

func (*SecurityConfig) UnmarshalJSON

func (j *SecurityConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ServerConfig

type ServerConfig struct {
	// Backend locality reported by “GET /instance“: “local“ for a self-hosted
	// install on the operator's own machine or network, “remote“ for a hosted
	// install run elsewhere. A hint for clients, not an authorization signal;
	// “remote“ also skips the release check.
	Backend ServerConfigBackend `json:"backend" yaml:"backend" mapstructure:"backend"`

	// Interface the HTTP server binds to. “0.0.0.0“ / “::“ listen on all
	// interfaces; a loopback address keeps the app reachable from this machine only.
	Host string `json:"host" yaml:"host" mapstructure:"host"`

	// Mcp corresponds to the JSON schema field "mcp".
	Mcp *McpConfig `json:"mcp,omitempty,omitzero" yaml:"mcp,omitempty" mapstructure:"mcp,omitempty"`

	// TCP port the HTTP server listens on.
	Port int `json:"port" yaml:"port" mapstructure:"port"`

	// The public origin of this deployment (e.g. “https://jentic.example.com“).
	// Absolute URLs the app hands to external clients — the OAuth connect
	// “redirect_uri“, the OIDC issuer and JWT-Bearer audience, DCR
	// “registration_client_uri“, the SPA login callback, approval links — fall back
	// to it when their own more specific key is unset. Unset, they derive from the
	// incoming request's origin, or from the bind (“http://{host}:{port}“) when
	// there is no request; set it when clients reach the app through a reverse proxy,
	// ingress or port mapping.
	PublicBaseUrl string `json:"public_base_url,omitempty,omitzero" yaml:"public_base_url,omitempty" mapstructure:"public_base_url,omitempty"`

	// Run uvicorn with auto-reload on code changes (development only). Ignored, with
	// a warning, when the admin database is SQLite or the config comes from a
	// one-shot source such as a pipe.
	Reload bool `json:"reload,omitempty,omitzero" yaml:"reload,omitempty" mapstructure:"reload,omitempty"`
}

HTTP server settings.

func (*ServerConfig) UnmarshalJSON

func (j *ServerConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ServerConfigBackend

type ServerConfigBackend string
const ServerConfigBackendLocal ServerConfigBackend = "local"
const ServerConfigBackendRemote ServerConfigBackend = "remote"

func (*ServerConfigBackend) UnmarshalJSON

func (j *ServerConfigBackend) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ServicesConfig

type ServicesConfig struct {
	// On shutdown, how long (seconds) the app waits for work requests handed off
	// after their response (e.g. streaming execution records) before cancelling what
	// is still running. Runs before the databases close; each cancelled task is
	// logged and counted on “app.background_tasks“ (“outcome=cancelled“).
	BackgroundTaskDrainTimeoutS float64 `json:"background_task_drain_timeout_s" yaml:"background_task_drain_timeout_s" mapstructure:"background_task_drain_timeout_s"`

	// RequestTimeoutS corresponds to the JSON schema field "request_timeout_s".
	RequestTimeoutS float64 `json:"request_timeout_s" yaml:"request_timeout_s" mapstructure:"request_timeout_s"`

	// RetryBackoffS corresponds to the JSON schema field "retry_backoff_s".
	RetryBackoffS float64 `json:"retry_backoff_s" yaml:"retry_backoff_s" mapstructure:"retry_backoff_s"`

	// RetryMax corresponds to the JSON schema field "retry_max".
	RetryMax int `json:"retry_max" yaml:"retry_max" mapstructure:"retry_max"`
}

Service-level settings (immutable after boot).

func (*ServicesConfig) UnmarshalJSON

func (j *ServicesConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type SigningKeyConfig

type SigningKeyConfig struct {
	// Key id published in the JWKS and stamped in the “kid“ header of ID tokens
	// signed with this key (“[a-zA-Z0-9_-]+“).
	Kid string `json:"kid" yaml:"kid" mapstructure:"kid"`

	// PEM-encoded EC P-256 private key used for ES256 signing.
	PrivateKeyPem string `json:"private_key_pem" yaml:"private_key_pem" mapstructure:"private_key_pem"`
}

A single ES256 signing key for ID token issuance.

func (*SigningKeyConfig) UnmarshalJSON

func (j *SigningKeyConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type StateBackendConfig

type StateBackendConfig struct {
	// Name of the shared-state backend to build: “memory“ (in-process, the
	// default), “redis“ (deprecated), or a name an extension registered with
	// “register_state_backend“. An unregistered name fails at startup with the list
	// of registered names.
	Backend string `json:"backend" yaml:"backend" mapstructure:"backend"`

	// Memory corresponds to the JSON schema field "memory".
	Memory *MemoryBackendConfig `json:"memory,omitempty,omitzero" yaml:"memory,omitempty" mapstructure:"memory,omitempty"`

	// Settings for a backend registered by an extension, passed to its builder
	// unvalidated (the builder validates them). Ignored by the built-in memory and
	// redis backends.
	Options StateBackendConfigOptions `json:"options,omitempty,omitzero" yaml:"options,omitempty" mapstructure:"options,omitempty"`

	// Prefix the deprecated “redis“ backend puts on every key; set a
	// per-environment value when deployments share one Redis.
	RedisKeyPrefix string `json:"redis_key_prefix" yaml:"redis_key_prefix" mapstructure:"redis_key_prefix"`

	// Connection URL of the deprecated “redis“ backend; required by it.
	RedisUrl interface{} `json:"redis_url,omitempty,omitzero" yaml:"redis_url,omitempty" mapstructure:"redis_url,omitempty"`
}

The process's shared-state backend (top-level “state:“ section).

One backend per process holds the rate-limit buckets, circuit-breaker counters, “Idempotency-Key“ records, the auth surface's single-use markers, the broker's auth-failure counters and the MCP session-event dedupe of every surface the process serves.

func (*StateBackendConfig) UnmarshalJSON

func (j *StateBackendConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type StateBackendConfigOptions added in v0.44.0

type StateBackendConfigOptions map[string]interface{}

Settings for a backend registered by an extension, passed to its builder unvalidated (the builder validates them). Ignored by the built-in memory and redis backends.

type StateBackendConfigRedisUrl_0

type StateBackendConfigRedisUrl_0 *string

type TelemetryConfig

type TelemetryConfig struct {
	// Send anonymous product telemetry. Off when unset; the shipped install paths may
	// set it to true. Set false to opt out.
	Enabled bool `json:"enabled,omitempty,omitzero" yaml:"enabled,omitempty" mapstructure:"enabled,omitempty"`

	// Endpoint corresponds to the JSON schema field "endpoint".
	Endpoint string `json:"endpoint" yaml:"endpoint" mapstructure:"endpoint"`

	// FlushIntervalS corresponds to the JSON schema field "flush_interval_s".
	FlushIntervalS float64 `json:"flush_interval_s" yaml:"flush_interval_s" mapstructure:"flush_interval_s"`

	// Host OS family stamped by the onboarding CLI, so an instance running in Docker
	// reports the operator's OS rather than the container's Linux. Unset falls back
	// to runtime detection; unrecognised values are reported as “other“. Sent once
	// per boot, on the “instance_booted“ event.
	HostOs interface{} `json:"host_os,omitempty,omitzero" yaml:"host_os,omitempty" mapstructure:"host_os,omitempty"`

	// Opaque instance id reported with telemetry (at most 64 characters). When set it
	// is authoritative and overwrites the id stored in the admin database; unset, a
	// random UUID is generated on first startup and kept.
	InstanceId interface{} `json:"instance_id,omitempty,omitzero" yaml:"instance_id,omitempty" mapstructure:"instance_id,omitempty"`

	// MaxBatch corresponds to the JSON schema field "max_batch".
	MaxBatch int `json:"max_batch" yaml:"max_batch" mapstructure:"max_batch"`

	// QueueMax corresponds to the JSON schema field "queue_max".
	QueueMax int `json:"queue_max" yaml:"queue_max" mapstructure:"queue_max"`

	// RequestTimeoutS corresponds to the JSON schema field "request_timeout_s".
	RequestTimeoutS float64 `json:"request_timeout_s" yaml:"request_timeout_s" mapstructure:"request_timeout_s"`
}

Anonymous product telemetry. Off by default for hand-written configs, but the shipped install paths (such as the quickstarts) may turn it on.

To opt out, set “telemetry.enabled“ to “false“ in the config, or the environment variable “JENTIC__TELEMETRY__ENABLED=false“ (for example, in a Docker compose file).

Events carry only a fixed event name (such as “instance_booted“, “agent_created“ or “broker_execution“), closed-enum tags, the actor type and a timestamp, plus a random instance id and the app version. No credentials, request data or personal data are sent. The full event list is “TelemetryEventName“ in “src/jentic_one/shared/telemetry/events.py“.

func (*TelemetryConfig) UnmarshalJSON

func (j *TelemetryConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type TelemetryConfigHostOs_0

type TelemetryConfigHostOs_0 *string

type TelemetryConfigInstanceId_0

type TelemetryConfigInstanceId_0 *string

type TracingConfig

type TracingConfig struct {
	// Where spans go. “none“ records no spans at all (every span is non-recording),
	// while trace ids are still generated and propagated: an inbound “traceparent“
	// is honoured, outbound requests carry “traceparent“/“tracestate“, and
	// execution records and logs keep their “trace_id“. With “none“ the outbound
	// “traceparent“ has the sampled flag unset (“-00“) even when the caller sent
	// “-01“, since this process records nothing.
	Exporter TracingConfigExporter `json:"exporter" yaml:"exporter" mapstructure:"exporter"`

	// Fraction of traces recorded and exported when “exporter“ is “otlp“ (1.0
	// records every trace). It caps every trace entering the process, including
	// requests that arrive with a sampled “traceparent“ (the CLI and MCP send one
	// on every call), so a caller cannot force recording. A caller's unsampled
	// “traceparent“ stays unsampled. Ignored with “exporter: none“, and
	// overridden by the standard “OTEL_TRACES_SAMPLER“ environment variable when
	// that is set (a warning is logged if this field is not 1.0).
	SampleRatio float64 `json:"sample_ratio" yaml:"sample_ratio" mapstructure:"sample_ratio"`
}

Tracing exporter configuration.

func (*TracingConfig) UnmarshalJSON

func (j *TracingConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type TracingConfigExporter

type TracingConfigExporter string
const TracingConfigExporterNone TracingConfigExporter = "none"
const TracingConfigExporterOtlp TracingConfigExporter = "otlp"

func (*TracingConfigExporter) UnmarshalJSON

func (j *TracingConfigExporter) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type TrustedIssuerConfig

type TrustedIssuerConfig struct {
	// Signature algorithms accepted from this issuer. Asymmetric only (RS*, ES*, PS*,
	// EdDSA); HMAC and “none“ are rejected at load.
	Algorithms []string `json:"algorithms,omitempty,omitzero" yaml:"algorithms,omitempty" mapstructure:"algorithms,omitempty"`

	// Expected “iss“ claim of tokens from this issuer (exact match).
	Issuer string `json:"issuer" yaml:"issuer" mapstructure:"issuer"`

	// URL of the issuer's published JWKS. Must be https:// when
	// JENTIC_ENV=production; plain http:// is accepted outside production (local/CI
	// stacks) and logs a warning at config load.
	JwksUrl string `json:"jwks_url" yaml:"jwks_url" mapstructure:"jwks_url"`
}

A single trusted token issuer (IdP) and where to fetch its public keys.

The verifier holds one JWKS client per issuer; an unknown “kid“ triggers a bounded re-fetch (key rotation picked up without a restart). “algorithms“ is the per-issuer asymmetric allowlist — HMAC/“none“ are rejected here so an issuer can't be downgraded to a symmetric/forgeable signature.

func (*TrustedIssuerConfig) UnmarshalJSON

func (j *TrustedIssuerConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type UpstreamClientConfig

type UpstreamClientConfig struct {
	// Timeout (seconds) for establishing an upstream connection.
	ConnectTimeoutS float64 `json:"connect_timeout_s" yaml:"connect_timeout_s" mapstructure:"connect_timeout_s"`

	// Negotiate HTTP/2 via ALPN, falling back to HTTP/1.1 when the upstream does not
	// offer it. Some upstreams (APNs, certain CDNs) refuse 1.1; set false only to pin
	// HTTP/1.1.
	Http2 bool `json:"http2" yaml:"http2" mapstructure:"http2"`

	// Maximum open upstream connections in the shared client pool.
	MaxConnections int `json:"max_connections" yaml:"max_connections" mapstructure:"max_connections"`

	// Maximum idle keep-alive connections the shared pool retains.
	MaxKeepalive int `json:"max_keepalive" yaml:"max_keepalive" mapstructure:"max_keepalive"`

	// Maximum concurrent calls to one upstream host, so one slow upstream cannot
	// drain the whole connection pool.
	MaxPerHost int `json:"max_per_host" yaml:"max_per_host" mapstructure:"max_per_host"`

	// Default cap (bytes) on an execute request body, for content types without an
	// entry in “max_request_bytes_by_type“; over it the broker answers 413.
	MaxRequestBytes int `json:"max_request_bytes" yaml:"max_request_bytes" mapstructure:"max_request_bytes"`

	// Per-Content-Type request-body caps (bytes), matched most specific first: exact
	// type (“application/json“), then wildcard (“audio/*“), then
	// “max_request_bytes“. A missing or unknown type gets the default, never
	// unbounded.
	MaxRequestBytesByType UpstreamClientConfigMaxRequestBytesByType `` /* 145-byte string literal not displayed */

	// Cap (bytes) on an upstream response body, enforced while reading: the
	// connection is aborted as soon as it is exceeded. 0 disables the cap (unbounded;
	// not recommended).
	MaxResponseBytes int `json:"max_response_bytes" yaml:"max_response_bytes" mapstructure:"max_response_bytes"`

	// How long (seconds) a call waits for a free connection from the shared pool
	// before failing.
	PoolTimeoutS float64 `json:"pool_timeout_s" yaml:"pool_timeout_s" mapstructure:"pool_timeout_s"`

	// Per-read *between-bytes* gap timeout (seconds, httpx semantics) on upstream
	// responses — not a whole-stream cap. Pairs with
	// “broker.resilience.request_deadline_s“, which must be sized above it so one
	// healthy slow attempt isn't pre-empted by the envelope deadline.
	ReadTimeoutS float64 `json:"read_timeout_s" yaml:"read_timeout_s" mapstructure:"read_timeout_s"`

	// Stream upstream responses straight through to the client instead of buffering
	// them. Applies to synchronous executions only; async executions always buffer,
	// and so do executions with an “Idempotency-Key“ when
	// “broker.idempotency.enabled“ is true. Off forces buffering everywhere.
	StreamPassthroughEnabled bool `json:"stream_passthrough_enabled" yaml:"stream_passthrough_enabled" mapstructure:"stream_passthrough_enabled"`

	// Total time (seconds) a streamed response body may take to transfer, so a steady
	// trickle or a slow-draining client cannot hold an upstream connection forever;
	// the stream is aborted when it is exceeded. Unlike “read_timeout_s“ this
	// bounds the whole body. 0 disables the deadline.
	TransferDeadlineS float64 `json:"transfer_deadline_s" yaml:"transfer_deadline_s" mapstructure:"transfer_deadline_s"`

	// Per-write timeout (seconds) while sending a request body upstream.
	WriteTimeoutS float64 `json:"write_timeout_s" yaml:"write_timeout_s" mapstructure:"write_timeout_s"`
}

Bounds for the single shared outbound “httpx.AsyncClient“.

The timeouts are httpx semantics: “read_timeout_s“ is the *between-bytes* gap timeout (per read), **not** a whole-stream cap — a trickle that keeps sending under the limit can hold a pool slot open. The overall transfer deadline is owned by the response-streaming guard, not here.

func (*UpstreamClientConfig) UnmarshalJSON

func (j *UpstreamClientConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type UpstreamClientConfigMaxRequestBytesByType

type UpstreamClientConfigMaxRequestBytesByType map[string]int

Per-Content-Type request-body caps (bytes), matched most specific first: exact type (“application/json“), then wildcard (“audio/*“), then “max_request_bytes“. A missing or unknown type gets the default, never unbounded.

type VendorAuthConfig added in v0.40.0

type VendorAuthConfig struct {
	// Vendor name shown in the connect picker.
	DisplayName string `json:"display_name" yaml:"display_name" mapstructure:"display_name"`

	// OAuth flows the vendor supports, selected by “kind“. The first entry is used
	// when the caller expresses no preference.
	Flows []interface{} `json:"flows" yaml:"flows" mapstructure:"flows"`

	// Request that labels the connected account (“connected_as“) after a successful
	// connect. Unset, the credential is still valid but carries no label.
	IdentityProbe *VendorAuthConfigIdentityProbe `json:"identity_probe,omitempty,omitzero" yaml:"identity_probe,omitempty" mapstructure:"identity_probe,omitempty"`

	// The vendor's scope catalog offered on the review page.
	Scopes []VendorScopeConfig `json:"scopes,omitempty,omitzero" yaml:"scopes,omitempty" mapstructure:"scopes,omitempty"`

	// Catalog API id of the vendor's API, in “<domain>/<name>“ form (e.g.
	// “github.com/api.github.com“); credentials created through this entry are
	// scoped to it.
	Vendor string `json:"vendor" yaml:"vendor" mapstructure:"vendor"`
}

Config entry for one verified vendor.

Keyed in `VendorRegistryConfig.entries` by a short slug (e.g. "github").

func (*VendorAuthConfig) UnmarshalJSON added in v0.40.0

func (j *VendorAuthConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type VendorAuthConfigIdentityProbe added in v0.42.0

type VendorAuthConfigIdentityProbe struct {
	// Python “str.format“ template for the “connected_as“ label; it can reference
	// top-level response fields and “{value}“ (the extracted identity value).
	DisplayTemplate string `json:"display_template" yaml:"display_template" mapstructure:"display_template"`

	// URL called with the new access token to identify the connected account.
	Endpoint string `json:"endpoint" yaml:"endpoint" mapstructure:"endpoint"`

	// Dotted JSON path of the identity value in the probe response (e.g. “login“).
	IdentityField string `json:"identity_field" yaml:"identity_field" mapstructure:"identity_field"`

	// HTTP method of the identity probe.
	Method VendorIdentityProbeConfigMethod `json:"method,omitempty,omitzero" yaml:"method,omitempty" mapstructure:"method,omitempty"`
}

Request that labels the connected account (“connected_as“) after a successful connect. Unset, the credential is still valid but carries no label.

func (*VendorAuthConfigIdentityProbe) UnmarshalJSON added in v0.42.0

func (j *VendorAuthConfigIdentityProbe) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type VendorAuthConfigIdentityProbe_0 added in v0.42.0

type VendorAuthConfigIdentityProbe_0 = VendorIdentityProbeConfig

type VendorAuthorizationCodeFlowConfig added in v0.40.0

type VendorAuthorizationCodeFlowConfig struct {
	// The vendor's authorization endpoint URL.
	AuthorizeUrl string `json:"authorize_url" yaml:"authorize_url" mapstructure:"authorize_url"`

	// Platform-shipped OAuth application id.
	ClientId string `json:"client_id" yaml:"client_id" mapstructure:"client_id"`

	// OAuth application secret used to exchange the code at the token endpoint.
	ClientSecret string `json:"client_secret" yaml:"client_secret" mapstructure:"client_secret"`

	// Kind corresponds to the JSON schema field "kind".
	Kind string `json:"kind" yaml:"kind" mapstructure:"kind"`

	// The vendor's token endpoint URL.
	TokenUrl string `json:"token_url" yaml:"token_url" mapstructure:"token_url"`
}

OAuth 2.0 authorization-code flow settings for a vendor.

Included so the vendor registry is flow-generic from day 1 even though phase 1 only wires up device flow. Requires a client secret (confidential client) since the redirect-based flow exchanges the code at the token endpoint.

func (*VendorAuthorizationCodeFlowConfig) UnmarshalJSON added in v0.40.0

func (j *VendorAuthorizationCodeFlowConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type VendorDeviceAuthorizationFlowConfig added in v0.40.0

type VendorDeviceAuthorizationFlowConfig struct {
	// The vendor's device authorization endpoint URL.
	AuthorizationEndpoint string `json:"authorization_endpoint" yaml:"authorization_endpoint" mapstructure:"authorization_endpoint"`

	// Platform-shipped OAuth application id (public client, no secret).
	ClientId string `json:"client_id" yaml:"client_id" mapstructure:"client_id"`

	// Kind corresponds to the JSON schema field "kind".
	Kind string `json:"kind" yaml:"kind" mapstructure:"kind"`

	// The vendor's token endpoint URL.
	TokenEndpoint string `json:"token_endpoint" yaml:"token_endpoint" mapstructure:"token_endpoint"`
}

RFC 8628 device flow settings for a vendor.

`client_id` is the platform-shipped OAuth application id (device flow is a public-client flow — no secret). Endpoints are the vendor's device authorization + token endpoints.

func (*VendorDeviceAuthorizationFlowConfig) UnmarshalJSON added in v0.40.0

func (j *VendorDeviceAuthorizationFlowConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type VendorIdentityProbeConfig added in v0.40.0

type VendorIdentityProbeConfig struct {
	// Python “str.format“ template for the “connected_as“ label; it can reference
	// top-level response fields and “{value}“ (the extracted identity value).
	DisplayTemplate string `json:"display_template" yaml:"display_template" mapstructure:"display_template"`

	// URL called with the new access token to identify the connected account.
	Endpoint string `json:"endpoint" yaml:"endpoint" mapstructure:"endpoint"`

	// Dotted JSON path of the identity value in the probe response (e.g. “login“).
	IdentityField string `json:"identity_field" yaml:"identity_field" mapstructure:"identity_field"`

	// HTTP method of the identity probe.
	Method VendorIdentityProbeConfigMethod `json:"method" yaml:"method" mapstructure:"method"`
}

Generic identity-echo protocol config for a vendor.

After the connect flow completes, the platform calls `{method} {endpoint}` with the freshly minted access token, extracts `identity_field` (dotted JSON path) from the response body, and formats it into `display_template` (Python str.format). The result is stored as `connected_as` and returned to the caller.

func (*VendorIdentityProbeConfig) UnmarshalJSON added in v0.40.0

func (j *VendorIdentityProbeConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type VendorIdentityProbeConfigMethod added in v0.40.0

type VendorIdentityProbeConfigMethod string
const VendorIdentityProbeConfigMethodGET VendorIdentityProbeConfigMethod = "GET"
const VendorIdentityProbeConfigMethodPOST VendorIdentityProbeConfigMethod = "POST"

func (*VendorIdentityProbeConfigMethod) UnmarshalJSON added in v0.40.0

func (j *VendorIdentityProbeConfigMethod) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type VendorRegistryConfig added in v0.40.0

type VendorRegistryConfig struct {
	// Verified vendors offered by the agent-driven connect flow, keyed by a short
	// slug (e.g. “github“).
	Entries VendorRegistryConfigEntries `json:"entries,omitempty,omitzero" yaml:"entries,omitempty" mapstructure:"entries,omitempty"`
}

Top-level vendor auth registry.

type VendorRegistryConfigEntries added in v0.40.0

type VendorRegistryConfigEntries map[string]VendorAuthConfig

Verified vendors offered by the agent-driven connect flow, keyed by a short slug (e.g. “github“).

type VendorScopeConfig added in v0.40.0

type VendorScopeConfig struct {
	// Risk class shown on the review page: write and admin scopes carry a warning.
	Classification VendorScopeConfigClassification `json:"classification" yaml:"classification" mapstructure:"classification"`

	// Pre-select this scope on the review page.
	Default bool `json:"default,omitempty,omitzero" yaml:"default,omitempty" mapstructure:"default,omitempty"`

	// Human-facing explanation of the scope, shown on the review page.
	Description string `json:"description,omitempty,omitzero" yaml:"description,omitempty" mapstructure:"description,omitempty"`

	// Scope string as the vendor expects it on the authorize request.
	Name string `json:"name" yaml:"name" mapstructure:"name"`
}

A single OAuth scope exposed by the vendor.

`classification` drives the review-page UX: read scopes are pre-selected by default; write/admin scopes get a warning flag. `description` is human-facing copy displayed on the review page.

func (*VendorScopeConfig) UnmarshalJSON added in v0.40.0

func (j *VendorScopeConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type VendorScopeConfigClassification added in v0.40.0

type VendorScopeConfigClassification string
const VendorScopeConfigClassificationAdmin VendorScopeConfigClassification = "admin"
const VendorScopeConfigClassificationRead VendorScopeConfigClassification = "read"
const VendorScopeConfigClassificationWrite VendorScopeConfigClassification = "write"

func (*VendorScopeConfigClassification) UnmarshalJSON added in v0.40.0

func (j *VendorScopeConfigClassification) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type WorkerConfig

type WorkerConfig struct {
	// Maximum jobs one worker process runs at once (1 = serial). Postgres only:
	// SQLite requires 1, because a job's handler holds the database write lock across
	// its upstream call, so a second concurrent job's writes would time out. Each
	// in-flight job holds about 2 admin-DB connections at once (its handler
	// transaction plus the run-time authorization or credential-audit session it
	// opens), so “2 * concurrency“ must stay below “databases.admin.pool_max“,
	// leaving the remainder for HTTP requests and other background work in the same
	// process.
	Concurrency int `json:"concurrency" yaml:"concurrency" mapstructure:"concurrency"`

	// On graceful shutdown, how long (seconds) the worker waits for in-flight jobs to
	// finish. Past it the worker stops; a still-“RUNNING“ job is reclaimed via its
	// visibility timeout after restart, so no work is dropped.
	DrainTimeoutS float64 `json:"drain_timeout_s" yaml:"drain_timeout_s" mapstructure:"drain_timeout_s"`

	// Total claims of a repeatedly failing job before it is dead-lettered instead of
	// requeued.
	MaxAttempts int `json:"max_attempts" yaml:"max_attempts" mapstructure:"max_attempts"`

	// Idle wait (seconds) between job-queue polls when nothing is claimable. A job
	// enqueued in the same process wakes the worker immediately, so this mainly
	// bounds pickup latency for jobs enqueued by another process and how quickly
	// visibility-expired jobs are reclaimed. Every poll is a write transaction (the
	// claim is an “UPDATE“) even when the queue is empty — on SQLite it takes the
	// database write lock that request writes also wait on — so each process issues
	// about “1 / poll_interval_s“ of them per second while idle.
	PollIntervalS float64 `json:"poll_interval_s" yaml:"poll_interval_s" mapstructure:"poll_interval_s"`

	// First delay, in seconds, before the worker retries after losing its database
	// connection. Doubles on each further failed attempt up to
	// “reconnect_backoff_max_s“; each delay is then jittered into the upper half of
	// its value so workers sharing a database do not retry in lockstep.
	ReconnectBackoffBaseS float64 `json:"reconnect_backoff_base_s" yaml:"reconnect_backoff_base_s" mapstructure:"reconnect_backoff_base_s"`

	// Cap, in seconds, on the worker's reconnect delay while the database is
	// unreachable — a recovered database is picked up within this long.
	ReconnectBackoffMaxS float64 `json:"reconnect_backoff_max_s" yaml:"reconnect_backoff_max_s" mapstructure:"reconnect_backoff_max_s"`

	// Base delay (seconds) before a failed job becomes claimable again: attempt “n“
	// waits “min(retry_backoff_base_s * 2**(n-1), retry_backoff_max_s)“.
	RetryBackoffBaseS float64 `json:"retry_backoff_base_s" yaml:"retry_backoff_base_s" mapstructure:"retry_backoff_base_s"`

	// Cap (seconds) on the exponential backoff between attempts of a failed job.
	RetryBackoffMaxS float64 `json:"retry_backoff_max_s" yaml:"retry_backoff_max_s" mapstructure:"retry_backoff_max_s"`

	// Seconds between the worker's retention sweeps, which expire lapsed execution
	// approvals and delete expired job results and long-expired access/refresh token
	// rows. Measured in wall time, independent of “poll_interval_s“ and wake-ups.
	SweepIntervalS float64 `json:"sweep_interval_s" yaml:"sweep_interval_s" mapstructure:"sweep_interval_s"`

	// Seconds a claimed (“RUNNING“) job stays invisible to other workers; past it
	// the job is reclaimed and run again. Size it safely above the longest expected
	// handler runtime (upstream timeout plus slack) so a healthy but slow job is
	// never reclaimed mid-flight and processed twice.
	VisibilityTimeoutS float64 `json:"visibility_timeout_s" yaml:"visibility_timeout_s" mapstructure:"visibility_timeout_s"`
}

Background job-worker durability knobs.

The worker claims a job, sets a **visibility deadline** (“visibility_timeout_s“ from claim), and processes it. A job left “RUNNING“ past that deadline by a crashed worker/pod is reclaimed on a later poll. A handler failure requeues the job with capped exponential backoff up to “max_attempts“ claims; beyond that it is dead-lettered (poison-message handling) rather than looped forever. A handler that raises “NonRetryableJobError“ (a failure no retry can change, such as an import whose spec fails validation) fails the job on that attempt instead.

Each claim is a single atomic “UPDATE“ (“FOR UPDATE SKIP LOCKED“ on Postgres, a serialised write transaction on SQLite), so any number of worker loops — across processes or replicas, each running up to “concurrency“ jobs — can poll the same queue without double-claiming a job.

func (*WorkerConfig) UnmarshalJSON

func (j *WorkerConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL