AllowedBy test vectors (v0.2.14-draft)#
TEST ONLY. Every key in these files comes from a public seed. Never use them outside conformance testing.
These are the CONF-1 §4 vectors. They follow specs/ v0.2.14-draft (CHANGES-0.2 §1–§28).
What they are for#
A spec in prose is read differently by every implementer. These files turn it into exact bytes and verdicts: fixed keys, signed documents, HTTP requests, each with the outcome every implementation MUST reach ("accept" plus the identity tuple, or a precise error code and status).
- Implementers (SDKs, nodes, verifiers in any language) run their code over every case. A disagreement means either the code or the spec is wrong, and it shows up before production.
- Interop: two independent implementations that both pass are byte-compatible (JCS, signatures, hashes, WebAuthn challenges, Merkle roots).
- Conformance claims (CONF-1 §2): "passes the v0.2 vectors" is the testable claim.
- Spec review: writing them forces every vague sentence to become a decision; the list below is what they surfaced.
- Regression: any spec change regenerates the files; the diff shows exactly what changed on the wire.
verify.py + verify_ext.py is a small reference verifier that shares no code with the generator (generate.py + generate_ext.py), so the two cross-check each other.
Regenerate and check#
python generate.py # writes every *.json here; needs only `cryptography` (>= 44)
python verify.py # reference verifier; asserts every case; exit 0 = all pass (601/601)The output is deterministic:
- Ed25519 seeds are
SHA-256("allowedby/test-vectors/0.2/ed25519/" || name). - P-256 scalars are derived the same way.
- ES256 uses RFC 6979 deterministic nonces, so ES256 signatures are reproducible too.
- Time is fixed at
now = 1761480000. - ULIDs and jtis are hash-derived.
Running the generator twice gives byte-identical files. The one caveat is the zlib build used for the status list. Do not hand-edit the files: regenerate them and diff.
Files#
Each file has cases: [{name, kind, input, expected, http_status?, output?, accept_tuple?}]. expected is "accept" or a spec error code.
| File | Contents |
|---|---|
keys.json |
All keys (public JWK, kid, private seed or scalar), the WebAuthn assertion builder recipe, the pairwise secret |
jcs.json |
RFC 8785 cases: key order (UTF-16), 4200.00→4200, number edge cases, unicode and escapes |
node-statement.json |
Statements for node.example.org (role keys, revoked_keys) and home.example.org |
service.json |
Verifier config: public_origin, trust anchors, route map, status max ages, service initiator key |
human-reg.json |
oaid-human+jwt (with rp_id) and pairwise ids for two audiences |
passport.json |
Passports A1 (tier 1), A2 (renewal, prev), A3 (new key), S1 (tier 0, ES256) and a wrong-role passport |
grant-core.json |
Grant cores, core JCS, SHA-256, WebAuthn challenge, batch challenge |
human-sig.json |
WebAuthn assertion with debug bytes, plus negative vectors: type, challenge, origin, rpIdHash, UP, UV, wrong key, altered display |
grant.json |
Countersigned grant, levels chosen by the route (L3 accept, L2 on an L3 route, level 3 on a synced passkey, qes_required), wrong role, tampered payload, expired, class lifetime, * or other audience, level, initiator, amount and currency; then every rule a grant must satisfy, one case each side of its limit: time, status reference, revoked keys, audiences, the registration and its level, human_sig members, batches, the ABY-3 constraints, custody tier |
proof.json |
Proof valid and invalid: htm, htu, query, normalisation, proxies, bdh, dth, iat ±119/120/121 and +59/60/61, actor_expired, kid, alg none, RS256, typ confusion, replay, the exact size budget, jti length, member types, actor.exp boundaries |
chain.json |
Depth-1 attenuated child (ES256 leaf) and broken chains: one case per rule of ABY-1 §4 and ABY-3 §3, and which grant of a chain fails first |
chain-depth.json |
ABY-2 §2 0.2.14: a chain is at most two JWS, counted before any JWS is parsed (431 envelope_too_large). Opt-in of the verifier profile: SDKs that still allow four JWS are on its opt_out list (CONTRACT Known gaps) |
request-digest.json |
request_digest computations, single-use accept, reuse, query and body mismatch, bodiless DELETE |
rebind.json |
Revisions 0/1/2 of one gid (same core and human_sig, distinct jti), node-side rebind via prev and via operator_sig, refusals |
status.json |
Status-list sets (clean, revoked, stale, age 3599/3601), bit decoding, revoked grant and human.reg, fail-closed |
revoked-ancestor.json |
Child valid, parent bit revoked → revoked |
envelope-9421.json |
RFC 9421 / Web Bot Auth profile instead of the proof JWT: Ed25519 and ES256, passport and chain, signature base shown; refusals for uncovered components, Content-Digest, tag, created ±, expires, nonce replay, wrong keyid, internal @target-uri |
passport-issuance.json |
POST {passports} with node nonce and dth over the key: tier 0 none (TTL capped), tier 0 orchestrator evidence (valid_until), node-scoped operator; refusals for nonce used or expired, wrong key, dth, tier 0 key reuse, P-384, unbound operator, tier 1 with none, stale, foreign or unregistered orchestrator evidence. Renewal: tier 1 accepted (prev), tier 0 refused, wrong key, attestation older than 7 days |
challenge.json |
Service-initiated grant_required (with the service's signed POST {approvals}, the node's answer, WWW-Authenticate, problem JSON and request_digest), runtime-initiated (no approve/poll/code/summary), passport_required (realm and error only), 403 with no challenge, 503 with Retry-After; the challenge scope (escaped-path characters, at most 256 bytes, else 400) |
approval-states.json |
All 25 state pairs (4 allowed), poll status per state, who may poll, creation rules (expires_in 60–3600, audience, initiator, level, callback host, fair-use cap), re-request after not_me, aid and code alphabet |
display.json |
display built from the service templates (en, fr, {fields}); refusals for a missing language, constraint or template, over 280 characters, non-decimal amount, non-ISO currency |
log.json |
8 entries (2 vouches, 6 passports) with salts and commitments, roots at sizes 1/3/4/7/8, checkpoints at 4 and 8 (C2SP signed notes), 2 witness cosignatures, inclusion and consistency proofs (good and bad), witness accept and conflict, log promise kept and broken |
trust-list.json |
Signed trust list: anchors, a pinned and an unpinned program, denied, vouching at depth 1 and 2 with min_vouchers 2; refusals (depth 3, one voucher, expired vouch, old kid, vouching off, impostor statement); witnesses_min counting only trusted witnesses within 24 h |
Not covered: positive QES (needs qualified certificate chains and EU trusted lists), and tier 1 and 2 hardware attestation evidence (TPM, Apple, Android, FIDO, cloud KMS, confidential computing). Those formats are vendor-defined and need real certificate chains; the vectors cover none and orchestrator only.
Ambiguities found (and the reading used)#
All of these are now decided in the specs: see specs/CHANGES-0.2.md §16.
- File names. Cases are split by topic; CONF-1 §4 now lists these files.
jtiin the core. ABY-1 §3.1 putsjtiin the core, but a revision is a new document. Per §15,jtiis outside the core and each revision has its own.iat/nbf/expstay in the core, so every revision keeps rev 0'siat.- Revision numbering. CONF-1 says "revisions 1 and 2", while ABY-1 says
revis 0 at issuance. The vectors use 0, 1 and 2. - Status-list
typ. OAID-1 and OAID-2 sayoaid-status+jwt; OAID-3 saysstatuslist+jwt. Per §15,statuslist+jwtis used. List age is measured from the list'siat. The read/write ceiling of 3600 s is inclusive. - Error codes the specs don't name. The vectors use:
invalid_signatureforhuman_sigand chain-link failures (ABY-2 §5 step 3 only says "the failure code");grant_insufficientfor an audience mismatch or"*", an unmet constraint, arequest_digestmismatch, and a failedinitiatorcheck;invalid_requestfor node-side rebind refusals.
rpId. ABY-1 §3.2 says rpId = "approval origin", but an rpId is a host. The vectors follow §15:human.reg.rp_id, with originhttps://<rp_id>.htunormalisation. The comparison is strict. The proof'shtumust already be normalised;HTTPS://API.EXAMPLE.COM:443/…is rejected. The verifier normalises the request path (percent-encoding, dot segments) and ignores forwarded headers.- Pairwise id.
‖is taken as plain UTF-8 concatenation with no separator:HMAC(home_secret, utf8(internal_id) || utf8(origin)). - Signature encodings differ.
human_sig.signatureis ASN.1 DER (WebAuthn), while JWS ES256 is rawr||s. clientDataJSON uses the browser member order, not JCS. - Rebind
operator_sig. Notypwas given before §15. The vectors useaby-operator+jwtover{gid, sub, aud, iat, exp ≤ iat+300}, carried in the body as{"operator_sig": …}. The rebind proof is signed by the new passport key. initiatoron chains. Only the root has a core, soinitiatoris checked on the root. A child must carryhumanbyte-identical to its parent's, and has nodisplay,human_sigorinitiator.- Clock skew on
exp. The 60 s skew (OAID-1 §4.4) is applied to a grant'sexp, so the expired vector usesexp + 61. Proofiatbounds are inclusive (−120 and +60 accept). - Batch challenge encoding. The
batchentries' encoding is unspecified; base64url core hashes are used. human.regstatus freshness. The home node's status list follows the same per-class freshness as the route.- RS256 vector. It carries a junk 256-byte signature with no RSA key. It must be refused on
algalone. - Constraints without state. The reference verifier keeps no shared counters, so
count,amount per: grantandwindoware treated as unsatisfiable (ABY-3 §3 permits this for services that cannot count). - Vouch signer. OAID-5 §4 does not say which key signs
oaid-vouch+jwt. The vectors use the voucher'sissuerole key. - Vouching depth with
min_vouchers. A node is at depth d when at leastmin_vouchersdistinct trusted nodes at depth < d vouch for it. Anchors and program nodes are depth 0. - Program level cap. A program node's
max_levelis the lower of the program's anchor entry and the trust list'sprograms[].max_level. - Program keys. The trust list pins program keys by thumbprint (
kids) only. The program list carries its JWK in the JWS header (jwk), checked against the pin. - Checkpoint key name. The signed-note key name is the log origin; cosignature key names are the witness node names.
- Witness refusals. A second checkpoint of the same size with another root, and a failed consistency proof, are both labelled
conflicthere; on the wire the witness uses the C2SPtlog-witnessstatuses. - Log promise.
promise_brokenandinvalid_proofare monitor findings, not registered error codes. - RFC 9421
alg. Optional; when present, the vectors use the RFC 9421 registry namesed25519andecdsa-p256-sha256.@target-uriincludes the query (unlikehtu) and is built frompublic_origin.Signature-Agentis the quoted node origin. - Display rendering. One language for the whole display: the human's if every capability has it, else the first common one; no per-line fallback.
scope,fieldsandamountvalues must match the ABY-3 §2 grammar before rendering, because they are copied into the text the human signs.{fields}is joined with ", ". - Approval creation. A caller that sends
initiatorgetsinvalid_request(it is not silently dropped).levelmust be 1 or 2.callbackmust behttpson an audience host. - Re-request after denial. A repeat within 10 minutes of
not_meorunknown_agentisrate_limited. - Runtime-initiated challenge. It also omits
expires, since no approval exists yet. The problem JSON carriesstatusandsingle_use: false. - Issuance codes. Nonce failures are
invalid_signature; an unsupported key, an unverified domain operator and tier 0 key reuse areinvalid_request. The orchestrator evidence format is defined here (typ: oaid-orchestrator+jwt,{iss, runtime, sandbox, key, iat, exp}incustody.evidence.orchestrator); OAID-6 only describes it. - Renewal without evidence keeps the old
custodyunchanged, includingvalid_until.