Configuration
acdp-registry is configured by a TOML file layered with environment-variable
overrides. There is no clap CLI — config loading is the config crate plus
env vars (same dependency-minimization principle as acdp-rs). The schema is
RegistryConfig in crates/acdp-registry-types/src/config.rs; a worked example
is config/registry.example.toml.
Loading and precedence
built-in defaults < TOML file < ACDP_REGISTRY_* env vars-
An
ACDP_REGISTRY_<SECTION>__<FIELD>variable that is set but empty counts as absent (the TOML value stays) and is logged as a warning at startup, becausedocker composerenders an unset${VAR:-}as empty. -
The TOML file path comes from
ACDP_REGISTRY_CONFIG; when unset the binary falls back to its defaults (dev runs use SQLite under./data/registry.db). -
Env overrides use
ACDP_REGISTRY_<SECTION>__<FIELD>— a single underscore after theACDP_REGISTRYprefix, then double underscores between nesting levels:export ACDP_REGISTRY_STORAGE__POSTGRES_URL="postgres://acdp:acdp@db:5432/acdp" export ACDP_REGISTRY_AUTH__JWT_SECRET="$(openssl rand -base64 32)" export ACDP_REGISTRY_AUTH__JWT_SIGNING_ALG="EdDSA"
List-valued fields from the environment
Exactly two fields accept a comma-separated env value, and they are named
explicitly in the loader (with_list_parse_key, config.rs):
export ACDP_REGISTRY_AUTH__DID_METHODS="did:web,did:key"
export ACDP_REGISTRY_REGISTRY__PROFILES="acdp-registry-core,acdp-registry-discovery"Every other field — including base64 secrets, which is the reason the rule is a whitelist rather than "split anything containing a comma" — deserializes from the environment as a plain scalar. A comma in one of those values is part of the value.
Settings that cannot be expressed as env vars at all — and their escape hatches
auth.tenant_agents, playground.pinned_keys and keyless.oidc_issuers are lists of structs.
Comma-splitting can only ever produce a Vec<String>, so the ordinary
ACDP_REGISTRY_<SECTION>__<FIELD> mechanism cannot represent them. On a platform
with no config-file mechanism — Railway "deploy from image" services are the
motivating case — they would otherwise be unreachable.
Three JSON escape hatches exist for exactly this. They are read directly rather than through the env layer, and are applied after every other source, so they win if both a TOML file and the variable are present:
| Variable | Sets | Value |
|---|---|---|
ACDP_REGISTRY_AUTH__TENANT_AGENTS_JSON | auth.tenant_agents | JSON array of {agent_did, tenant_id} |
ACDP_REGISTRY_AUTH__READ_TOKENS_JSON | auth.read_tokens | JSON array of {id, did, sha256, operator_administered, expires_at?, tenant?} (hashes only, never tokens) |
ACDP_REGISTRY_PLAYGROUND__PINNED_KEYS_JSON | playground.pinned_keys | JSON array of {agent_did, public_key_b64, algorithm?, valid_from?, valid_until?} |
ACDP_REGISTRY_KEYLESS__OIDC_ISSUERS_JSON | keyless.oidc_issuers | JSON array of {issuer, jwks_uri?} |
export ACDP_REGISTRY_AUTH__TENANT_AGENTS_JSON='[{"agent_did":"did:web:agent.example.com","tenant_id":"acme"}]'Invalid JSON fails startup with the variable's name in the message; it is never silently ignored. Note that these replace the whole list rather than merging into a TOML-configured one.
Environment variables outside the config tree
These are read directly by the binary and have no TOML equivalent, so they do not appear in the Reference below:
| Variable | Effect | Default |
|---|---|---|
ACDP_REGISTRY_CONFIG | Path to the TOML file. Unset means built-in defaults only. | unset |
ACDP_LOG_FORMAT | json or pretty. pretty is for interactive runs; json is what you want behind a log collector. | json |
RUST_LOG | Standard tracing filter. When unset the binary uses info,acdp=info,acdp_registry=info. | unset |
ACDP_TEST_EGRESS is not an operator setting. The variable is read only
by a test build of the binary, one compiled with the acdp-registry-core
test-egress feature, which only this repository's [dev-dependencies]
enable. cargo build, cargo build --release and the published image ignore
it entirely. The spawned-binary keyless test (tests/keyless_e2e.rs) uses it
to point the binary's DID resolver and keyless issuer-key fetcher at a
loopback HTTPS host.
Startup validation
The binary validates config before serving and refuses to boot on a misconfig
(validate_config in crates/acdp-registry-server/src/main.rs). It enforces:
-
Lifecycle state — separately from
validate_config, the binary refuses to start with[lifecycle] enabled = falseover a store that already holds lifecycle state; see[lifecycle]. -
Auth —
jwt_signing_alg∈ EdDSA. EdDSA requires a non-emptyjwt_private_key_pem. HS256 with an emptyjwt_secretrequiresallow_ephemeral_secret = true, otherwise it fails. A non-emptyjwt_secretis checked whether or not auth is enabled: it is rejected if it is the literalchangeme(case-insensitive, after trimming), and must decode to ≥32 bytes. Under EdDSAjwt_secretis not examined at all.Note the asymmetry, and note that it is only partial. Inside
validate_configthe non-empty-jwt_secretrule is the only one in this bullet not gated onauth.enabled— but "gated here" is not the same as "not enforced", and the three gated rules do not behave alike. Measured against the binary withauth.enabled = false:- Algorithm check — an unrecognised
jwt_signing_algboots, falling through to the HS256 default. Genuinely not enforced. - Empty-secret rule — an empty secret boots. Genuinely not enforced, and deliberately: that is a supported configuration.
- EdDSA
jwt_private_key_pem— an empty PEM still refuses to boot, from the serve path, after migrations have run. Gated here, enforced anyway, late.
So a bad
jwt_secretis refused either way and refused before migrations; a missing EdDSA PEM is refused either way but only after them. Closing that second case is not done here. - Algorithm check — an unrecognised
-
Admin tokens — every entry in
auth.admin_tokensmust be non-blank and carry no leading or trailing whitespace. An empty list remains valid and still means "admin routes disabled"; it is a bad entry that is refused. One bad entry is enough: the allowlist compare folds over every entry, so a blank one is admitted alongside real tokens while the list still looks populated. A bareAuthorization: Bearermatches a blank entry over HTTP/2, which preserves trailing header whitespace (HTTP/1.1 strips it before the handler sees it, so the same request is refused there). -
Webhook — when
enabled,urlmust be non-empty and pass the SSRF policy (HTTPS, no private/internal authorities), andsecretmust be non-empty. -
Multi-tenancy — a non-empty
[[auth.tenant_agents]]requiresrequire_tenant = true(you can't half-enable tenancy). Either tenancy signal — a non-empty[[auth.tenant_agents]]orrequire_tenant = true— also requires a tenancy-aware storage backend (SQLite/Postgres). The memory backend records no tenant and reports the reserveddefaultfor every row, so every tenant-scoped read would return zero rows; an untenanted memory registry still starts. -
Tenant header trust (#374) —
auth.tenant_header_trust = "trusted_proxies"with an emptyrate_limit.trusted_proxiesis refused (no peer could ever be trusted).require_tenant = truewith no[[auth.tenant_agents]]and the header distrusted ("none", the default) is refused (no request could ever resolve a tenant). A/0entry inrate_limit.trusted_proxies(0.0.0.0/0,::/0) is refused: it would trust every peer (#391). One warning, not a refusal:any_peeron a non-loopbackbind. (0.3.x also warned when the unset key fell back toany_peer; since 0.4.0 an unset key meansnonein every mode, #386.) -
Bind safety — a non-loopback
bindwith neither TLS nor auth requires an explicitallow_public_bind = true. -
TLS — when
tls.enabled,cert_pathandkey_pathmust exist on disk. -
DID methods —
auth.did_methodsentries must bedid:webordid:key, anddid:webmust be present (RFC-ACDP-0007 §3.1). -
Playground —
playground.enabled = truewithplayground.pinned_only = trueand an empty[[playground.pinned_keys]]list is refused at startup, whether or not[receipt]is configured. Not because it is too strict:pinned_onlyhas no effect whilepinned_keysis empty, so the registry would fall through to the fully unverified publish path, accepting unverified publishes from every non-did:keyagent (did:keyidentities are self-verifying and never reach this gate). Add a pinned key, or setplayground.enabled = false. -
Pinned-key entries — each
[[playground.pinned_keys]]entry must be usable, not merely present. Five refusals, each naming the offending entry by index and DID:algorithmis noted25519orecdsa-p256(exact match, case-sensitive).public_key_b64is not valid base64.- an
ed25519key does not decode to 32 bytes. - an
ecdsa-p256key does not decode to 65 bytes, or does not begin0x04(SEC1 uncompressed). valid_from >= valid_until— a window that can never be open.
These are checked regardless of
playground.enabled, so a latent typo surfaces before the flag is flipped rather than after. Startup is the only place the detail is legible: at request time such an entry fails as aninternal_error, whose wire message is redacted to the static string"internal error"(RFC-ACDP-0007 §5), leaving the operator a 500 with no indication that the cause is a config typo.Upgrade note — a config that boots today can be refused after this change. Any entry matching one of the five above is now fatal, however harmless it looked before. Three shapes account for essentially all of it, in rising order of how quiet they were:
- A rotated-out entry left in place with broken key material — expired
and malformed. Completely inert before:
pinned_for_atfilters on the validity window, so nothing ever decoded it. Nothing was wrong at runtime, and now the registry will not start. - Any broken entry at all while
playground.enabled = false. These rules do not consultenabled, so a section you consider switched off is still validated. - A currently-live entry with a typo'd
algorithmor bad key material. This one was already failing — but only for that single agent's publishes, as an opaque 500, which is why it can sit unnoticed for a long time. It is now refused up front for everyone.
Delete rotated-out entries rather than leaving them broken. If a registry that has been running for months suddenly will not start after an upgrade, this is the first thing to check.
Not a refusal — a startup warning: a list where no entry is currently within its validity window (all expired, or all future-dated). This is not fatal because expiry is time-dependent — refusing would make bootability a function of the wall clock rather than of the config file — and because in lax mode the state is identical to having no pins at all, which is supported. The warning branches, because the two modes do opposite things: with
pinned_only = trueeverydid:webpublish is rejected until a key is rotated in; withpinned_only = falsepublishes from those agents are accepted with no signature check, i.e. pinning is silently inert. The second is the one worth an alert.The same rules gate
POST /admin/pinned-keys/reload, so a reload cannot install a config startup would refuse — see HTTP-API.md. Both doors call one function,validate_playground_configincrates/acdp-registry-core/src/playground.rs, rather than each keeping its own copy of the rules. -
Receipts — a configured
[receipt]key must parse (exactly one source, valid base64, 32 bytes), and is incompatible withplayground.enabled = trueunlessplayground.pinned_only = truewith at least one[[playground.pinned_keys]]entry (RFC-ACDP-0010 §7: a receipts registry has no unverified publish path). -
Profile allowlist (REG-5) — every entry in
registry.profilesmust be one of the ten registry profiles the pinned ACDP spec defines (REGISTRY_ADVERTISABLE_PROFILESincrates/acdp-registry-types/src/ config.rs:acdp-registry-core,acdp-registry-discovery,acdp-registry-federated,acdp-registry-receipts,acdp-registry-head-receipts,acdp-registry-transparency-log,acdp-registry-lifecycle,acdp-registry-changes,acdp-registry-events,acdp-registry-keyless).acdp-registry-changes,acdp-registry-eventsandacdp-registry-keylessare advertised automatically when[changes],[events]and[keyless]are enabled (see[changes],[events]and[keyless]); listing one without enabling it is refused. This is checked before any otherregistry.profiles-dependent guard below, so a typo or an out-of-scope profile is reported first.acdp-log-witnessis explicitly rejected with a dedicated message: a witness is not a registry (RFC-ACDP-0015 §6.1) — a registry MAY aggregate cosignatures underacdp-registry-transparency-logwithout ever advertisingacdp-log-witnessitself. A non-Rust consumer (a fixture, a console, a validator) can read the same set as data fromdocs/advertisable-profiles.json— vendor it at anacdp-registry-types/vX.Y.Zrelease tag (e.g.https://raw.githubusercontent.com/agentcontextdistributionprotocol/acdp-registry-rs/acdp-registry-types/v0.2.0/docs/advertisable-profiles.json) and diff it on a version bump. A unit test (advertisable_profiles_json_matches_const) keeps it identical to the const, so a profile removed or renamed here turns this repo's CI red until the file is updated. -
0.3.0 profiles —
receipt.head_receipts = truerequires a configured[receipt]signing key (RFC-ACDP-0011 §9: head receipts are signed with the receipt key).log.enabled = truelikewise requires a[receipt]key (RFC-ACDP-0012 §11: leaves bind receipt hashes and checkpoints sign with the receipt key), a durable storage backend (SQLite/Postgres — the memory backend cannot honor the append-only history commitment), and a well-formedlog.instance([a-z0-9-]{1,32}). Listingacdp-registry-head-receipts,acdp-registry-lifecycle, oracdp-registry-transparency-loginregistry.profileswithout enabling the matching feature is refused as a false capability advertisement; so is listingacdp-registry-receiptswithout a configured[receipt]signing key. -
Witnesses (0.4.0) —
[[witnesses]]requireslog.enabled = true(RFC-ACDP-0015 §6.1: there are no checkpoints to witness without a log); eachdidmust be adid:webDID and eachurlmust pass the SSRF policy (HTTPS, non-private host). -
Rate limiting (FEAT-06) — every
rate_limit.trusted_proxiesentry must be a valid CIDR (or bare IP), so a typo fails the boot rather than silently disabling XFF trust, and no entry may have a/0prefix (#391: it would trust XFF, and undertrusted_proxiestenant trust, from every peer). A non-emptytrusted_proxieswithrate_limit.enabled = falseis refused (the list would be parsed for nothing) — unlessread_limits.enabled = trueorauth.tenant_header_trust = "trusted_proxies", the list's other consumers.rate_limit.forwarded_header_trust = "any_peer"boots with a warning that names its assumption (see[rate_limit]). -
Read limits (RFC-ACDP-0008 §4.3) —
read_limits.enabled = truewith bothanonymous_per_minuteandauthenticated_per_minuteat0is refused (a limiter that limits nothing), and so isadvertise = truewithoutenabled(a ceiling the registry would not enforce).advertise = truelogs a warning naming acdp 0.19 consumers, or a different one when no ceiling qualifies. -
Metrics (FEAT-10) — when
metrics.enabled,duration_bucketsmust be non-empty, positive, finite, and strictly increasing (Prometheus histogram bounds). -
Keyless (RFC-ACDP-0021) — nothing in
[keyless]is read whileenabled = false. Withenabled = truethe binary refuses to start unless:lifecycle.enabled = trueand a[receipt]signing key are set (an attestation is a receipted body signed with the receipt key, §5.3);log.enabled = true(every attestation is logged, §5.2 step 8); the binary'sacdp_versionclaim is at least 0.5.0; at least one[[keyless.oidc_issuers]]or[[keyless.spiffe_trust_domains]]entry exists; and every key passes the bounds in[keyless]. Listingacdp-registry-keylessinregistry.profileswithenabled = falseis refused as a false capability advertisement.
Reference
Defaults below are the struct defaults; the example TOML may set different
values for illustration. Env var = ACDP_REGISTRY_ + the bracketed path.
[registry]
| Key | Type | Default | Notes |
|---|---|---|---|
authority | string | — | Bare lowercase DNS name. Mints ctx_id and is the did:web registry id. |
port | u16 | 8443 | Listen port. |
bind | string | 127.0.0.1 | Bind address. Non-loopback needs TLS/auth or allow_public_bind. |
allow_public_bind | bool | false | Opt-in to bind a public interface without TLS/auth. |
base_url | string | https://{authority} | Public URL advertised to consumers / federation control plane. |
profiles | string[] | ["acdp-registry-core","acdp-registry-discovery"] | Advertised in capabilities. Must be a subset of the ten acdp-registry-* profiles the pinned spec defines (acdp-registry-changes needs [changes] enabled = true, acdp-registry-events needs [events] enabled = true, acdp-registry-keyless needs [keyless] enabled = true) — any other value (including acdp-log-witness, which is not a registry profile) fails startup. |
cross_registry_resolution | bool | true | Forward foreign ctx_ids to their home registry; false returns 404 instead. |
[registry.tls]
| Key | Type | Default | Notes |
|---|---|---|---|
enabled | bool | false | Serve HTTPS directly via rustls. Usually terminate TLS upstream instead. |
cert_path | path | — | Required when enabled. |
key_path | path | — | Required when enabled. |
[registry.cors]
| Key | Type | Default | Notes |
|---|---|---|---|
allowed_origins | string[] | [] | Empty disables CORS (no headers sent). List your UI origin(s) to opt in. A configured origin may also read the Location header of a POST /contexts reply (Access-Control-Expose-Headers: location). |
public_reads | bool | false | Let any origin make anonymous reads: Access-Control-Allow-Origin: * on GET/HEAD and their preflights, no credentials, no request header beyond the CORS-safelisted ones (so a browser cannot send Authorization cross-origin), and location and x-request-id exposed. Every cross-origin request is therefore an anonymous read (RFC-ACDP-0008 §6.3) and sees exactly what an anonymous curl sees. POST cannot be preflighted cross-origin (a header-less text/plain POST still gets * on its response, as CORS only filters methods at preflight, but it is anonymous and refused by the JSON extractor). For a public registry that browser-side verifiers should be able to read. Leave it off on a registry reachable only from a private network, and set metrics.bearer_token if /metrics is protected only by source IP: any page a visitor on an allowed IP opens could otherwise read it. Mutually exclusive with allowed_origins (refused at startup). Env: ACDP_REGISTRY_REGISTRY__CORS__PUBLIC_READS. |
[storage]
| Key | Type | Default | Notes |
|---|---|---|---|
backend | enum | sqlite | postgres | sqlite | memory. Must match the compiled storage feature. |
postgres_url | string | — | Required when backend = "postgres". |
sqlite_path | path | ./data/registry.db | SQLite file. |
max_connections | u32 | 20 | sqlx pool size. |
The storage backend is also chosen at compile time via the
acdp-registry-serverCargo features (storage-sqlitedefault,storage-pg,storage-memory). Thebackendconfig key must agree with the built binary. The memory backend is demo/ephemeral only (nothing survives a restart), and itsq=search is a case-insensitive substring match of the whole query, not the stemmed all-words match of SQLite/Postgres.
[auth]
| Key | Type | Default | Notes |
|---|---|---|---|
enabled | bool | false | Mounts /auth/* and turns on the bearer/visibility gates. |
did_methods | string[] | ["did:web"] | Allowed DID methods; advertised in capabilities. |
jwt_signing_alg | string | HS256 | HS256 or EdDSA. See AUTHENTICATION.md. |
jwt_secret | string | "" | HS256 secret — base64, ≥32 bytes. Never published. |
allow_ephemeral_secret | bool | false | HS256 dev escape hatch: random process-lifetime key when jwt_secret is empty. |
jwt_private_key_pem | string | "" | EdDSA Ed25519 private key (PKCS#8 PEM). Required for EdDSA. |
jwt_kid | string | "" | Optional explicit JWKS key id; default is the public-key fingerprint. |
token_ttl_seconds | u64 | 3600 | JWT lifetime. |
challenge_ttl_seconds | u64 | 300 | Challenge nonce validity. |
token_leeway_seconds | u64 | 30 | Clock-skew tolerance for exp. |
anonymous_public_reads | bool | false | Allow unauthenticated reads of public contexts. Opt in for discovery hubs. |
require_tenant | bool | false | Strict multi-tenancy: requests resolving to no tenant are denied. See MULTI-TENANCY.md. |
tenant_header_trust | "none" | "trusted_proxies" | "any_peer" | unset: "none" in every mode (0.4.0, #386; 0.3.x used "any_peer" when require_tenant = false) | Who may select a tenant with X-Tenant-Id when no signed claim or agent binding applies. trusted_proxies: only when the immediate TCP peer (not X-Forwarded-For) is in rate_limit.trusted_proxies. An untrusted header that disagrees with the claim/binding, or has none to agree with, is 403 not_authorized. See MULTI-TENANCY.md. |
admin_tokens | string[] | [] | Bearer tokens for /admin/*. Entries must be non-empty and not whitespace-only (startup validation). An empty list disables every admin-bearer-gated route: /admin/status, /admin/lineages/{id}/audit, /admin/contexts/{id}/retract, /admin/contexts/{id}/republish, GET /admin/contexts, /admin/pinned-keys/reload. See HTTP-API.md#admin. |
max_read_tokens_per_did | usize | 5 | Most [[auth.read_tokens]] entries one DID may hold. At least 2, so a token can be rotated without a gap. |
[[auth.tenant_agents]]
Repeatable. Binds a producing/consuming agent to a tenant.
| Key | Type | Notes |
|---|---|---|
agent_did | string | Full DID of the agent. |
tenant_id | string | Tenant the agent is scoped to (default is reserved). |
[[auth.read_tokens]]
Repeatable. One RFC-ACDP-0008 §6.2 bearer_static read token, stored as a
hash. Requires auth.enabled = true. Mint with acdp-registry read-token generate. See AUTHENTICATION.md.
| Key | Type | Notes |
|---|---|---|
id | string | Operator label, unique. Appears in startup messages; the token never does. |
did | string | The requester DID the token reads as. Must use a method in auth.did_methods. |
sha256 | string | Lowercase hex SHA-256 of the full token (64 characters), unique. |
operator_administered | bool | Must be true: config may bind only a DID this operator administers. |
expires_at | RFC 3339 timestamp | Optional. The token stops validating at this instant. |
tenant | string | Optional tenant binding (not default); falls back to the DID's [[auth.tenant_agents]] entry. |
Startup refuses entries while auth.enabled = false, max_read_tokens_per_did
below 2, an empty or duplicate id, a malformed or duplicate hash, a DID of an
unaccepted method, operator_administered other than true, an empty or
reserved tenant, and more than max_read_tokens_per_did entries per DID. It
warns about an already-expired entry and about a DID holding a single token. Removing an entry and restarting revokes the token.
[[auth.revocation_feeds]]
Repeatable. A peer issuer (for example a control plane) whose revocations this
registry mirrors. This registry only consumes feeds; it serves no
/auth/revocations of its own (deferred, see STATUS.md).
| Key | Type | Default | Notes |
|---|---|---|---|
issuer | string | — | Peer DID; each fetched entry's iss must match. |
feed_url | string | — | The peer issuer's /auth/revocations URL. |
admin_token | string | — | Bearer for the peer's feed. |
poll_seconds | u64 | 300 | Poll interval. |
[webhook]
| Key | Type | Default | Notes |
|---|---|---|---|
enabled | bool | false | |
url | string | "" | HMAC-signed POST target. SSRF-policy gated. |
secret | string | "" | HMAC-SHA256 key; must be non-empty when enabled. |
timeout_seconds | u64 | 5 | Per-delivery timeout. |
max_retries | u32 | 3 | Exponential backoff (250 ms → cap 15 s). |
queue_capacity | usize | 1024 | Bounded in-memory queue; events drop (with a warn) when full. |
See WEBHOOKS.md.
[limits]
| Key | Type | Default | Notes |
|---|---|---|---|
max_payload_bytes | u64 | 1048576 | Publish body cap (enforced by the body-limit layer on every route). |
max_embedded_bytes | u64 | 65536 | Cap on an inline data_ref value. |
idempotency_key_ttl_seconds | u64 | 86400 | Idempotency-Key replay window; advertised in capabilities. |
publish_rate_per_minute | u32 | 60 | Per-agent POST /contexts cap; 0 disables. In-memory, per-process. |
challenge_rate_per_minute | u32 | 60 | Per-agent POST /auth/challenge cap; 0 disables. In-memory, per-process. |
These are per-process in-memory fixed-window counters — see OPERATIONS.md · Rate limiting for the multi-replica caveat.
[rate_limit] (FEAT-06)
Per-IP and process-global rate limiting on the /auth/* endpoints (token
issuance / refresh / revoke), applied as middleware over the whole /auth/*
subrouter — on top of the per-agent [limits] budgets. The [limits] buckets
key on the caller-supplied agent_id, which an unauthenticated attacker
controls and can rotate to defeat the per-key limit; these two bounds are
attacker-independent.
| Key | Type | Default | Notes |
|---|---|---|---|
enabled | bool | true | Master switch. On by default — /auth/* is the most attacker-controllable surface. |
per_ip_per_minute | u32 | 60 | Per-resolved-client-IP cap on /auth/*; 0 disables the per-IP bound. |
global_per_minute | u32 | 6000 | Whole-process ceiling across all IPs; 0 disables it. Bounds a source-IP-rotating flood. |
trusted_proxies | list<CIDR> | [] | Reverse-proxy CIDRs whose X-Forwarded-For is trusted. Empty = never trust XFF. Also the gateway list for auth.tenant_header_trust = "trusted_proxies", matched against the immediate TCP peer; allowed with enabled = false in that mode. Entries are matched as written against the IPv4-canonicalised peer: list IPv4 gateways in IPv4 form (an ::ffff:… entry never matches). A /0 entry is refused at startup. |
forwarded_header_trust | "trusted_proxies" | "any_peer" | "trusted_proxies" | When X-Forwarded-For may name the client for every per-IP limiter: /auth/*, keyless minting and anonymous reads ([read_limits]). trusted_proxies: only from a TCP peer in trusted_proxies. any_peer: from every peer — for a platform edge whose addresses cannot be listed. See below. |
forwarded_skip_rightmost | u8 (0–4) | 0 | How many rightmost X-Forwarded-For entries the edge appends after the client, discarded before the client is read. Railway rewrites the header to <client>, <edge address>, so it needs 1. Refused at startup above 4, or while the header is never read (trusted_proxies mode with no trusted_proxies). See below. |
backend | "memory" | "postgres" | "memory" | Where the two ceilings above are counted. memory: per process (each replica counts for itself). postgres: counted once across every replica sharing the database — see Shared backend below. |
backend_unavailable | "allow" | "deny" | "allow" | Only with backend = "postgres". What to do when the database cannot answer a check: allow falls back to the per-process limit; deny refuses with 429 + Retry-After: 5. |
backend_timeout_ms | u64 | 250 | Only with backend = "postgres". Per-check timeout against the database; must be > 0. |
backend_prune_seconds | u64 | 300 | Only with backend = "postgres". How often stale counter rows are deleted; must be > 0. |
Shared backend (multi-replica). With backend = "postgres", the per-IP and
global ceilings are counted in the registry's own Postgres database (table
rate_limit_windows, an UNLOGGED table) so they hold across replicas instead
of per replica. The in-memory limiter stays in front as a pre-filter, with the
same limits: a request it rejects never touches the database, so database writes
are bounded by the in-memory limits (at most 2 × global_per_minute statements per
limiter window per replica) however large a flood is, and enabling the shared backend can
only tighten enforcement relative to per-process limiting. Startup refuses the
combination unless storage.backend = "postgres", enabled = true and
global_per_minute > 0 (the global ceiling is what bounds database load when an
attacker rotates source IPs), and refuses a zero backend_timeout_ms or
backend_prune_seconds. If the database cannot answer, backend_unavailable
decides: the default allow degrades to exactly today's per-process limiting
rather than turning a database blip into a token-issuance outage; a stalled check
adds up to backend_timeout_ms to a request (two checks per /auth/* request).
The counters are ephemeral: after a database crash or standby promotion one
window's budget resets once. Nothing here is needed on a single replica.
Client-IP resolution & the trusted-proxy decision (security). The client
IP defaults to the TCP socket peer. X-Forwarded-For is caller-supplied and
is never trusted unless the socket peer is itself in one of the
trusted_proxies ranges — otherwise any client could spoof its source IP to
evade the per-IP budget or frame another address. When the peer is a trusted
proxy, the real client is taken from the rightmost X-Forwarded-For entry that
is not itself a trusted proxy (walking a chain of trusted hops from the right).
Several X-Forwarded-For header lines are read as one list in arrival order,
so a proxy that adds its hop as a new line rather than appending still has
the last word.
List only proxies you operate; a wrong entry is a spoofing hole. CIDRs are
validated at startup — a malformed entry fails the boot rather than silently
disabling XFF trust.
forwarded_header_trust = "any_peer" treats every TCP peer as a trusted
proxy, so the rightmost X-Forwarded-For entry not itself in
trusted_proxies names the client. It exists for platforms (Railway, for
example) whose edge addresses cannot be enumerated. It is safe only when
every request reaches the registry through a proxy that always appends the
address it received the request from: a client can then forge entries only to
the left of that hop, and those are never read. If the registry is reachable
directly, a client picks its own bucket. Startup logs a warning naming this
assumption. A malformed or zone-scoped hop falls back to the TCP peer.
forwarded_skip_rightmost = N discards the last N entries before that walk,
for an edge that appends its own address after the client's. Railway is one:
whatever X-Forwarded-For the client sends, the app receives
<client>, <edge address>, and the edge address changes from request to
request. With the default 0 every per-IP limiter keys on the edge address,
so one client rotates through several buckets and many clients share each one
(#524). Railway needs any_peer with forwarded_skip_rightmost = 1. A chain
too short to hold a client after the skip, or a skipped entry that is not an
address, falls back to the TCP peer.
To find N, look at what your edge actually delivers. For example, deploy a
throwaway echo container (such as mendhak/http-https-echo) behind the same
edge and send it a request with a forged X-Forwarded-For: 203.0.113.9. N is
the number of entries to the right of your real address. If the forged value
survives, the edge appends rather than rewrites, and the hop just left of the
skipped ones must be the one the edge wrote.
Which ceilings are per replica depends on
backend. With the defaultbackend = "memory"this is the same per-process, in-memory caveat as[limits]: behind a load balancer withtrusted_proxiesset, each replica limits per real client IP, and bothper_ip_per_minuteandglobal_per_minuteare per replica. Withbackend = "postgres"both are counted once across every replica sharing the database (see Shared backend above) — except while the database cannot answer andbackend_unavailable = "allow", when they fall back to per-replica counting. The[limits]per-agent budgets stay per-process under either backend. Requests are admitted or rejected before any DID resolution, so the SSRF/DNS path never runs for a throttled request.
[read_limits] (ACDP 0.5.0)
RFC-ACDP-0008 §4.3 read rate limits on every data-plane GET/HEAD route
(contexts, search, lineages, /log/*, /changes, GET /subscriptions/{id},
GET /key-attestations). A refused read is 429 rate_limited with
Retry-After, decided before the handler runs, so a throttled consumer never
sees a 404 or 403. Capabilities, did.json, JWKS, health, /metrics,
/admin/* and /auth/* are never read-limited. See
HTTP-API.md · Rate limits.
| Key | Type | Default | Notes |
|---|---|---|---|
enabled | bool | false | Master switch. |
anonymous_per_minute | u32 | 600 | Per client address (an IPv6 client by its /64), resolved by the [rate_limit] forwarded-header policy. 0: anonymous reads unlimited. |
authenticated_per_minute | u32 | 1200 | Per requester DID, for a request carrying a valid bearer token. 0: authenticated reads unlimited. |
advertise | bool | false | Advertise the budgets as limits.max_reads_per_minute (only with auth.enabled) and limits.max_anonymous_reads_per_minute (only with auth.anonymous_public_reads), RFC-ACDP-0007 §3.2. A 0 budget is never advertised. Needs enabled. Leave off while any consumer is on acdp 0.19 or older (Seam included): their limits is closed and they reject the whole capabilities document. |
Each budget is a fixed 60-second window, in memory and per replica: with
N replicas behind a balancer a client can get up to N × the budget. Behind a
proxy, set rate_limit.trusted_proxies (or forwarded_header_trust = "any_peer") before enabling this; otherwise every client shares the proxy's
address and therefore one bucket. A request with a present but invalid bearer
token is charged to its client address, then refused 403.
Enforcing and advertising are separate on purpose (RFC-ACDP-0007 §3.2 rollout note): RFC-ACDP-0008 §4.3 says a registry SHOULD NOT advertise the read ceilings until the consumers it serves track the 0.5.0 schema. An advertised ceiling is per replica, so it is a floor a client can rely on.
Env: ACDP_REGISTRY_READ_LIMITS__ENABLED,
ACDP_REGISTRY_READ_LIMITS__ANONYMOUS_PER_MINUTE,
ACDP_REGISTRY_READ_LIMITS__AUTHENTICATED_PER_MINUTE,
ACDP_REGISTRY_READ_LIMITS__ADVERTISE.
[metrics] (FEAT-10)
Prometheus /metrics endpoint (text exposition, version=0.0.4). Off by
default. When enabled, GET /metrics is mounted outside the ACDP auth
pipeline and the rate limiter so a scraper reaches it unimpeded, and a
process-global recorder captures HTTP request metrics plus domain counters.
| Key | Type | Default | Notes |
|---|---|---|---|
enabled | bool | false | Mount /metrics and start recording. |
bearer_token | string | "" | When set, /metrics requires Authorization: Bearer <token> and answers 401 otherwise. Empty = open, the default. A whitespace-only value is refused at startup when enabled = true (#162): it would trim to empty and silently leave the endpoint open. Surrounding whitespace on an otherwise real token is accepted — both the configured and the presented token are trimmed before comparison. |
duration_buckets | list<f64> | web-latency ladder | Buckets (seconds) for the request-latency histogram; must be positive and strictly increasing. |
See HTTP-API.md · GET /metrics for the
exposed metric names.
[playground]
Never enable in production — setting enabled = true skips DID-signature
verification on publishes from non-did:key agents, regardless of which Cargo
features the binary was built with. (did:key publishes are verified before
the playground branch runs and are unaffected — see below — and a pinned
agent under [[playground.pinned_keys]] is still cryptographically verified
even with enabled = true; the bypass applies to unpinned, non-did:key
publishes.)
Only the two admin routes this feature unlocks (GET /admin/contexts,
POST /admin/pinned-keys/reload) are compiled in with the playground Cargo
feature — see OPERATIONS.md and
HTTP-API.md. [playground] enabled = true
itself is not feature-gated: the publish handler's DID-signature bypass
(crates/acdp-registry-core/src/handlers/context.rs, the
playground_snapshot.enabled branch) is a plain runtime if, compiled into
every build including a stock release binary with default features.
did:key producers are checked before this branch, unconditionally, through
acdp's offline verifier (the starts_with("did:key:") branch of
publish_inner in context.rs; rationale in the comment that opens that
branch) — a
did:key identity is self-verifying by construction, so [playground] never
affects how a did:key publish is authorized. Pinned agents
([[playground.pinned_keys]]) are cryptographically verified inside the
playground branch itself (crate::playground::enforce_pinned_signature,
called at the top of that branch); the skip applies only to
publishes from non-did:key agents that aren't pinned.
| Key | Type | Default | Notes |
|---|---|---|---|
enabled | bool | false | Skip DID-signature verification for hands-on demos. |
pinned_only | bool | false | Reject publishes from agents without a pinned key. No effect while pinned_keys is empty. Also the only playground mode compatible with a configured [receipt] key — and it then requires at least one pinned key. |
[[playground.pinned_keys]]
Repeatable.
| Key | Type | Default | Notes |
|---|---|---|---|
agent_did | string | — | Full DID. |
public_key_b64 | string | — | Standard base64 of the raw 32-byte key. |
algorithm | string | ed25519 | ed25519 or ecdsa-p256. |
valid_from | i64 | — | Unix seconds, inclusive; open-ended if omitted. |
valid_until | i64 | — | Unix seconds, exclusive; open-ended if omitted. |
Hot-reload the [playground] section with POST /admin/pinned-keys/reload
(playground feature) — see HTTP-API.md.
[receipt] (ACDP 0.2.0)
Registry-receipt signing identity (RFC-ACDP-0010). Configuring a key enables
receipt minting, the acdp-registry-receipts profile, and
GET /.well-known/did.json. Leave unset to stay a receipt-less registry.
(acdp_version itself is unconditionally "0.5.0" as of REG-3 —
RFC-ACDP-0016 §10's anchors claim always wins the version max() — so it no
longer moves with [receipt]; the acdp-registry-receipts profile is what
actually signals receipt minting is active.) See RECEIPTS.md
for the operator runbook (rotation, retention, backfill policy).
| Key | Type | Default | Notes |
|---|---|---|---|
signing_key_seed_b64 | string | "" | Standard base64 of the raw 32-byte Ed25519 seed. Exactly one of the two key sources may be set. |
signing_key_path | path | — | File (e.g. mounted secret) whose contents are that base64 string. |
key_id_fragment | string | receipt-key-1 | Fragment under the registry DID; signature.key_id = did:web:<authority>#<fragment>. Pick a fresh fragment per rotation. |
head_receipts | bool | false | (ACDP 0.3.0) Mint a lineage-head receipt on every GET /lineages/{id}/current response (RFC-ACDP-0011). Requires a configured signing key (the same receipt key signs — no new key role); advertises acdp-registry-head-receipts (acdp_version itself is unconditionally "0.5.0" as of REG-3 and no longer moves with this flag). |
With [lifecycle] enabled = true as well, the same key also signs an
RFC-ACDP-0017 §10 event receipt for every accepted lifecycle event, served in
registry_state.event_receipts. There is no separate flag; see
RECEIPTS.md.
[[receipt.retired_keys]]
Repeatable. Rotated-out receipt keys, published in the DID document's
verificationMethod only (never assertionMethod). Removing an entry
bricks every receipt that key signed — RFC-ACDP-0010 §9 retains retired
keys indefinitely; remove only on confirmed compromise.
| Key | Type | Default | Notes |
|---|---|---|---|
public_key_b64 | string | — | Standard base64 of the raw 32-byte Ed25519 public key. |
key_id_fragment | string | — | The fragment the key was published under while active. |
[lifecycle] (ACDP 0.3.0)
Lifecycle events & retraction (RFC-ACDP-0013). When enabled the registry
serves POST /contexts/{ctx_id}/retract / /republish, derives status
with the retracted > superseded > expired > active precedence, excludes
retracted contexts from default search and from /current, serves
registry_state.lifecycle_events, and advertises acdp-registry-lifecycle
(acdp_version itself is unconditionally "0.5.0" as of REG-3 —
RFC-ACDP-0016 §10's anchors claim always wins the version max() — and no
longer moves with this flag). When disabled (the default) both endpoints
answer 501 not_implemented and the registry emits neither
lifecycle_events nor the retracted status — guaranteed by the startup
refusal below, not by the read paths.
With a [receipt] key configured as well, every accepted lifecycle event
also gets an RFC-ACDP-0017 §10 event receipt (registry_state.event_receipts),
committed atomically with the event.
Turning the flag off over existing lifecycle state refuses to start.
RFC-ACDP-0013 §6
(pinned spec): a registry that does not advertise acdp-registry-lifecycle
MUST NOT emit lifecycle_events or the retracted status, with no carve-out
for state recorded while the profile was advertised. The stores project
stored lifecycle state on every read path regardless of the flag, so at
startup — after migrations, before binding — the binary asks the store whether
it holds any lifecycle state (ExtendedRegistryStore::has_lifecycle_state:
at least one lifecycle_events row, or at least one context with the
retracted flag set). With enabled = false and state present it logs at
ERROR and exits non-zero naming both ways out:
-
Re-enable — set
[lifecycle] enabled = true(ACDP_REGISTRY_LIFECYCLE__ENABLED=true). The state is served exactly as before. This is the recommended exit. -
Purge — back up the database first. Deleting the state is irreversible: every retracted context becomes
activeagain and reappears in default search and as its lineage's/currenthead, reversing withdrawals the producers (or you) made. With the registry stopped:-- SQLite BEGIN; DELETE FROM lifecycle_events; UPDATE contexts SET retracted = 0 WHERE retracted <> 0; COMMIT; -- Postgres BEGIN; DELETE FROM lifecycle_events; UPDATE contexts SET retracted = FALSE WHERE retracted; COMMIT;
A republished context counts as state: it is no longer retracted but keeps
both events, which §6 equally forbids emitting. The check runs once at
startup; on a multi-replica Postgres deployment every replica must agree on
[lifecycle] (a flag-off replica already running keeps serving whatever a
flag-on replica records until its next restart, which then refuses). The
in-memory backend never trips it — nothing survives its restart. See
UPGRADING.md for the pre-upgrade check.
| Key | Type | Default | Notes |
|---|---|---|---|
enabled | bool | false | Opt into the RFC-ACDP-0013 endpoint surface and status semantics. |
enabled also unlocks the registry-attested takedown path
(POST /admin/contexts/{ctx_id}/{retract,republish}, RFC-ACDP-0013 §6
registry-initiated events — see HTTP-API.md).
That path adds no new knob: it is gated by the existing auth.admin_tokens
bearer, and its signing is driven by whether a [receipt] key is configured —
with a receipt key the registry MUST sign the event under it; without one the
event is recorded unsigned but still attributed to the registry DID.
[log] (ACDP 0.3.0)
Registry transparency log
(RFC-ACDP-0012): the leaf
encoding, Merkle tree construction and checkpoint format are normative in
§4–§6
and not restated here. When enabled this registry appends one leaf per
accepted publish in the same storage transaction as the context row and its
receipt (a publish that cannot durably append its leaf fails), serves
GET /log/checkpoint, GET /log/proof, and GET /log/entries, signs
checkpoints with the [receipt] key (no new key to operate), and advertises
acdp-registry-transparency-log (acdp_version itself is unconditionally
"0.5.0" as of REG-3 and no longer moves with this flag). When disabled (the
default) the three /log/* endpoints answer 501 not_implemented. There is
no degraded mode and no log_unavailable error.
Prerequisites (enforced at startup): a configured [receipt] signing key
and a durable storage backend (sqlite or postgres).
Storage: leaves live in the log_leaves table — dense 0-based
leaf_index in acceptance order, one leaf per ctx_id, and the exact
JCS-canonical leaf bytes plus their sha256: leaf hash, so every leaf
is byte-exactly reproducible forever. Roots and proofs are recomputed per
request from the ordered leaf hashes (O(n); the head root is cached).
Contexts published before enablement are not backfilled: no leaf is ever
appended for them, and there is no backfill command.
Deviation from a SHOULD in RFC-ACDP-0012 §7.3 (pinned spec): a registry enabling the profile SHOULD backfill leaves for contexts published before enablement (after backfilling their receipts, which RFC-ACDP-0010 §7 likewise says SHOULD happen and this registry also does not do — see RECEIPTS.md). Backfilled leaves would be time-unanchored under §7.3 anyway, so what is missing is their inclusion in the log, not a timing guarantee.
| Key | Type | Default | Notes |
|---|---|---|---|
enabled | bool | false | Opt into the RFC-ACDP-0012 log: atomic leaf appends + the three /log/* endpoints. |
instance | string | "1" | The <instance> component of log_id = did:web:<authority>/log/<instance> (matches [a-z0-9-]{1,32}). Change only on catastrophic tree loss (§7.4) — a new instance is an explicit, loudly detectable history reset. |
[changes] (ACDP 0.5.0)
Registry change feed
(RFC-ACDP-0018 §5):
GET /changes and the acdp-registry-changes profile. Feed entries are
appended whenever a [receipt] key is configured, in the same storage
transaction as the lifecycle event, superseding publish or key-revocation
context they record; this section governs whether they are served, and how
long they are kept. Retention applies whether or not the feed is served: the
prune task runs on every registry, and retention_seconds and
prune_interval_seconds are validated even with enabled = false. When disabled (the default) GET /changes answers
501 not_implemented. See HTTP-API.md
for the wire behaviour.
Prerequisites (enforced at startup): [lifecycle] enabled = true, a
configured [receipt] key, a durable storage backend (sqlite or
postgres), exactly one master-key source, retention_seconds >= 2592000
(30 days, §5.4), and 100 <= max_change_filters, max_changes_page <= 1000
(§9 floor; the ceiling bounds per-request work). max_change_bucket_length,
when set, must be from 4 to 16 and is refused with enabled = false; that
refusal runs whether or not the feed is enabled.
The master key is 32 random bytes, base64. HKDF-SHA-256 derives the cursor
key from it, so cursors are opaque and tamper-evident (AES-256-GCM). It is a
secret: supply it through ACDP_REGISTRY_CHANGES__KEY_B64 or key_path, never
in a committed file, and keep it distinct from the receipt seed. Every
replica serving the same store needs the same key and key_id. Rotating
(key_id changed, new key) invalidates every outstanding cursor: consumers
get cursor_expired and resync from since absent or head, which the
protocol allows; nothing is misread. After restoring the store from a backup,
raise cursor_epoch instead
(OPERATIONS.md, Restore). Every older cursor expires
the same way, and subscription secrets stay readable.
| Key | Type | Default | Notes |
|---|---|---|---|
enabled | bool | false | Serve GET /changes and advertise acdp-registry-changes plus the three limits below. |
key_b64 | string | "" | Base64 of the 32-byte master key. Env ACDP_REGISTRY_CHANGES__KEY_B64. Mutually exclusive with key_path. |
key_path | path | unset | File holding the base64 master key. |
key_id | u8 | 1 | Stamped into every cursor; a cursor under an id this registry does not hold is cursor_expired. Change it when rotating the key. |
cursor_epoch | u32 | 0 | Sealed into every cursor; a cursor from another epoch is cursor_expired. Env ACDP_REGISTRY_CHANGES__CURSOR_EPOCH. Raise it by one on every restore from backup (RFC-ACDP-0018 §5.3); never lower it. Same value on every replica. |
retention_seconds | u64 | 2592000 | Minimum entry lifetime; advertised as limits.change_retention_seconds. |
max_change_filters | u64 | 100 | Total ctx_id/lineage_id/agent_id/kind/lineage_bucket/agent_bucket values per request, duplicates included; advertised. |
max_changes_page | u64 | 100 | Largest limit; advertised as limits.max_changes_page. |
max_change_bucket_length | u16 | unset | Turns on the §6.1 bucket filters (lineage_bucket / agent_bucket on GET /changes) and is advertised as limits.max_change_bucket_length. 4 to 16; only with enabled = true. Unset (the default), nothing is advertised and either parameter is 400 schema_violation. Env ACDP_REGISTRY_CHANGES__MAX_CHANGE_BUCKET_LENGTH. Rollout: consumers on acdp 0.19 or older reject a capabilities document carrying this key (their limits is closed), and startup logs a warning saying so; set it only once every consumer is on acdp 0.20 or newer. A binary that predates the key refuses to start with it set, so remove it before rolling back (UPGRADING.md). |
prune_interval_seconds | u64 | 3600 | How often the background task deletes entries older than retention_seconds plus a one-hour clock-skew margin (in batches of 1000). Runs whether or not enabled is set. |
[events] (ACDP 0.5.0)
Change-hint subscriptions
(RFC-ACDP-0018 §8):
/subscriptions and the acdp-registry-events profile. When disabled (the
default) every /subscriptions request answers 501 not_implemented. See
HTTP-API.md
for the wire behaviour.
Prerequisites (enforced at startup): [changes] enabled = true (a hint
points at the feed, and subscription secrets are sealed under a key derived
from the [changes] master key), auth.enabled = true (every subscription
has an authenticated owner), and max_subscriptions_per_requester >= 1.
Rotating the [changes] key (new key and new key_id) makes existing
subscription secrets unreadable: the worker retries each such subscription
and disables it after 72 hours, so restoring the old key within that window
loses nothing; otherwise owners re-create them. A new key under the same
key_id disables them at once (see
OPERATIONS.md).
With [events] enabled every replica runs the hint worker (see
HTTP-API.md
and OPERATIONS.md). Its delivery policy is
fixed, not configured: retries from one minute doubling to hourly, disable
after 72 hours of failure, 10 s per request, 16 deliveries in flight per
replica.
| Key | Type | Default | Notes |
|---|---|---|---|
enabled | bool | false | Serve /subscriptions and advertise acdp-registry-events plus limits.max_subscriptions_per_requester. |
max_subscriptions_per_requester | u64 | 10 | Most subscriptions one requester DID may hold, active or disabled; advertised. |
[keyless] (ACDP 0.5.0)
Keyless signing
(RFC-ACDP-0021,
Draft): POST/GET /key-attestations, the keyless publish path and the
acdp-registry-keyless profile. A CI job or workload presents its OIDC ID
token or SPIFFE JWT-SVID and a proof of possession of an ephemeral key; the
registry checks the token against the issuer's published keys and the
controller DID document's AcdpKeylessSigning service, then mints a
short-lived attestation (a public acdp:key-attestation body under the
registry DID, signed with the receipt key, receipted and logged). Bodies
signed with that key then publish under the controller's DID.
Off by default. With enabled = false (the default) nothing here is
read, /key-attestations answers 501 not_implemented, the capabilities
document carries neither the profile nor the keyless member, and an
acdp-kl- key id is an ordinary unresolvable key. With enabled = true the
profile and the keyless member are advertised together. See
HTTP-API.md
for the wire behaviour and
OPERATIONS.md for running it.
Prerequisites (enforced at startup): [lifecycle] enabled = true, a
configured [receipt] key, [log] enabled = true, and at least one issuer
or trust domain (see Startup validation).
The scalars take the usual ACDP_REGISTRY_KEYLESS__<KEY> env overrides
(e.g. ACDP_REGISTRY_KEYLESS__ENABLED=true). The two lists are arrays of
tables, which the env source cannot express: set them in the TOML file, or
set oidc_issuers with the JSON escape hatch
ACDP_REGISTRY_KEYLESS__OIDC_ISSUERS_JSON (see
the escape hatches). SPIFFE trust domains are
file only.
| Key | Type | Default | Notes |
|---|---|---|---|
enabled | bool | false | Serve /key-attestations and keyless publish; advertise acdp-registry-keyless and the keyless member. Env ACDP_REGISTRY_KEYLESS__ENABLED. |
max_attestation_ttl_seconds | u32 | 600 | Longest attestation window minted; advertised as keyless.max_attestation_ttl_seconds. 60 to 3600. Env ACDP_REGISTRY_KEYLESS__MAX_ATTESTATION_TTL_SECONDS. |
jwks_cache_ttl_seconds | u64 | 300 | How long a fetched issuer key set counts as fresh before it is refetched. 60 to 3600. A response's Cache-Control: max-age can shorten it, never below 60 s. When a refetch fails, the copy past its TTL keeps answering (stale-if-error) for up to jwks_max_stale_seconds more. Env ACDP_REGISTRY_KEYLESS__JWKS_CACHE_TTL_SECONDS. |
jwks_max_stale_seconds | u64 | 3600 | How long past its TTL a key set is still used while its issuer cannot be reached. At most 604800 (7 days): a stale set may hold keys the issuer withdrew. Env ACDP_REGISTRY_KEYLESS__JWKS_MAX_STALE_SECONDS. |
fetch_timeout_ms | u64 | 5000 | Bound on one JWKS, bundle or discovery fetch. At least 100. Env ACDP_REGISTRY_KEYLESS__FETCH_TIMEOUT_MS. |
max_fetch_bytes | u64 | 65536 | Largest fetched response body read. At least 1024. Env ACDP_REGISTRY_KEYLESS__MAX_FETCH_BYTES. |
rate_per_identity_per_minute | u32 | 10 | POST /key-attestations budget per workload identity, charged only once its token verifies; 0 disables it. Env ACDP_REGISTRY_KEYLESS__RATE_PER_IDENTITY_PER_MINUTE. |
rate_per_ip_per_minute | u32 | 30 | POST /key-attestations budget per resolved client IP, charged on arrival; 0 disables it. Env ACDP_REGISTRY_KEYLESS__RATE_PER_IP_PER_MINUTE. |
[[keyless.oidc_issuers]] | table[] | none | Accepted OIDC issuers, advertised as keyless.accepted_oidc_issuers. Env ACDP_REGISTRY_KEYLESS__OIDC_ISSUERS_JSON (a JSON array). |
[[keyless.spiffe_trust_domains]] | table[] | none | Accepted SPIFFE trust domains, advertised as keyless.accepted_spiffe_trust_domains. File only. |
[[keyless.oidc_issuers]] entries:
| Key | Type | Default | Notes |
|---|---|---|---|
issuer | string | required | Compared byte for byte with the token's iss, never normalised (https://x and https://x/ are two issuers). Must match ^https://[^\s#?]+$, at most 512 characters, no duplicates. |
jwks_uri | string | unset | https URL of the issuer's JWKS. Unset: discovered from <issuer>/.well-known/openid-configuration, whose issuer must equal the configured one. |
[[keyless.spiffe_trust_domains]] entries:
| Key | Type | Default | Notes |
|---|---|---|---|
trust_domain | string | required | Must match ^[a-z0-9._-]+$, at most 255 characters, no duplicates. |
bundle_endpoint | string | required | https URL of the SPIFFE bundle endpoint serving the domain's JWT authorities. |
jwt_issuer | string | unset | The iss the domain's JWT-SVIDs carry, when they carry one. |
[keyless]
enabled = true
max_attestation_ttl_seconds = 600
[[keyless.oidc_issuers]]
issuer = "https://token.actions.githubusercontent.com"
[[keyless.spiffe_trust_domains]]
trust_domain = "prod.example.org"
bundle_endpoint = "https://spire.prod.example.org/bundle"[[witnesses]] (ACDP 0.4.0)
Transparency-log witness cosignature aggregation (RFC-ACDP-0015 §6.1).
An array of independent witnesses this registry polls and whose verified
cosignatures it attaches to its checkpoint responses (the reserved
top-level witness_signatures member — see
HTTP-API.md).
A consumer then gets a checkpoint and its witness quorum in one fetch
and verifies N-witnessed locally.
For each configured witness a background poller GETs
<url>?log_id=<this registry's log_id> over the SSRF-guarded outbound
client (HTTPS-only, DNS-rebinding-guarded, no redirects — RFC-ACDP-0008
§4.8) and runs the
RFC-ACDP-0015 §8
verification procedure on every returned cosignature against this
registry's own checkpoint at that tree_size, resolving the witness key
through the did:web resolver. A witness cosigning a different root (a
fork, or a lie) is logged and dropped — it is never stored and never
served. Only verified cosignatures are persisted (table
log_witness_cosignatures, keyed by
(log_id, tree_size, root_hash, witness_did); a fresh re-observation
upserts, newest wins), so serving is a single indexed read with no blocking
network call in the request path.
Aggregation is a pure convenience: the registry never holds a witness key,
so it can neither forge a cosignature nor make itself a trust dependency —
a consumer MAY always fetch direct from a witness (§6.2). There is no new
capability flag or profile: a registry that aggregates does so under its
existing acdp-registry-transparency-log profile (§10). acdp_version
served at .well-known/acdp.json is unconditionally "0.5.0" as of REG-3
(RFC-ACDP-0016 §10's anchors claim always wins the version max()), so
configuring [[witnesses]] no longer moves it; whether aggregation is
active is visible in the response body (whether witness_signatures
accompanies a checkpoint) — see
HTTP-API.md.
Prerequisites (enforced at startup): log.enabled = true (there are no
checkpoints to witness without a log), each did a did:web DID, and each
url accepted by the SSRF policy (HTTPS, non-private host). Empty (the
default) disables aggregation entirely.
[[witnesses]]
did = "did:web:witness.example.org"
url = "https://witness.example.org/log/witness"
poll_seconds = 60 # default 300
[[witnesses]]
did = "did:web:witness-2.example.org"
url = "https://witness-2.example.org/log/witness"| Key | Type | Default | Notes |
|---|---|---|---|
did | string | (required) | The witness's did:web DID. Cosignatures whose witness_id ≠ this value are ignored (a witness endpoint only speaks for its own DID). |
url | string | (required) | HTTPS URL of the witness's GET /log/witness endpoint (RFC-ACDP-0015 §6.2). SSRF-checked at startup and at DNS time on every poll. |
poll_seconds | integer | 300 | Poll interval. |