@oneaddress/conformance 3.3.0 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -16
- package/dist/checks.d.ts +244 -13
- package/dist/checks.js +540 -84
- package/dist/index.js +559 -98
- package/dist/plan.d.ts +2 -0
- package/dist/plan.js +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,18 +6,24 @@ CLI tool partners use to verify their webhook integration conforms to the OneAdd
|
|
|
6
6
|
|
|
7
7
|
Runs a suite of end-to-end checks against a partner's webhook endpoint, covering:
|
|
8
8
|
|
|
9
|
-
1
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
9
|
+
- `check-1` to `check-10`: a correctly signed dispatch is accepted and decrypted; a wrong signature, a stale timestamp and a future timestamp are refused; the response is fast; an unknown field and an unknown event are tolerated; a repeated dispatch id answers `duplicate: true`; malformed JSON is refused; a timestamp near the edge of the window is accepted.
|
|
10
|
+
- `check-11`: a payload the receiver cannot decrypt is refused rather than acknowledged.
|
|
11
|
+
- `check-12` and `check-13` (pull API): run only with `--customer-url`.
|
|
12
|
+
- `check-14`: an account reference that cannot match is not acknowledged as matched. Only with `--verifies-account-reference`.
|
|
13
|
+
- `check-15` and `check-16`: key-crossover handling and the `address.test` event.
|
|
14
|
+
- `check-17`: an envelope carrying a field the receiver cannot know is acknowledged. Every run with a key.
|
|
15
|
+
- `check-18`: one envelope per product line (up to five), each carrying that line as `product`, is acknowledged. Only when the run is given product lines (`productLines` in `runChecksDetailed`).
|
|
16
|
+
- The update-kind, contact and LOA checks described below.
|
|
17
|
+
|
|
18
|
+
**Not in this suite: the account check.** The run in the partner portal adds one
|
|
19
|
+
more check, `check-account-verify`, which sends a signed `account.verify` for a
|
|
20
|
+
made-up person and passes only on `match`, `no_match` or `no_account`. Go live
|
|
21
|
+
needs it, and OneAddress sends an update only to a service whose account check
|
|
22
|
+
answered `match`, so a receiver that answers `skipped` is not offered to
|
|
23
|
+
consumers. A green run here does not prove that check: run the checks in the
|
|
24
|
+
portal before you go live.
|
|
25
|
+
|
|
26
|
+
Every fixed dispatch id carries a per-run suffix, so a receiver with a persistent idempotency store decrypts again on a re-run rather than answering `duplicate: true`.
|
|
21
27
|
|
|
22
28
|
### Update kinds: what your receiver's code says it can take
|
|
23
29
|
|
|
@@ -73,7 +79,7 @@ oneaddress-conformance test https://api.mycompany.com/oneaddress \
|
|
|
73
79
|
--partner-id 123e4567-e89b-12d3-a456-426614174000 \
|
|
74
80
|
--public-key <base64-SPKI-of-your-ECDH-public-key>
|
|
75
81
|
|
|
76
|
-
# Include the pull-API checks (
|
|
82
|
+
# Include the pull-API checks (12 and 13)
|
|
77
83
|
oneaddress-conformance test https://api.mycompany.com/oneaddress \
|
|
78
84
|
--secret whsec_xxx \
|
|
79
85
|
--partner-id aaa... \
|
|
@@ -86,7 +92,7 @@ the point: supplying only the secret makes every signature check pass while the
|
|
|
86
92
|
payload stays sealed to this suite's built-in test key, so the failures land on
|
|
87
93
|
the acceptance checks and read as a decrypt fault in your receiver. Supplying
|
|
88
94
|
none is correct against a `npx @oneaddress/setup` scaffold, which is built
|
|
89
|
-
around those same test values. `--customer-url` only *adds* checks
|
|
95
|
+
around those same test values. `--customer-url` only *adds* checks 12 and 13; the
|
|
90
96
|
webhook checks still encrypt to `--public-key`, which is why it belongs in the
|
|
91
97
|
pull-API example too.
|
|
92
98
|
|
|
@@ -107,15 +113,29 @@ oneaddress-conformance test https://api.mycompany.com/oneaddress --accept addres
|
|
|
107
113
|
| `--secret` | Built-in synthetic test secret (used when partner is testing the wizard scaffold) | Your HMAC webhook secret. Also `ONEADDRESS_WEBHOOK_SECRET`. **Give all three of these or none** — a partial set is refused |
|
|
108
114
|
| `--partner-id` | Built-in test UUID | Your partner UUID. Also `ONEADDRESS_PARTNER_ID` |
|
|
109
115
|
| `--public-key` | Built-in test ECDH SPKI | Your ECDH P-256 public key, base64 SPKI. Also `ONEADDRESS_PUBLIC_KEY` |
|
|
110
|
-
| `--
|
|
116
|
+
| `--key-id` | `conformance-key-1` | Your `key_id` from the partner portal. Needed whenever your receiver resolves its private key by id (the SDK's `keyId`, the drop-in's `OA_PRIVATE_KEY_<KEY_ID>`), or every acceptance check answers 503 `missing_key`. Also `ONEADDRESS_KEY_ID` |
|
|
117
|
+
| `--retention-days` | `90` | Your retention window from the portal, 14 to 365. Sets `key_share_expiry` on every body. Also `ONEADDRESS_RETENTION_DAYS` |
|
|
118
|
+
| `--supports-key-crossover` | off | Set once your receiver skips a key-crossover sibling copy it cannot decrypt (`crossover_key_ids`). Adds `check-15` |
|
|
119
|
+
| `--verifies-account-reference` | off | Set when your receiver matches a dispatch to a customer record itself. Adds `check-14` |
|
|
120
|
+
| `--customer-url` | none | Customer-app base URL; when set, adds pull-API checks 12 and 13 |
|
|
111
121
|
| `--account-ref` | `CONF-0001` | The account reference every matching probe carries. Also `ONEADDRESS_ACCOUNT_REF`. Matters only if your receiver matches dispatches to your own customer records: it holds no `CONF-0001`, so it answers `no_match` — correctly — and the run cannot go green however good it is. Point this at a customer you already hold rather than writing test data into your system of record. The no-match probe does **not** derive from it; it sends `CONF-NOSUCH-<nonce>`, which cannot exist whatever you configure here |
|
|
112
122
|
| `--accept` | `address` | Comma-separated update kinds you accept in the partner portal (`address,phone,email`). Adds one contact probe per kind and is compared against what your receiver declares. Match it to the portal: the portal governs what OneAddress sends, this governs what gets tested. |
|
|
123
|
+
| `--loa-signing-key` | none (unsigned drill LOA) | Path to a P-256 private key (PKCS#8 PEM) the drill's consent proof (LOA) is signed with. Also `ONEADDRESS_LOA_SIGNING_KEY_FILE`. See below. |
|
|
124
|
+
|
|
125
|
+
## Receivers that verify the consent proof (LOA)
|
|
126
|
+
|
|
127
|
+
Every drill dispatch carries an encrypted Letter of Authority, as a real one does. This tool cannot sign it with OneAddress's key, so by default it carries a placeholder signature. A receiver that verifies LOAs refuses that. `@oneaddress/partner-sdk` does so by default since 2.8.0 (`requireLoa` defaults on and fetches OneAddress's published key when nothing is pinned), and so does the drop-in receiver (`OA_REQUIRE_LOA=1`). It, and is right to. The failed rows say so. Do not turn verification off to pass. Either:
|
|
128
|
+
|
|
129
|
+
- generate a P-256 **test** key pair, configure your receiver with its public half for this run only, and pass the private half with `--loa-signing-key <file>`; or
|
|
130
|
+
- run the go-live check in the partner portal, which sends a drill LOA signed with OneAddress's real key, so the receiver keeps its real `loaPublicKeyPem`.
|
|
131
|
+
|
|
132
|
+
With a signed drill LOA (either way) the run adds two **informational** results: whether the receiver refuses a LOA whose signed content was altered, and whether it refuses a dispatch with no LOA. They never change the result or the exit code, and in the portal they never affect go-live. A drill LOA always names the consumer `CONFORMANCE DRILL` and a scope that authorises nothing. It is signed in both LOA forms, v1 and v2, so a receiver that enforces v2 is drilled as it will be dispatched to: the drill envelope also names `CONFORMANCE DRILL`, and the forged-LOA probe alters the signed scope, which only verifying the signature can catch.
|
|
113
133
|
|
|
114
134
|
## Exit codes
|
|
115
135
|
|
|
116
136
|
- `0` — all checks passed
|
|
117
137
|
- `1` — one or more checks failed (individual check output indicates which)
|
|
118
|
-
- `
|
|
138
|
+
- `1` is also the code for a usage error (bad arguments, a partial credential set, a bad `--retention-days`); the usage text or the refusal says which
|
|
119
139
|
|
|
120
140
|
## Why it exists
|
|
121
141
|
|
package/dist/checks.d.ts
CHANGED
|
@@ -56,6 +56,82 @@ interface AckKindDeclaration {
|
|
|
56
56
|
ignored: string[];
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
/** The D5 LOA as a receiver decrypts it. Mirrors the SDK's `OneAddressD5LOA`. */
|
|
60
|
+
interface D5LoaFields {
|
|
61
|
+
consumer_name: string;
|
|
62
|
+
authorisation_date: string;
|
|
63
|
+
scope: string;
|
|
64
|
+
update_uid: string;
|
|
65
|
+
oneaddress_acn: string;
|
|
66
|
+
oneaddress_signature: string;
|
|
67
|
+
signature_algorithm: 'ECDSA-P256' | 'HMAC-SHA256';
|
|
68
|
+
/** v2 (24 Oct 2026). Every drill LOA carries all four. */
|
|
69
|
+
partner_id?: string;
|
|
70
|
+
envelope_sha256?: string;
|
|
71
|
+
consumer_typed_aliases?: string[];
|
|
72
|
+
oneaddress_signature_v2?: string;
|
|
73
|
+
}
|
|
74
|
+
/** What a caller asks the drill signer for: the uid plus the three v2 bindings. */
|
|
75
|
+
interface DrillLoaRequest {
|
|
76
|
+
updateUid: string;
|
|
77
|
+
partnerId: string;
|
|
78
|
+
/** Lowercase hex SHA-256 of the sealed envelope (`loaV2EnvelopeDigestInput`). */
|
|
79
|
+
envelopeSha256: string;
|
|
80
|
+
/** The envelope's `known_names`; {@link drillLoaTypedAliases} picks which are signed. */
|
|
81
|
+
typedAliases: readonly unknown[];
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* The LOA a conformance drill seals, in BOTH forms the relay signs since
|
|
86
|
+
* 24 Oct 2026: v1 (the pipe-joined form every SDK has always verified) and v2
|
|
87
|
+
* (signed per recipient, bound to the envelope beside it). New-matter register
|
|
88
|
+
* row of that date.
|
|
89
|
+
*
|
|
90
|
+
* Built here rather than inline in the body builder so that whatever signs a
|
|
91
|
+
* drill LOA (a placeholder today, a real drill signer when one is wired) signs
|
|
92
|
+
* exactly the strings the relay signs, through `sign`, and cannot drift into a
|
|
93
|
+
* third canonical form. `sign` receives each canonical string and returns the
|
|
94
|
+
* signature as lowercase hex (IEEE P1363 r||s for ECDSA P-256). Omitted, both
|
|
95
|
+
* signatures are the same syntactically valid placeholder as before, which a
|
|
96
|
+
* receiver holding OneAddress's real LOA key refuses, as it always has.
|
|
97
|
+
*
|
|
98
|
+
* The v2 bindings are real either way: `partner_id` is the drill's recipient,
|
|
99
|
+
* `envelope_sha256` digests the sealed envelope the body carries, the name is
|
|
100
|
+
* the envelope's own `verified_name`, and `consumer_typed_aliases` are the
|
|
101
|
+
* envelope's `known_names` through the same alias rule the relay applies, so a
|
|
102
|
+
* receiver on an SDK that enforces v2 without the key accepts a drill dispatch
|
|
103
|
+
* exactly as it would a real one, and is handed the same aliases.
|
|
104
|
+
*/
|
|
105
|
+
interface DrillLoa$1 {
|
|
106
|
+
consumer_name: string;
|
|
107
|
+
authorisation_date: string;
|
|
108
|
+
scope: string;
|
|
109
|
+
update_uid: string;
|
|
110
|
+
oneaddress_acn: '696 078 869';
|
|
111
|
+
oneaddress_signature: string;
|
|
112
|
+
signature_algorithm: 'ECDSA-P256';
|
|
113
|
+
partner_id: string;
|
|
114
|
+
envelope_sha256: string;
|
|
115
|
+
/** Typed aliases, signed apart from `consumer_name`; see `acceptTypedAliases`. */
|
|
116
|
+
consumer_typed_aliases: string[];
|
|
117
|
+
oneaddress_signature_v2: string;
|
|
118
|
+
}
|
|
119
|
+
/** The v1 canonical form, as `apps/customer/src/lib/loa-d5.ts` signs it. */
|
|
120
|
+
declare function drillLoaV1Canonical(l: Pick<DrillLoa$1, 'consumer_name' | 'authorisation_date' | 'scope' | 'update_uid' | 'oneaddress_acn'>): string;
|
|
121
|
+
/** The v2 canonical form of a drill LOA. */
|
|
122
|
+
declare function drillLoaV2Canonical(l: Omit<DrillLoa$1, 'oneaddress_signature' | 'oneaddress_signature_v2' | 'signature_algorithm' | 'oneaddress_acn'>): string;
|
|
123
|
+
declare function drillLoa(opts: {
|
|
124
|
+
consumerName: string;
|
|
125
|
+
authorisationDate: string;
|
|
126
|
+
updateUid: string;
|
|
127
|
+
partnerId: string;
|
|
128
|
+
/** The sealed `session_envelope` exactly as it goes in the body. */
|
|
129
|
+
envelope: string;
|
|
130
|
+
/** The envelope's `known_names`; the alias rule picks which are signed. */
|
|
131
|
+
knownNames?: readonly unknown[];
|
|
132
|
+
sign?: (canonical: string) => string;
|
|
133
|
+
}): DrillLoa$1;
|
|
134
|
+
|
|
59
135
|
/**
|
|
60
136
|
* What a check's PASS actually rests on.
|
|
61
137
|
*
|
|
@@ -80,6 +156,13 @@ interface CheckResult {
|
|
|
80
156
|
detail: string;
|
|
81
157
|
/** What this check's pass rests on. See {@link CheckBasis}. */
|
|
82
158
|
basis: CheckBasis;
|
|
159
|
+
/**
|
|
160
|
+
* Set on a result reported BESIDE the gating checks rather than among them
|
|
161
|
+
* (`ConformanceRun.informational`). It never changes a verdict or an exit
|
|
162
|
+
* code; it says something worth knowing about a receiver that is not yet a
|
|
163
|
+
* requirement of one.
|
|
164
|
+
*/
|
|
165
|
+
informational?: true;
|
|
83
166
|
/**
|
|
84
167
|
* Set when the check's own condition was met but the result proves nothing,
|
|
85
168
|
* because no acceptance check passed. `passed` is forced to false alongside
|
|
@@ -120,6 +203,21 @@ type ConformanceKind = 'address' | 'phone' | 'email';
|
|
|
120
203
|
* would break the runs that prove the scaffolds work.
|
|
121
204
|
*/
|
|
122
205
|
declare const DEFAULT_ACCOUNT_REF = "CONF-0001";
|
|
206
|
+
/** One of the partner's product lines, as check-18 seals it into the envelope. */
|
|
207
|
+
interface ConformanceProductLine {
|
|
208
|
+
id: string;
|
|
209
|
+
code: string;
|
|
210
|
+
name: string;
|
|
211
|
+
}
|
|
212
|
+
/** Check-18 probes at most this many lines, the portal's per-partner cap. */
|
|
213
|
+
declare const MAX_PRODUCT_LINES_PROBED = 5;
|
|
214
|
+
/** Fields `buildBody` sets or adds inside the session envelope. */
|
|
215
|
+
type SealedOverrides = {
|
|
216
|
+
account_number?: string;
|
|
217
|
+
verified_name?: string;
|
|
218
|
+
known_names?: string[];
|
|
219
|
+
product?: ConformanceProductLine;
|
|
220
|
+
} & Record<string, unknown>;
|
|
123
221
|
/**
|
|
124
222
|
* The key_id this suite labels its envelopes with when the caller does not name
|
|
125
223
|
* one. The built-in test key is a single key with no rotation history, so any
|
|
@@ -152,18 +250,88 @@ declare const DEFAULT_CONFORMANCE_KEY_ID = "conformance-key-1";
|
|
|
152
250
|
interface ConformanceKey {
|
|
153
251
|
keyId: string;
|
|
154
252
|
publicKeyB64: string;
|
|
253
|
+
/**
|
|
254
|
+
* The key's registered wrap, as `partner_keys.algorithm` stores it. Absent
|
|
255
|
+
* means ECDH P-256, which is every key the CLI generates. An RSA-OAEP or
|
|
256
|
+
* X-Wing key sealed as ECDH fails at the sender, so the portal passes this.
|
|
257
|
+
*/
|
|
258
|
+
algorithm?: string | null;
|
|
155
259
|
}
|
|
156
260
|
/**
|
|
157
261
|
* Accept either form at every call site, so the CLI's `buildBody(id, b64)` and
|
|
158
262
|
* the portal's `buildBody(id, { keyId, publicKeyB64 })` are one function.
|
|
159
263
|
*/
|
|
160
264
|
declare function asConformanceKey(key: string | ConformanceKey | null | undefined): ConformanceKey | null;
|
|
265
|
+
/** A drill LOA as the signer returns it: the SDK's `OneAddressD5LOA` shape. */
|
|
266
|
+
type DrillLoa = D5LoaFields;
|
|
267
|
+
/**
|
|
268
|
+
* Signs the drill LOA for one `update_uid`, in both forms: v2 binds the
|
|
269
|
+
* recipient, the sealed envelope's digest and its typed aliases, which the
|
|
270
|
+
* request carries (24 Oct 2026).
|
|
271
|
+
*
|
|
272
|
+
* INJECTED, NOT IMPORTED, so this package stays free of any key and of any
|
|
273
|
+
* knowledge of where one lives. The partner portal passes a signer that asks
|
|
274
|
+
* the customer app, which holds OneAddress's LOA signing key and signs ONLY a
|
|
275
|
+
* drill LOA (`@oneaddress/protocol`'s `drill-loa.ts`). The CLI can pass one
|
|
276
|
+
* built from a test key the partner generated (`localDrillLoaSigner`). With no
|
|
277
|
+
* signer the drill carries the historic placeholder signature, which a
|
|
278
|
+
* receiver that verifies consent refuses, and the report says why.
|
|
279
|
+
*/
|
|
280
|
+
type DrillLoaSigner = (request: DrillLoaRequest) => Promise<DrillLoa>;
|
|
281
|
+
/**
|
|
282
|
+
* The signer failed, or answered with something that is not a drill LOA for
|
|
283
|
+
* the uid asked for. Thrown out of the run rather than swallowed: sending the
|
|
284
|
+
* placeholder instead would fail a verifying receiver for a fault that is ours,
|
|
285
|
+
* which is the exact misreport the signer exists to end. The portal answers it
|
|
286
|
+
* as "we could not run the check", never as a verdict on the receiver.
|
|
287
|
+
*/
|
|
288
|
+
declare class LoaSignerError extends Error {
|
|
289
|
+
constructor(message: string);
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* A signer over a P-256 private key the CALLER holds (PKCS#8 PEM).
|
|
293
|
+
*
|
|
294
|
+
* For the CLI and for tests. It produces exactly what the OneAddress signer
|
|
295
|
+
* produces, the fixed drill name and scope included, so a receiver configured
|
|
296
|
+
* with the matching public key behaves as it will against a real drill. It is
|
|
297
|
+
* never OneAddress's key: a partner generates the pair, gives their receiver
|
|
298
|
+
* the public half for the run, and puts their real `loaPublicKeyPem` back
|
|
299
|
+
* afterwards.
|
|
300
|
+
*/
|
|
301
|
+
declare function localDrillLoaSigner(privateKeyPem: string): DrillLoaSigner;
|
|
302
|
+
/**
|
|
303
|
+
* What the drill LOA in one body should be.
|
|
304
|
+
*
|
|
305
|
+
* signed - the signer's LOA (or the placeholder when there is no signer)
|
|
306
|
+
* forged - the signer's LOA with its signed content altered afterwards, so
|
|
307
|
+
* the signature no longer covers what is sealed
|
|
308
|
+
* omitted - no `loa_encrypted` at all
|
|
309
|
+
*/
|
|
310
|
+
interface DrillLoaPlan {
|
|
311
|
+
signer?: DrillLoaSigner | null;
|
|
312
|
+
mode?: 'signed' | 'forged' | 'omitted';
|
|
313
|
+
}
|
|
161
314
|
/**
|
|
162
315
|
* Exported for `body-contract.test.ts` ONLY — nothing outside this package
|
|
163
316
|
* should build a dispatch body. It is exported rather than duplicated in the
|
|
164
317
|
* test because a test that rebuilds the body it is meant to check can only ever
|
|
165
318
|
* agree with itself; the guard has to run THIS function.
|
|
166
319
|
*/
|
|
320
|
+
/** The address every address-kind drill seals. Exported for check-16's commitment. */
|
|
321
|
+
declare const CONFORMANCE_ADDRESS: {
|
|
322
|
+
readonly street: "42 Collins Street";
|
|
323
|
+
readonly suburb: "Melbourne";
|
|
324
|
+
readonly state: "VIC";
|
|
325
|
+
readonly postcode: "3000";
|
|
326
|
+
readonly country: "AU";
|
|
327
|
+
};
|
|
328
|
+
/**
|
|
329
|
+
* Check-16's reading of a receiver's signed answer (3 Nov 2026), against the
|
|
330
|
+
* record the check SEALED: `match`, `mismatch` (present but wrong or
|
|
331
|
+
* malformed), or `absent` (an older receiver). Same canonical function as the
|
|
332
|
+
* relay and every SDK, from @oneaddress/protocol.
|
|
333
|
+
*/
|
|
334
|
+
declare function conformanceCommitmentCheck(answer: unknown, secret: string, verificationId: string, index: number, name: string): 'match' | 'mismatch' | 'absent';
|
|
167
335
|
declare function buildBody(partnerId: string,
|
|
168
336
|
/**
|
|
169
337
|
* The recipient key: a bare SPKI base64 string (the CLI's built-in test key,
|
|
@@ -178,19 +346,16 @@ publicKeyB64: string | ConformanceKey | null, extraFields?: Record<string, unkno
|
|
|
178
346
|
*/
|
|
179
347
|
kind?: ConformanceKind | string,
|
|
180
348
|
/**
|
|
181
|
-
* Override
|
|
349
|
+
* Override or add fields INSIDE the session envelope.
|
|
182
350
|
*
|
|
183
|
-
*
|
|
184
|
-
* envelope rather than in `extraFields`: `extraFields` lands on the
|
|
185
|
-
* wire, where the receiver cannot act on it and where identity has
|
|
186
|
-
* travelled since the D5 cutover. A no-match has to be a real no-match
|
|
187
|
-
* decryption, or the check proves nothing.
|
|
351
|
+
* Check-14 overrides the identity here, and it needs the override to be
|
|
352
|
+
* inside the envelope rather than in `extraFields`: `extraFields` lands on the
|
|
353
|
+
* cleartext wire, where the receiver cannot act on it and where identity has
|
|
354
|
+
* not travelled since the D5 cutover. A no-match has to be a real no-match
|
|
355
|
+
* after decryption, or the check proves nothing. Checks 17 and 18 seal an
|
|
356
|
+
* unknown field and a product line the same way.
|
|
188
357
|
*/
|
|
189
|
-
identity?:
|
|
190
|
-
account_number?: string;
|
|
191
|
-
verified_name?: string;
|
|
192
|
-
known_names?: string[];
|
|
193
|
-
},
|
|
358
|
+
identity?: SealedOverrides,
|
|
194
359
|
/**
|
|
195
360
|
* The retention window to advertise as `key_share_expiry`, in days.
|
|
196
361
|
*
|
|
@@ -204,7 +369,18 @@ identity?: {
|
|
|
204
369
|
* receiver that hard-codes "expiry is 90 days out" passes a drill that sends 90
|
|
205
370
|
* and then mis-handles its own 14-day window in production.
|
|
206
371
|
*/
|
|
207
|
-
retentionPeriodDays?: number | null | undefined
|
|
372
|
+
retentionPeriodDays?: number | null | undefined,
|
|
373
|
+
/**
|
|
374
|
+
* How the drill LOA is produced: signed by an injected signer, forged, or
|
|
375
|
+
* omitted. Absent means the placeholder signature every drill carried before
|
|
376
|
+
* 24 Oct 2026. See {@link DrillLoaPlan}.
|
|
377
|
+
*/
|
|
378
|
+
loaPlan?: DrillLoaPlan): Promise<string>;
|
|
379
|
+
/**
|
|
380
|
+
* Undici reports a refused redirect as `TypeError: fetch failed` with the
|
|
381
|
+
* reason only in `cause`, so a receiver behind a 307 read as unreachable.
|
|
382
|
+
*/
|
|
383
|
+
declare function describeFetchError(err: unknown): string;
|
|
208
384
|
/**
|
|
209
385
|
* Pull-API request signature, version 2: covers the method, path and query so
|
|
210
386
|
* a captured header pair cannot be replayed against another endpoint or query.
|
|
@@ -315,6 +491,33 @@ interface RunChecksOptions {
|
|
|
315
491
|
* dual-wrapped, which is why it opts the check in.
|
|
316
492
|
*/
|
|
317
493
|
supportsKeyCrossover?: boolean;
|
|
494
|
+
/**
|
|
495
|
+
* The partner's live product lines. Adds check-18, which seals one envelope
|
|
496
|
+
* per line (the first {@link MAX_PRODUCT_LINES_PROBED}) carrying that line as
|
|
497
|
+
* `product` and expects each to be acknowledged. Empty or absent runs no
|
|
498
|
+
* product check, because a partner with no lines is never sent one.
|
|
499
|
+
*/
|
|
500
|
+
productLines?: ConformanceProductLine[];
|
|
501
|
+
/**
|
|
502
|
+
* Signs the drill's consent proof (LOA). See {@link DrillLoaSigner}.
|
|
503
|
+
*
|
|
504
|
+
* With one, every body a receiver is meant to ACCEPT carries a LOA that
|
|
505
|
+
* verifies against the signer's public key, so a receiver that verifies
|
|
506
|
+
* consent can pass; and the run adds two informational probes (a forged LOA,
|
|
507
|
+
* a missing LOA) that a verifying receiver refuses. Without one the drill LOA
|
|
508
|
+
* is a placeholder, which such a receiver refuses on every acceptance check,
|
|
509
|
+
* and each of those rows says so.
|
|
510
|
+
*/
|
|
511
|
+
loaSigner?: DrillLoaSigner | null;
|
|
512
|
+
/**
|
|
513
|
+
* The `fetch` every request to `targetUrl` goes through. Defaults to the
|
|
514
|
+
* global one. The partner portal passes a fetch whose connection is pinned
|
|
515
|
+
* to the address its SSRF check approved, so a receiver hostname that
|
|
516
|
+
* re-resolves between the check and the connection cannot redirect the
|
|
517
|
+
* drill to an internal address. The CLI needs neither: it runs on the
|
|
518
|
+
* partner's own machine, against their own endpoint.
|
|
519
|
+
*/
|
|
520
|
+
fetchImpl?: typeof fetch;
|
|
318
521
|
}
|
|
319
522
|
/**
|
|
320
523
|
* A run, with the receiver's own capability declaration beside the results.
|
|
@@ -333,9 +536,37 @@ interface RunChecksOptions {
|
|
|
333
536
|
interface ConformanceRun {
|
|
334
537
|
checks: CheckResult[];
|
|
335
538
|
declaration: AckKindDeclaration;
|
|
539
|
+
/**
|
|
540
|
+
* Results that NEVER gate: reported beside `checks`, never inside them, so no
|
|
541
|
+
* pass count, stored verdict, go-live gate or exit code can be moved by one.
|
|
542
|
+
* Today these are the consent-proof probes, which run only with a
|
|
543
|
+
* `loaSigner` (without a real signature there is nothing to forge). A
|
|
544
|
+
* receiver that does not verify LOAs yet is told so here, as a fact about it,
|
|
545
|
+
* rather than failed for it.
|
|
546
|
+
*/
|
|
547
|
+
informational: CheckResult[];
|
|
548
|
+
/** True when the drill LOAs this run sent were signed rather than placeholders. */
|
|
549
|
+
loaSigned: boolean;
|
|
336
550
|
}
|
|
337
551
|
declare function runChecksDetailed(options: RunChecksOptions): Promise<ConformanceRun>;
|
|
338
552
|
declare function runChecksDetailed(url: string, secret?: string, partnerId?: string, publicKeyB64?: string): Promise<ConformanceRun>;
|
|
553
|
+
/**
|
|
554
|
+
* Explain, on each failed row it could have caused, that the drill LOA was
|
|
555
|
+
* UNSIGNED.
|
|
556
|
+
*
|
|
557
|
+
* The CLI has no access to OneAddress's signing key and never will, so a
|
|
558
|
+
* receiver that verifies consent (`loaPublicKeyPem`) refuses its drill, which
|
|
559
|
+
* is the receiver being right. Reported as a bare `HTTP 500, expected 2xx` that
|
|
560
|
+
* read as a broken receiver and pushed the partner to switch verification off.
|
|
561
|
+
* The row stays FAILED, because nothing was accepted and the run must not
|
|
562
|
+
* certify what it did not see, and it now says the two honest ways forward.
|
|
563
|
+
*
|
|
564
|
+
* Applied only to a failed row on a body that carried a LOA, so a receiver that
|
|
565
|
+
* does not verify sees no change.
|
|
566
|
+
*/
|
|
567
|
+
declare function annotateUnsignedLoa(results: CheckResult[]): CheckResult[];
|
|
568
|
+
/** Said once per affected row. Exported for the test that pins it. */
|
|
569
|
+
declare const UNSIGNED_LOA_NOTE: string;
|
|
339
570
|
/**
|
|
340
571
|
* The CLI's entry point: the checks alone.
|
|
341
572
|
*
|
|
@@ -374,4 +605,4 @@ declare function runChecks(options: RunChecksOptions): Promise<CheckResult[]>;
|
|
|
374
605
|
*/
|
|
375
606
|
declare function markUnprovenChecks(results: CheckResult[]): CheckResult[];
|
|
376
607
|
|
|
377
|
-
export { type CheckBasis, type CheckResult, type ConformanceKey, type ConformanceRun, DEFAULT_ACCOUNT_REF, DEFAULT_CONFORMANCE_KEY_ID, type RunChecksOptions, asConformanceKey, buildBody, markUnprovenChecks, runChecks, runChecksDetailed, signPullV2 };
|
|
608
|
+
export { CONFORMANCE_ADDRESS, type CheckBasis, type CheckResult, type ConformanceKey, type ConformanceProductLine, type ConformanceRun, DEFAULT_ACCOUNT_REF, DEFAULT_CONFORMANCE_KEY_ID, type DrillLoa, type DrillLoaPlan, type DrillLoaRequest, type DrillLoaSigner, LoaSignerError, MAX_PRODUCT_LINES_PROBED, type RunChecksOptions, type SealedOverrides, UNSIGNED_LOA_NOTE, annotateUnsignedLoa, asConformanceKey, buildBody, conformanceCommitmentCheck, describeFetchError, drillLoa, drillLoaV1Canonical, drillLoaV2Canonical, localDrillLoaSigner, markUnprovenChecks, runChecks, runChecksDetailed, signPullV2 };
|