Authentication
The registry authenticates agents (clients) with a DID challenge-response
flow that mints a short-lived JWT, and authenticates producers (publishers)
implicitly via the signature over content_hash carried in the publish request.
This doc covers the first. Publish signing belongs to the protocol, not this
registry — how a producer builds and signs a PublishRequest is documented in
acdp-rs · Producing, and where the registry verifies it in
ARCHITECTURE.md.
All of this lives in crates/acdp-registry-auth/ and is mounted only when
auth.enabled = true. When auth is disabled, the /auth/* routes are not
mounted, any Authorization header is ignored, and every caller is treated as
anonymous (so the visibility gate runs against None).
Challenge-response flow
client registry
│ POST /auth/challenge { agent_id } │
│ ────────────────────────────────────────────►│ prefix+length check, mint nonce,
│ │ persist ChallengeRecord(nonce, agent_id, expires_at)
│ AuthChallenge { nonce, signing_input, ... } │
│ ◄──────────────────────────────────────────── │
│ │
│ sign signing_input with a DID assertionMethod key
│ │
│ POST /auth/token { agent_id, key_id, nonce, │
│ expires_at, algorithm, signature }
│ ────────────────────────────────────────────►│ consume nonce (one-shot),
│ │ resolve DID doc, verify VM + signature,
│ │ mint JWT, record jti as issued
│ TokenResponse { token, token_type, expires_at }
│ ◄──────────────────────────────────────────── │
│ │
│ GET /contexts/... Authorization: Bearer <jwt>│
│ ────────────────────────────────────────────►│ validate_bearer (sig, exp, aud, revocation)The signing input is namespaced
acdp-registry-auth:v1:{nonce}:{agent_id}:{registry_authority}:{expires_at}The acdp-registry-auth:v1: prefix and the registry_authority binding are
load-bearing: they stop a signature minted for one purpose or one registry from
being replayed as a challenge response elsewhere. Do not remove the version
prefix or the authority component. The string is built in exactly one place,
AuthChallenge::signing_input (crates/acdp-registry-types/src/auth.rs), and
returned to the client as the challenge's signing_input field.
Token issuance checks (/auth/token)
In order (service.rs):
-
Atomically consume the nonce — a second use of the same nonce is rejected (one-shot, replay-proof).
-
The request's
agent_idandexpires_atmust match the stored challenge record (defeats nonce theft and tampering). -
The challenge must not have expired.
-
algorithmmust be supported (ed25519orecdsa-p256). -
key_idis split into a DID + fragment; the fragment is required. The signing key is then resolved by DID method, and the two methods take different paths (service.rs,issue_tokenstep 5):did:web— steps 6 and 7 below (a live document fetch).did:key— no document to fetch and noassertionMethodrelationship to check: the DID is the key, decoded offline. Gated ondid:keyappearing inauth.did_methods, mirroring the publish path's capability gate — an operator who has not opted in todid:keydoes not get it silently accepted for auth either; rejection isunsupported DID method. The fragment must equal the DID's own method-specific id (did:key:z<mb>#z<mb>), so a mismatched fragment is refused rather than silently ignored. Steps 6 and 7 do not apply. -
(
did:webonly) The DID document is resolved via the sharedWebResolver— HTTPS-only, SSRF-policy-gated, LRU-cached, the same resolver used for publish. Its defenses (IP-literal rejection, DNS-time SSRF filtering, size/redirect caps) are documented in acdp-rs · Security Model. If the cached document lacks the fragment, one re-fetch is forced (at most one per DID per hour, the resolver's default). Failures split the way the publish path splits them (RFC-ACDP-0001 §5.11 step 3, conformance fixturedid-001):- transient →
502 key_resolution_unreachable: the DID host answered non-2xx, timed out or failed TLS, or the key is absent from a stale copy whose forced re-fetch the rate limit refused. Nothing is wrong with the agent's key; retry with a new challenge (step 1 already consumed the nonce). - permanent →
403 not_authorized: the document is not JSON, the key is still absent after a fresh fetch, or the SSRF policy refused the host.
RFC-ACDP-0008 §6.2 leaves the challenge exchange deployment-defined, so these codes are this registry's choice rather than a spec requirement. Registry 0.5.0 and earlier answered
403to all of them. - transient →
-
(
did:webonly) The verification method named by the fragment must appear in the document'sassertionMethodset. -
If the verification method declares an algorithm, it must match the request's
algorithm(algorithm-downgrade defense, RFC-ACDP-0001 §5.10 — enforced byacdp; see acdp-rs · Security Model). -
The signature is verified against the resolved public key.
-
A JWT is minted and its
jtiis recorded as issued in the revocation store. If that write fails, the whole request fails — a token that can't be tracked is never handed out.
Rate limits and request bodies on /auth/*
All three /auth/* routes sit behind one limiter, auth_rate_limit
(crates/acdp-registry-core/src/lib.rs), which charges every request to a
process-global ceiling and then a per-client-IP budget before the handler or
its body extractor runs — so before any DID resolution, and whether or not the
request later succeeds. With [rate_limit] backend = "postgres" those two
ceilings are counted once across every replica sharing the database
(LayeredRateLimiter in crates/acdp-registry-core/src/rate_limit_shared.rs
puts the in-memory limiter in front of PgRateLimitBackend in
crates/acdp-registry-pg/src/rate_limit.rs); when the database cannot answer,
backend_unavailable decides between falling back to the per-process count
and refusing with Retry-After: 5. POST /auth/challenge additionally has its
own per-agent_id budget and global ceiling ([limits]), always per process.
Every source of a 429, with its key and setting, is listed in
HTTP-API.md · Rate limits, and the keys in
CONFIGURATION.md · [rate_limit].
Request bodies go through AcdpJson (crates/acdp-registry-core/src/extract.rs).
Content-Type must be present and be application/json or an
application/*+json type such as application/acdp+json (parameters
ignored): an absent or other type is 415 unsupported_media_type. This is
stricter than POST /contexts, which accepts an absent header. A body that
is not JSON, or is JSON of the wrong shape, is 400 schema_violation (not
422), and an oversized one is 413; see
HTTP-API.md · Request bodies.
JWT claims
{
"iss": "did:web:registry.example.com",
"sub": "did:web:agents.example.com:my-agent",
"aud": "registry.example.com",
"jti": "<uuid-v4>",
"iat": 1748000000,
"exp": 1748003600,
"acdp": {
"registry": "registry.example.com",
"key_id": "did:web:agents.example.com:my-agent#key-1"
},
"tenant": "acme"
}audandacdp.registrybind the token to this registry's authority — a token minted by a peer won't validate here.expdefaults toiat + auth.token_ttl_seconds(default 3600 s).tenantis present only for agents bound via[[auth.tenant_agents]]; it is the sole authority for an authenticated caller's tenant (see MULTI-TENANCY.md). AnX-Tenant-Idheader that disagrees with it is refused in every mode. A caller whose token carries notenantclaim can name a tenant with the header only whenauth.tenant_header_trusttrusts the request's peer (unset meansnone, so by default it never does); otherwise a header that is present gets403 not_authorized(who may sendX-Tenant-Id).
Validation
On every bearer-authenticated request the registry checks the signature, exp
(with auth.token_leeway_seconds of clock skew, default 30 s), the aud /
acdp.registry binding, and the revocation store. A revoked or expired jti is
rejected with 403 not_authorized.
Spec conformance (bearer_jwt)
This flow is the bearer_jwt read-authentication method, registered in the spec's
registries/auth-methods.md
with its requirements in
RFC-ACDP-0008 §6.2.
Where this registry meets each one:
| Requirement (RFC-ACDP-0008 §6.2) | Here |
|---|---|
| Registry signs the token with its own key | auth.jwt_signing_alg key; public half at /.well-known/jwks.json under EdDSA (HS256, the default, publishes an empty key set) |
sub is the requester's DID, verified before minting | Token issuance checks |
exp present, short lifetime | auth.token_ttl_seconds (default 3600 s); exp, iss and aud are required claims |
aud identifies the issuing registry; other audiences rejected | Validation |
Listed in read_authentication_methods | "bearer_jwt" whenever auth.enabled = true, followed by "bearer_static" when [[auth.read_tokens]] is configured (HTTP-API.md, static read tokens) |
| Reads only; never replaces a producer signature | Publish and lifecycle writes verify the producer's signature over the body or event whether or not a bearer is presented (the opt-in unpinned [playground] publish mode excepted); a bearer never stands in for it |
| Sent over TLS only | A deployment duty: terminate TLS upstream or set [registry.tls] (CONFIGURATION.md). The registry cannot see an upstream TLS hop, so it does not refuse plain-HTTP bearers. |
Static read tokens (bearer_static)
RFC-ACDP-0008 §6.2 bearer_static: a long-lived, operator-issued token that
authenticates reads as one requester DID, for a client that cannot run the
challenge flow (a dashboard, a cron job, a server-side integration). It is
configured in [[auth.read_tokens]] (CONFIGURATION.md)
and requires auth.enabled = true. While at least one entry is configured,
capabilities list "bearer_static" after "bearer_jwt".
Minting. acdp-registry read-token generate prints a new token and the
entry to paste into the config. The token is acdp_rt_ followed by 43
base64url characters: 32 bytes (256 bits) from the operating system's CSPRNG.
The registry stores only the SHA-256 (sha256) of the full token string. Hand
the token to the DID's holder, then discard it. It cannot be recovered from the
config.
Binding. Each entry binds exactly one DID. Configuration may bind a token
only to a DID this operator administers, so operator_administered = true
is mandatory and startup refuses an entry without it. Binding someone else's DID
needs proof of control, which a config file cannot provide. Each entry also
gets an optional tenant, falling back to the DID's [[auth.tenant_agents]]
binding. The tenant is authoritative, exactly like a tenant-bound JWT's claim:
a disagreeing X-Tenant-Id is 403.
Presenting. The token is accepted only as Authorization: Bearer acdp_rt_… on the data plane's GET/HEAD routes. Parsing is the same as for
any bearer (extract_bearer), and the acdp_rt_ prefix routes the token to
the static table instead of JWT validation. It is never read from the query
string or a form body. While bearer_static is active, a request with an
access_token query parameter is refused 400 schema_violation rather than
served anonymously. Two Authorization headers are refused 400 rather than
picking one.
Refusal. An unknown, expired or malformed static token is 403 not_authorized, decided by the read gate (crates/acdp-registry-core/src/read_gate.rs)
before the handler looks anything up. An existing private context and a
missing one therefore answer identically, and the request never falls back to
anonymous, not even for a public context. The same holds for an invalid JWT on
these routes. The refusal is charged to the client address's anonymous read
bucket first (when [read_limits] is on), so guessing tokens spends budget.
Once that bucket is exhausted the answer is 429. A valid token is charged to
its DID's bucket wherever it comes from.
Reads only. Every bearer-authenticated write and credential operation
(retract, republish, /subscriptions, token revocation) refuses a static
token with 403 not_authorized. Publish never consults Authorization.
Rotation, revocation, expiry. A DID may hold several valid tokens at once
(at least 2, auth.max_read_tokens_per_did, default 5): add the new entry,
move the client over, then remove the old one. Removing an entry and restarting
the registry revokes the token. Revocation therefore takes effect within one
deploy, the documented bound. expires_at (RFC 3339) makes a token stop
validating at that instant. Startup warns about an entry that has already
expired.
Never logged. Validation compares hashes in constant time over every entry,
and no error message carries the token. The request span logs the URI with any
access_token value, and any query value or path segment containing
acdp_rt_, replaced by [redacted]. tests/read_token_logging.rs pins this
at TRACE level.
Presenting a bearer
Three bearer parsers coexist and no two of them agree. Each is deliberate,
and the differences below are pinned by tests — extract_bearer_accepts_two_casings_and_trims
(crates/acdp-registry-auth/src/service.rs), bearer_scheme_is_case_sensitive
and rejects_token_with_extra_whitespace (handlers/admin.rs), and
metrics_bearer_parser_shape_is_pinned
(crates/acdp-registry-server/tests/metrics_integration.rs). The differences
were undocumented rather than accidental, and stating them is what this section
exists for.
The /metrics and /contexts/* halves of that coverage were added alongside
this section: before them, deleting .map(str::trim) from either parser, or
dropping extract_bearer's "bearer " arm, left the entire workspace suite
green. Every behaviour claimed below is now locked; if you add a parser, pin its
differences in the same commit that documents them.
| Route group | Parser | Scheme prefixes accepted | Trims the token? | Unrecognised header shape |
|---|---|---|---|---|
/contexts/*, /lineages/*, and the other ordinary read/publish routes | extract_bearer (crates/acdp-registry-auth/src/service.rs) | Bearer and bearer | yes | treated as anonymous |
/admin/* | require_admin_bearer (crates/acdp-registry-core/src/handlers/admin.rs) | Bearer only | no | rejected with 403 {"error": "admin-only"} (the AdminAuthError::Forbidden arm in crates/acdp-registry-core/src/handlers/admin.rs) |
/metrics | inline in metrics_endpoint (the strip_prefix("Bearer ") chain, crates/acdp-registry-core/src/metrics.rs) | Bearer only | yes | rejected with 401 + a WWW-Authenticate challenge (the WWW_AUTHENTICATE early return in metrics_endpoint, crates/acdp-registry-core/src/metrics.rs) |
The /metrics parser is a hybrid of the other two: case-sensitive on the scheme
like the admin one, trimming like the lax one. It is also the only one of the
three that is not part of the ACDP auth pipeline at all — see
/metrics is gated separately below.
Its row describes /metrics with its gate active — metrics.enabled = true
and a non-blank metrics.bearer_token. Under the shipped defaults there is no
third parser in play at all: metrics.enabled is false, so the route is not
mounted and every request is a 404; and with metrics on but the token empty,
the endpoint is open and no header shape is rejected.
No parser is case-insensitive on the scheme token. extract_bearer hardcodes
two casings, so BEARER … and BeArEr … are unrecognised by all three;
one parser is merely more permissive than the others, not more conformant.
Owner-scoped routes: /subscriptions
POST /subscriptions, GET /subscriptions/{id} and DELETE /subscriptions/{id} (RFC-ACDP-0018 §8.1) require a validated bearer. An
anonymous caller is 403 not_authorized, whatever
anonymous_public_reads says. Each subscription belongs to the DID in the
bearer that created it (its sub), and every lookup is filtered by that
DID. Another requester's subscription id is 404 not_found, the same as an
id that does not exist. That is why [events] requires
auth.enabled = true at startup. See
HTTP-API.md.
Unrecognised means anonymous on the ordinary routes
The read gate's resolve (crates/acdp-registry-core/src/read_gate.rs, for
data-plane reads) and caller_from_headers
(crates/acdp-registry-core/src/handlers/context.rs, for bearer-authenticated
writes) both yield an anonymous caller in three cases:
auth.enabled = false, regardless of what the client sent;- no
Authorizationheader, or a value the HTTP layer will not hand over as a string —HeaderValue::to_strrejects any byte outside visible ASCII, which is broader than "not valid UTF-8" (Bearer caféis valid UTF-8 and still fails); - any value
extract_bearerdoes not recognise, including a non-Bearerscheme.
Only a well-formed bearer whose token then fails validation is rejected, with
403 not_authorized — auth failures on the ACDP routes are 403, never
401, and no WWW-Authenticate challenge is emitted (see
HTTP-API.md). A client whose token merely expired sees that
explicitly rather than being silently downgraded.
/admin/* also answers 403 and emits no challenge, though with its own body
({"error": "admin-only"}) rather than the ACDP error envelope. /metrics is
the exception to both halves of that sentence: it answers 401 and sends
WWW-Authenticate: Bearer realm="metrics". Scope any "this registry never
returns 401" reasoning to the ACDP routes and /admin/*.
The consequence worth knowing when debugging: a typo in the scheme is not an
auth failure at all. Authorizaton: Bearer … (misspelled header name),
Basic …, or BEARER … do not reach token validation — the request simply
proceeds as anonymous.
What the caller then sees depends on the route and on
auth.anonymous_public_reads, which ships as false. Anonymous access is
subject to the RFC-ACDP-0008 §4.5 visibility rules, so the same malformed header
can surface as a refusal on one route and as a short, successfully-filtered
result set on another. The invariant to hold onto while debugging is upstream of
that: the auth layer did not reject the header, it classified the caller as
anonymous. If a caller reports missing rows, or an authorization error that
names anonymity rather than a bad token, suspect the header shape before
suspecting the token.
On /admin/* the same inputs return 403 — absent, non-UTF-8, and unrecognised
headers are all refused, and an empty auth.admin_tokens list disables the routes
outright (the allowed.is_empty() arm of require_admin_bearer, crates/acdp-registry-core/src/handlers/admin.rs).
What each parser accepts
extract_bearer strips "Bearer " or "bearer " and then trims the remaining
token. require_admin_bearer strips "Bearer " only, and does not trim. The
/metrics parser strips "Bearer " only, and does trim.
None of the three is case-insensitive: each hard-codes its prefixes, so BEARER
and BeArEr are unrecognised by all three.
The /metrics column below describes the endpoint with its gate active —
metrics.enabled = true and a non-blank metrics.bearer_token. With the token
empty the endpoint is open and every row is 200; a whitespace-only token is
refused at startup rather than silently opening it (see
/metrics is gated separately).
Authorization value | /contexts/* | /admin/* | /metrics |
|---|---|---|---|
Bearer <token> | <token> | <token> | 200 |
bearer <token> | <token> | 403 | 401 |
Bearer <token> (two spaces) | <token> | token is " <token>", so 403 | 200 |
Bearer <token> + trailing space | <token> | depends on protocol — see below | 200 |
BEARER <token>, BeArEr <token> | anonymous | 403 | 401 |
Bearer<TAB><token> | anonymous | 403 | 401 |
Basic <token>, bare <token>, empty | anonymous | 403 | 401 |
The three columns are not the same kind of thing: on /contexts/* an
unrecognised header yields an anonymous caller, whose eventual status depends
on the route and on the visibility rules; on /admin/* and /metrics it is the
response status itself.
Both behaviours on the admin side are pinned by tests, so loosening either is a
deliberate reviewed change rather than a refactor: bearer_scheme_is_case_sensitive
and rejects_token_with_extra_whitespace (both in
crates/acdp-registry-core/src/handlers/admin.rs).
Trailing whitespace depends on the HTTP version
Trailing whitespace in the header value never reaches any of the three parsers
over HTTP/1.1: httparse strips trailing SP/HTAB/CR/LF from every header value while
parsing the request. Over HTTP/2, HPACK carries the value verbatim and nothing
strips it. The registry serves both.
So Authorization: Bearer <token> (one trailing space) is accepted everywhere
over HTTP/1.1 — the space is gone before any handler sees it — and on HTTP/2 it
is accepted by /contexts/* and /metrics (which trim) but rejected by
/admin/* (which does not). Only the trailing case is protocol-dependent,
and only on /admin/*; the two-space case above is internal to the value and
behaves identically on both protocols everywhere.
The practical consequence is that an admin token configured with stray trailing whitespace can appear to work in one environment and fail in another, depending on whether a proxy or client negotiated HTTP/2. Startup validation now refuses such entries outright — see #161 and the admin-token rules in CONFIGURATION.md.
Practical rule: send exactly Authorization: Bearer <token>, one space, no
surrounding whitespace. That form is accepted everywhere. Any other spelling
works on some routes and not others.
/metrics is gated separately
GET /metrics does not go through the ACDP auth pipeline at all. It is mounted
on the un-authenticated, un-rate-limited aux router
(it is merged into aux in build_router, crates/acdp-registry-core/src/lib.rs), so no bearer it receives is
ever validated as an ACDP token — no signature check, no exp, no revocation
lookup, no tenant resolution. The handler applies its own gate instead: a
constant-time comparison against a configured shared secret, via the same
ct_eq helper the /admin/* allowlist uses
(crates/acdp-registry-core/src/secure_compare.rs).
The gate is applied only when metrics.bearer_token is non-blank
(crates/acdp-registry-core/src/metrics.rs); the configured value and
the presented one are both trimmed before comparison (the configured token's
.trim() and the .map(str::trim) on the presented bearer, both in the
metrics_endpoint handler). Three
consequences follow, and they are the ones that surprise people:
- An empty
metrics.bearer_tokenleaves/metricsopen, to anyone who can reach the port. This is the shipped default (thebearer_tokendefault incrates/acdp-registry-types/src/config.rs) and it is deliberate — the endpoint is meant to be reachable from a trusted scrape network without ACDP credentials. It is not an oversight, but it is a decision your deployment inherits by default. - A whitespace-only token used to mean the same thing, silently.
" "trims to empty, so the gate was skipped entirely and the endpoint was served unauthenticated with no failed-auth signal in the logs — the request just looked like an authorized scrape. Startup validation now refuses that value whenmetrics.enabled = true, so the failure is a refused boot rather than a quietly open endpoint. See #162. - Padding is not refused here, unlike
auth.admin_tokens. Because both sides of the comparison are trimmed," tok "and"tok"behave identically on HTTP/1.1 and HTTP/2 alike; there is no protocol-dependent credential to guard against, so the guard is deliberately narrower than the admin-token one.
Failures on this endpoint answer 401 with
WWW-Authenticate: Bearer realm="metrics" — the one place in the registry that
does; everything else authenticated answers 403. Pinned once, in the
parser comparison table above, rather than a second
time here: this is a single fact, and two separately-pinned copies of it read
to a checker as two independent confirmations while drifting in lockstep.
The presented token is compared to the configured one in constant time,
using the same ct_eq helper as the /admin/* allowlist
(crates/acdp-registry-core/src/secure_compare.rs) — one implementation shared
by both gates rather than a copy each, so they cannot drift
(#168).
Two limits worth stating rather than leaving implied: the helper returns early
when lengths differ, so token length stays observable at both gates (accepted
in the existing design — what is protected is the token's contents); and
constant-timeness is a property no unit test in this repo can demonstrate. The
tests pin the authorization behaviour; the timing property rests on there
being a single reviewed implementation.
What /metrics exposes is operational rather than secret — request counts,
latency histograms, publish outcomes — but an operator who sets
metrics.bearer_token has expressed an intent to gate it, and the point of the
startup check is that the intent is not silently discarded. Configuration
reference: CONFIGURATION.md.
Signing algorithms
JWT signing is selected by auth.jwt_signing_alg:
| Alg | Key material | JWKS | Use it for |
|---|---|---|---|
HS256 (default) | auth.jwt_secret — base64, ≥32 bytes, symmetric | empty key set | Single registry; backward-compatible default. |
EdDSA (Ed25519) | auth.jwt_private_key_pem — PKCS#8 PEM, asymmetric | publishes the public key | Federation — peers verify your tokens without sharing a secret. |
In HS256 mode the secret is never published; GET /.well-known/jwks.json
returns { "keys": [] }. In EdDSA mode the public key is published there as an
OKP/Ed25519 JWK, with kid derived from the key fingerprint unless
auth.jwt_kid overrides it.
Dev convenience: with HS256 and an empty
jwt_secret, setauth.allow_ephemeral_secret = trueto boot with a random process-lifetime key. Tokens won't survive a restart, and startup says so — it is not silent. Never use this in production — set a realjwt_secret.The two startup checks are gated differently. The validator refuses
changeme(case-insensitively, after trimming), and refuses a secret that is not base64 of at least 32 bytes, whenever the secret is non-empty andjwt_signing_algis notEdDSA— regardless ofauth.enabled. It refuses an empty secret only whenauth.enabled = trueandallow_ephemeral_secretis unset, because an auth-off registry with no secret has nothing to sign and is a supported configuration. UnderEdDSA,jwt_secretis never examined.
Token revocation
POST /auth/token/revoke with { "jti": "..." } and a valid bearer marks a
token revoked. The caller's DID must own the jti (you can only revoke your own
tokens). State lives in the revocation store
(acdp-registry-auth/src/revocation_store.rs):
record_issued— written at mint time,revoked = false(never downgrades an existingrevoked = true).revoke— flips the flag / writes a tombstone.is_revoked(jti)— checked on every bearer validation.owner_of(jti)— enforces the ownership check on revoke.evict_expired(now)— a background task prunes tombstones pastexp(runs on a ~300 s tick alongside challenge eviction).
Recording the jti at issuance (not at revoke time) is what lets the registry
reject a revoked token that was never seen again — there's always a row to flip.
A registry built without a revocation store answers 501 not_implemented on this
route. The shipped binary always wires one, so only a library embedder can see it.
Cross-issuer revocation federation
Revocation federation is consume-only. This registry does not expose a
/auth/revocations feed (deliberately deferred until a control plane is deployed
against it; see STATUS.md); it polls peers' feeds and applies their revocations
locally. Configure peers with [[auth.revocation_feeds]]:
[[auth.revocation_feeds]]
issuer = "did:web:peer.example.com" # must match each entry's `iss`
feed_url = "https://peer.example.com/auth/revocations"
admin_token = "<bearer for the peer's feed>"
poll_seconds = 300A background poller per feed (revocation_poller.rs) fetches
GET {feed_url}?since={cursor_ms}&limit=..., sanity-checks each entry's iss
against the configured issuer, and applies remote revocations to the local
store. Durable cursors (get_revocation_cursor / set_revocation_cursor,
unix ms) survive restarts, and the cursor advances only when an entire page
applies cleanly — a partial failure replays that page on the next tick rather
than skipping revocations.
The poller fetches through poller_client, which builds the client with the
acdp SDK's safe_client (crates/acdp-registry-auth/src/revocation_poller.rs):
redirects are never followed (a feed answering 3xx is a failed poll
for that tick, and the cursor stays put), every connection re-runs the SSRF
DNS check, and a feed host that resolves into a private, loopback or
link-local range is refused. A peer whose feed is reachable only on an
internal hostname therefore cannot be polled. Not following redirects is
what stops a hostile or compromised peer from bouncing the poller, with its
admin_token bearer attached, at an internal address. Pinned by
poller_client_does_not_follow_redirects.
Where it's wired
- Routes:
build_router()incrates/acdp-registry-core/src/lib.rs. - Flow + verification:
crates/acdp-registry-auth/src/service.rs. - JWT sign/verify and JWKS:
crates/acdp-registry-auth/src/jwt.rs. - Stores:
challenge_store.rs,revocation_store.rs(in-memory / SQLite / PG). - Startup wiring (signer choice, ephemeral secret, poller spawn):
crates/acdp-registry-server/src/main.rs.