@oneaddress/partner-sdk 2.3.0 → 2.4.1
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/CHANGELOG.md +83 -0
- package/README.md +25 -4
- package/dist/{chunk-VGE5OE4D.mjs → chunk-4WYW6BM3.mjs} +7 -1
- package/dist/edge.js +7 -1
- package/dist/edge.mjs +1 -1
- package/dist/index.d.mts +50 -19
- package/dist/index.d.ts +50 -19
- package/dist/index.js +7 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,89 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [2.4.1] - 2026-10-06
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- **The retry table told partners that a `401` is retried, and that every 4xx is
|
|
15
|
+
filed as an authentication failure. Neither was true of the relay.** Both
|
|
16
|
+
sentences described an earlier version of the dispatch classifier and had
|
|
17
|
+
survived it, so a partner reading the published table built their handler
|
|
18
|
+
against behaviour the relay does not have.
|
|
19
|
+
|
|
20
|
+
What the relay actually does: a `401` or a `403` is **not retried** - the
|
|
21
|
+
dispatch is marked `auth_failed` and stops, because retrying a rejected
|
|
22
|
+
signature only repeats the rejection. A `400` or a `422` is classified
|
|
23
|
+
`partner_error`, not `auth_failed`, so the consumer's dashboard does not blame
|
|
24
|
+
the signature for a malformed body or an undeclared update kind. `403` was
|
|
25
|
+
absent from the table entirely.
|
|
26
|
+
|
|
27
|
+
Documentation only. No runtime code, no exported type and no wire format
|
|
28
|
+
changes in this release; `dist/index.js` is byte-identical to 2.4.0.
|
|
29
|
+
|
|
30
|
+
- **`verified: true` read as an assurance signal, and it is only a presence
|
|
31
|
+
marker.** It is `true` on a `mock` dispatch as well, so a recipient treating it
|
|
32
|
+
as "an identity check stands behind this" is wrong for sandbox runs, product
|
|
33
|
+
demonstrations and internal tests. The doc comments on `method` and `verified`
|
|
34
|
+
now say so, and name `method === 'identity_document'` as the field to route on.
|
|
35
|
+
|
|
36
|
+
## [2.4.0] - 2026-10-01
|
|
37
|
+
|
|
38
|
+
### Added
|
|
39
|
+
|
|
40
|
+
- **The skip response names the callback it is missing.** A handler built on this
|
|
41
|
+
SDK acknowledges an event whose callback was never wired with HTTP 200 and
|
|
42
|
+
skips it, which is correct. The response now also carries
|
|
43
|
+
`missing_callback: 'onTest'` (or `'onVerify'` / `'onAccountVerify'`) so the
|
|
44
|
+
SENDER can say what to do about it.
|
|
45
|
+
|
|
46
|
+
Why that matters, and it is a real incident rather than tidiness. OneAddress
|
|
47
|
+
sends five `address.test` records before a partner goes live, and the SDK routes
|
|
48
|
+
them to `onTest`, never to `onUpdate`, because the identities inside are
|
|
49
|
+
fabricated and must not reach a real customer record. A handler with no `onTest`
|
|
50
|
+
therefore answers all five with a clean 200 and processes none: delivery looks
|
|
51
|
+
perfect, nothing decrypts, no verification block is printed, and there is
|
|
52
|
+
nothing for the partner to return. The console warning this SDK already emits
|
|
53
|
+
names the callback correctly, but it lands in the receiver's own log, which is
|
|
54
|
+
precisely where nobody is looking when the person watching the verification run
|
|
55
|
+
is at the other end.
|
|
56
|
+
|
|
57
|
+
**Deliberately absent for an event this build has never heard of**, where no
|
|
58
|
+
callback name is the answer and upgrading the SDK is. A field naming one there
|
|
59
|
+
would be a confident wrong answer.
|
|
60
|
+
|
|
61
|
+
### Documentation
|
|
62
|
+
|
|
63
|
+
- **The blind-index deprecation notes cited the wrong rule and named the wrong
|
|
64
|
+
field.** 2.3.0's `@deprecated` note on `OneAddressVerifyEvent.customer` said
|
|
65
|
+
`customer` is refused because it is in `D5_BODY_NEVER`, and told the reader to
|
|
66
|
+
decrypt `session_envelope` instead. Both halves are wrong for that event, and
|
|
67
|
+
the conclusion is still right, which is why it survived review.
|
|
68
|
+
|
|
69
|
+
`OneAddressVerifyEvent` is `address.verify`, a LEGACY-shaped body: its
|
|
70
|
+
ciphertext is `address_encrypted`, not a `session_envelope`, and the D5 body
|
|
71
|
+
contract governs `address.updated` / `contact.updated` only. That body in fact
|
|
72
|
+
carries three other `D5_BODY_NEVER` keys quite legitimately (`version`,
|
|
73
|
+
`encryption_status`, `address_encrypted`), being one of the two legacy
|
|
74
|
+
composers. `customer` is absent from it because the relay stopped sending a
|
|
75
|
+
cleartext customer block in protocol 2026.2, which is a different and simpler
|
|
76
|
+
reason.
|
|
77
|
+
|
|
78
|
+
The practical correction: on `address.verify` the SDK decrypts
|
|
79
|
+
`address_encrypted` for you before calling `onVerify`, so read the verified
|
|
80
|
+
name, known names and account reference from `event.raw`. A reader following
|
|
81
|
+
the old note would have gone looking for a `session_envelope` that event never
|
|
82
|
+
carries.
|
|
83
|
+
|
|
84
|
+
`OneAddressCustomerMatch`'s own docblock had the same `session_envelope`
|
|
85
|
+
instruction and is now explicit about which field holds the ciphertext on which
|
|
86
|
+
event.
|
|
87
|
+
|
|
88
|
+
Nothing on the wire changed and no signature moved. Found while checking the
|
|
89
|
+
five-dispatch connection-verification path, where the `address.test` sender
|
|
90
|
+
does populate a `customer` block with a fabricated identity on purpose, as
|
|
91
|
+
`OneAddressTestEvent` documents.
|
|
92
|
+
|
|
10
93
|
## [2.3.0] - 2026-10-01
|
|
11
94
|
|
|
12
95
|
Documentation, and nothing in this package's own API. **No exported symbol was
|
package/README.md
CHANGED
|
@@ -463,13 +463,34 @@ What each response status means to us:
|
|
|
463
463
|
| You answer | We record | We do |
|
|
464
464
|
|---|---|---|
|
|
465
465
|
| `2xx` (and no `ok: false`) | delivered, awaiting your confirm | Wait for `confirmUpdate`. |
|
|
466
|
-
| `400` |
|
|
467
|
-
| `401` | auth failed
|
|
468
|
-
| `422` |
|
|
466
|
+
| `400` | partner error | Retry on the backoff. A malformed request cannot be fixed by retrying, but the class of problem (a stale timestamp, a body that is not JSON) usually clears on the next attempt. |
|
|
467
|
+
| `401` or `403` | **auth failed** | **Not retried.** See the warning below. |
|
|
468
|
+
| `422` | partner error | Retry. The handler sends this for a kind you have not declared in `acceptedUpdateTypes`; once you widen the declaration the retry is processed. |
|
|
469
469
|
| `500` | partner error | Retry. This is what the handler answers for a decrypt failure, a missing or invalid consent proof, or a throwing `onUpdate`, and it is the right answer for anything you want retried. |
|
|
470
470
|
| no response / timeout | unreachable | Retry. |
|
|
471
471
|
|
|
472
|
-
|
|
472
|
+
> **A 401 or 403 ends the delivery. It is not retried, and this README said the
|
|
473
|
+
> opposite until 5 October 2026.**
|
|
474
|
+
>
|
|
475
|
+
> Those two statuses are the only ones we read as a **rejected signature**, and
|
|
476
|
+
> a rejected signature does not fix itself: nothing about waiting and sending
|
|
477
|
+
> the same bytes again makes them verify. So the dispatch is parked in the
|
|
478
|
+
> `auth_failed` state and the retry cron excludes it from its candidate set.
|
|
479
|
+
> Once a dispatch is parked there, nothing moves it except a fresh address
|
|
480
|
+
> change, and the consumer has already paid for this one. Recovery is a support
|
|
481
|
+
> request to OneAddress.
|
|
482
|
+
>
|
|
483
|
+
> This is why the staged rotation exists (see **Rotating your webhook secret**
|
|
484
|
+
> below): stage the new secret, deploy it alongside the current one so your
|
|
485
|
+
> receiver accepts BOTH, verify, and only then press Switch over. Done in that
|
|
486
|
+
> order a 401 never happens. Deploying the new secret before switching over is
|
|
487
|
+
> the sequence that produces one, and it costs the consumer their update.
|
|
488
|
+
>
|
|
489
|
+
> A run of 401s across several partners at once is an alert on OUR side - a
|
|
490
|
+
> broken signing deploy or an unsynced secret - and worth telling us about
|
|
491
|
+
> rather than waiting out.
|
|
492
|
+
|
|
493
|
+
Every 4xx EXCEPT 401 and 403 is filed as "partner error" and retried; 401 and 403 are filed as "auth failed" and are not. Either way a 4xx you send deliberately reads, to the consumer, as a problem between you and OneAddress. Prefer a 500 for "try again" and a confirm of `no_match` for "not my customer".
|
|
473
494
|
|
|
474
495
|
---
|
|
475
496
|
|
|
@@ -1408,7 +1408,13 @@ function createOneAddressHandler(options) {
|
|
|
1408
1408
|
// NOSONAR
|
|
1409
1409
|
);
|
|
1410
1410
|
}
|
|
1411
|
-
return new Response(JSON.stringify({
|
|
1411
|
+
return new Response(JSON.stringify({
|
|
1412
|
+
ok: true,
|
|
1413
|
+
skipped: true,
|
|
1414
|
+
event: evt,
|
|
1415
|
+
...unwired ? { missing_callback: unwired } : {},
|
|
1416
|
+
accepted_update_types: acceptedUpdateTypes
|
|
1417
|
+
}), {
|
|
1412
1418
|
status: 200,
|
|
1413
1419
|
headers: { "Content-Type": "application/json" }
|
|
1414
1420
|
});
|
package/dist/edge.js
CHANGED
|
@@ -5804,7 +5804,13 @@ function createOneAddressHandler(options) {
|
|
|
5804
5804
|
// NOSONAR
|
|
5805
5805
|
);
|
|
5806
5806
|
}
|
|
5807
|
-
return new Response(JSON.stringify({
|
|
5807
|
+
return new Response(JSON.stringify({
|
|
5808
|
+
ok: true,
|
|
5809
|
+
skipped: true,
|
|
5810
|
+
event: evt,
|
|
5811
|
+
...unwired ? { missing_callback: unwired } : {},
|
|
5812
|
+
accepted_update_types: acceptedUpdateTypes
|
|
5813
|
+
}), {
|
|
5808
5814
|
status: 200,
|
|
5809
5815
|
headers: { "Content-Type": "application/json" }
|
|
5810
5816
|
});
|
package/dist/edge.mjs
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -442,12 +442,17 @@ interface OneAddressCustomer {
|
|
|
442
442
|
* It described a matching shape where each value was
|
|
443
443
|
* `base64url( HMAC-SHA256(yourBlindIndexSecret, normalize(field)) )`, so a
|
|
444
444
|
* receiver could locate a record WITHOUT decrypting the envelope. That shape
|
|
445
|
-
* is gone:
|
|
446
|
-
*
|
|
447
|
-
*
|
|
448
|
-
*
|
|
449
|
-
*
|
|
450
|
-
*
|
|
445
|
+
* is gone: no dispatch carries the block, the D5 body contract
|
|
446
|
+
* (`D5_BODY_NEVER`) refuses it outright on an `address.updated` /
|
|
447
|
+
* `contact.updated` body, and the portal control that enabled it has been
|
|
448
|
+
* removed.
|
|
449
|
+
*
|
|
450
|
+
* Nothing about the consumer is knowable before decryption, so match on the
|
|
451
|
+
* decrypted payload. Which field holds the ciphertext depends on the event: a
|
|
452
|
+
* D5 dispatch carries `session_envelope`, whose `SessionData` gives the
|
|
453
|
+
* verified name, known names and account number; the legacy-shaped
|
|
454
|
+
* `address.verify` carries `address_encrypted` instead, which this SDK decrypts
|
|
455
|
+
* for you (see {@link OneAddressVerifyEvent.raw}).
|
|
451
456
|
*
|
|
452
457
|
* The type is retained so an existing import compiles; it will go in the next
|
|
453
458
|
* major.
|
|
@@ -488,12 +493,30 @@ interface OneAddressLOA {
|
|
|
488
493
|
* consumed. Production dispatches always include it.
|
|
489
494
|
*/
|
|
490
495
|
interface OneAddressIdVerification {
|
|
491
|
-
/**
|
|
492
|
-
*
|
|
496
|
+
/**
|
|
497
|
+
* Verification method, and the field to route on.
|
|
498
|
+
*
|
|
499
|
+
* `identity_document`: a completed document plus biometric check ran at the
|
|
500
|
+
* identity provider and a government Document Verification Service
|
|
501
|
+
* cross-check was performed. This is what every production dispatch carries.
|
|
502
|
+
*
|
|
503
|
+
* `mock` - NO such verification stands behind this dispatch. It was
|
|
504
|
+
* authorised by a simulated credit, from a sandbox run, a product
|
|
505
|
+
* demonstration, or an internal test. A recipient treating an update as
|
|
506
|
+
* identity-assured should check for `identity_document` here rather than
|
|
507
|
+
* relying on `verified`.
|
|
508
|
+
*
|
|
509
|
+
* Carries no provider identity.
|
|
510
|
+
*/
|
|
493
511
|
method: string;
|
|
494
512
|
/** ISO-8601 timestamp the verification was completed */
|
|
495
513
|
verified_at: string;
|
|
496
|
-
/**
|
|
514
|
+
/**
|
|
515
|
+
* Always `true` on dispatches, so partners can rely on the field's presence.
|
|
516
|
+
*
|
|
517
|
+
* It is a presence marker and carries no assurance information: it is `true`
|
|
518
|
+
* for a `mock` dispatch too. `method` is the field that distinguishes them.
|
|
519
|
+
*/
|
|
497
520
|
verified: true;
|
|
498
521
|
/** Format tag — currently `oneaddress/v1` */
|
|
499
522
|
platform: string;
|
|
@@ -597,17 +620,25 @@ interface OneAddressVerifyEvent {
|
|
|
597
620
|
dispatchId: string;
|
|
598
621
|
batch_id: number;
|
|
599
622
|
user_id: string;
|
|
600
|
-
/** @deprecated NOT SENT.
|
|
601
|
-
*
|
|
602
|
-
*
|
|
603
|
-
*
|
|
604
|
-
*
|
|
605
|
-
*
|
|
606
|
-
*
|
|
623
|
+
/** @deprecated NOT SENT. The relay stopped putting a cleartext customer block
|
|
624
|
+
* on `address.verify` in protocol 2026.2. The consumer's name, known names
|
|
625
|
+
* and account reference travel encrypted inside `address_encrypted`, which
|
|
626
|
+
* this SDK decrypts for you before calling `onVerify`, so read them from
|
|
627
|
+
* {@link OneAddressVerifyEvent.raw} (the decrypted payload) rather than from
|
|
628
|
+
* here.
|
|
629
|
+
*
|
|
630
|
+
* Note that `address.verify` is a LEGACY-shaped body: the ciphertext is
|
|
631
|
+
* `address_encrypted`, not a `session_envelope`, and the D5 body contract
|
|
632
|
+
* (`D5_BODY_NEVER`) does not govern it. An earlier version of this comment
|
|
633
|
+
* cited that contract and named the wrong field.
|
|
634
|
+
*
|
|
635
|
+
* Kept optional so an existing narrowing check still compiles; it will never
|
|
636
|
+
* be populated. */
|
|
607
637
|
customer?: OneAddressCustomer;
|
|
608
|
-
/** @deprecated NOT SENT, and
|
|
609
|
-
* {@link OneAddressCustomerMatch}. Neither this nor `customer` is
|
|
610
|
-
* the earlier "exactly one of" described a shape that no longer
|
|
638
|
+
/** @deprecated NOT SENT, and no dispatch of any kind carries this block any
|
|
639
|
+
* more. See {@link OneAddressCustomerMatch}. Neither this nor `customer` is
|
|
640
|
+
* present, so the earlier "exactly one of" described a shape that no longer
|
|
641
|
+
* exists; match on the decrypted payload instead. */
|
|
611
642
|
customer_match?: OneAddressCustomerMatch;
|
|
612
643
|
address: OneAddressAddress;
|
|
613
644
|
/** The Letter of Authority. On D5 dispatches this is the structured
|
package/dist/index.d.ts
CHANGED
|
@@ -442,12 +442,17 @@ interface OneAddressCustomer {
|
|
|
442
442
|
* It described a matching shape where each value was
|
|
443
443
|
* `base64url( HMAC-SHA256(yourBlindIndexSecret, normalize(field)) )`, so a
|
|
444
444
|
* receiver could locate a record WITHOUT decrypting the envelope. That shape
|
|
445
|
-
* is gone:
|
|
446
|
-
*
|
|
447
|
-
*
|
|
448
|
-
*
|
|
449
|
-
*
|
|
450
|
-
*
|
|
445
|
+
* is gone: no dispatch carries the block, the D5 body contract
|
|
446
|
+
* (`D5_BODY_NEVER`) refuses it outright on an `address.updated` /
|
|
447
|
+
* `contact.updated` body, and the portal control that enabled it has been
|
|
448
|
+
* removed.
|
|
449
|
+
*
|
|
450
|
+
* Nothing about the consumer is knowable before decryption, so match on the
|
|
451
|
+
* decrypted payload. Which field holds the ciphertext depends on the event: a
|
|
452
|
+
* D5 dispatch carries `session_envelope`, whose `SessionData` gives the
|
|
453
|
+
* verified name, known names and account number; the legacy-shaped
|
|
454
|
+
* `address.verify` carries `address_encrypted` instead, which this SDK decrypts
|
|
455
|
+
* for you (see {@link OneAddressVerifyEvent.raw}).
|
|
451
456
|
*
|
|
452
457
|
* The type is retained so an existing import compiles; it will go in the next
|
|
453
458
|
* major.
|
|
@@ -488,12 +493,30 @@ interface OneAddressLOA {
|
|
|
488
493
|
* consumed. Production dispatches always include it.
|
|
489
494
|
*/
|
|
490
495
|
interface OneAddressIdVerification {
|
|
491
|
-
/**
|
|
492
|
-
*
|
|
496
|
+
/**
|
|
497
|
+
* Verification method, and the field to route on.
|
|
498
|
+
*
|
|
499
|
+
* `identity_document`: a completed document plus biometric check ran at the
|
|
500
|
+
* identity provider and a government Document Verification Service
|
|
501
|
+
* cross-check was performed. This is what every production dispatch carries.
|
|
502
|
+
*
|
|
503
|
+
* `mock` - NO such verification stands behind this dispatch. It was
|
|
504
|
+
* authorised by a simulated credit, from a sandbox run, a product
|
|
505
|
+
* demonstration, or an internal test. A recipient treating an update as
|
|
506
|
+
* identity-assured should check for `identity_document` here rather than
|
|
507
|
+
* relying on `verified`.
|
|
508
|
+
*
|
|
509
|
+
* Carries no provider identity.
|
|
510
|
+
*/
|
|
493
511
|
method: string;
|
|
494
512
|
/** ISO-8601 timestamp the verification was completed */
|
|
495
513
|
verified_at: string;
|
|
496
|
-
/**
|
|
514
|
+
/**
|
|
515
|
+
* Always `true` on dispatches, so partners can rely on the field's presence.
|
|
516
|
+
*
|
|
517
|
+
* It is a presence marker and carries no assurance information: it is `true`
|
|
518
|
+
* for a `mock` dispatch too. `method` is the field that distinguishes them.
|
|
519
|
+
*/
|
|
497
520
|
verified: true;
|
|
498
521
|
/** Format tag — currently `oneaddress/v1` */
|
|
499
522
|
platform: string;
|
|
@@ -597,17 +620,25 @@ interface OneAddressVerifyEvent {
|
|
|
597
620
|
dispatchId: string;
|
|
598
621
|
batch_id: number;
|
|
599
622
|
user_id: string;
|
|
600
|
-
/** @deprecated NOT SENT.
|
|
601
|
-
*
|
|
602
|
-
*
|
|
603
|
-
*
|
|
604
|
-
*
|
|
605
|
-
*
|
|
606
|
-
*
|
|
623
|
+
/** @deprecated NOT SENT. The relay stopped putting a cleartext customer block
|
|
624
|
+
* on `address.verify` in protocol 2026.2. The consumer's name, known names
|
|
625
|
+
* and account reference travel encrypted inside `address_encrypted`, which
|
|
626
|
+
* this SDK decrypts for you before calling `onVerify`, so read them from
|
|
627
|
+
* {@link OneAddressVerifyEvent.raw} (the decrypted payload) rather than from
|
|
628
|
+
* here.
|
|
629
|
+
*
|
|
630
|
+
* Note that `address.verify` is a LEGACY-shaped body: the ciphertext is
|
|
631
|
+
* `address_encrypted`, not a `session_envelope`, and the D5 body contract
|
|
632
|
+
* (`D5_BODY_NEVER`) does not govern it. An earlier version of this comment
|
|
633
|
+
* cited that contract and named the wrong field.
|
|
634
|
+
*
|
|
635
|
+
* Kept optional so an existing narrowing check still compiles; it will never
|
|
636
|
+
* be populated. */
|
|
607
637
|
customer?: OneAddressCustomer;
|
|
608
|
-
/** @deprecated NOT SENT, and
|
|
609
|
-
* {@link OneAddressCustomerMatch}. Neither this nor `customer` is
|
|
610
|
-
* the earlier "exactly one of" described a shape that no longer
|
|
638
|
+
/** @deprecated NOT SENT, and no dispatch of any kind carries this block any
|
|
639
|
+
* more. See {@link OneAddressCustomerMatch}. Neither this nor `customer` is
|
|
640
|
+
* present, so the earlier "exactly one of" described a shape that no longer
|
|
641
|
+
* exists; match on the decrypted payload instead. */
|
|
611
642
|
customer_match?: OneAddressCustomerMatch;
|
|
612
643
|
address: OneAddressAddress;
|
|
613
644
|
/** The Letter of Authority. On D5 dispatches this is the structured
|
package/dist/index.js
CHANGED
|
@@ -6166,7 +6166,13 @@ function createOneAddressHandler(options) {
|
|
|
6166
6166
|
// NOSONAR
|
|
6167
6167
|
);
|
|
6168
6168
|
}
|
|
6169
|
-
return new Response(JSON.stringify({
|
|
6169
|
+
return new Response(JSON.stringify({
|
|
6170
|
+
ok: true,
|
|
6171
|
+
skipped: true,
|
|
6172
|
+
event: evt,
|
|
6173
|
+
...unwired ? { missing_callback: unwired } : {},
|
|
6174
|
+
accepted_update_types: acceptedUpdateTypes
|
|
6175
|
+
}), {
|
|
6170
6176
|
status: 200,
|
|
6171
6177
|
headers: { "Content-Type": "application/json" }
|
|
6172
6178
|
});
|
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oneaddress/partner-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.1",
|
|
4
4
|
"description": "Official OneAddress partner integration SDK — webhook verification, address decryption (legacy + D5 session-envelope), LOA validation",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|