@serfab/cadre-core 0.8.1 → 0.9.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 +2 -2
- package/dist/cadre-node.d.ts +101 -61
- package/dist/cadre-node.js +165 -124
- package/dist/cadre-node.js.map +1 -1
- package/dist/control-cohort.d.ts +15 -15
- package/dist/control-cohort.js +14 -14
- package/dist/control-cohort.js.map +1 -1
- package/dist/control-database.d.ts +51 -34
- package/dist/control-database.js +72 -56
- package/dist/control-database.js.map +1 -1
- package/dist/control-formation-recorder.d.ts +2 -2
- package/dist/control-formation-recorder.js +2 -2
- package/dist/control-schema.d.ts +1 -1
- package/dist/control-schema.js +57 -33
- package/dist/control-schema.js.map +1 -1
- package/dist/device-token.d.ts +1 -1
- package/dist/device-token.js +1 -1
- package/dist/{authority-key.d.ts → ed25519-key.d.ts} +11 -10
- package/dist/{authority-key.js → ed25519-key.js} +9 -10
- package/dist/ed25519-key.js.map +1 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/dist/key-store.d.ts +1 -1
- package/dist/key-store.js +1 -1
- package/dist/peer-authorization.d.ts +28 -6
- package/dist/peer-authorization.js +33 -7
- package/dist/peer-authorization.js.map +1 -1
- package/dist/peer-record.d.ts +3 -3
- package/dist/peer-record.js +3 -3
- package/dist/push-node.d.ts +38 -0
- package/dist/push-node.js +48 -0
- package/dist/push-node.js.map +1 -0
- package/dist/push-notifier-apns.d.ts +10 -2
- package/dist/push-notifier-apns.js +14 -10
- package/dist/push-notifier-apns.js.map +1 -1
- package/dist/push-notifier-fcm.d.ts +7 -1
- package/dist/push-notifier-fcm.js +9 -10
- package/dist/push-notifier-fcm.js.map +1 -1
- package/dist/push-notifier.d.ts +16 -35
- package/dist/push-notifier.js +16 -44
- package/dist/push-notifier.js.map +1 -1
- package/dist/seed-bootstrap.d.ts +70 -51
- package/dist/seed-bootstrap.js +168 -106
- package/dist/seed-bootstrap.js.map +1 -1
- package/dist/seed-trust-policy.d.ts +11 -11
- package/dist/seed-trust-policy.js +11 -11
- package/dist/seed-trust-policy.js.map +1 -1
- package/dist/strand-database.d.ts +5 -5
- package/dist/strand-database.js +4 -4
- package/dist/strand-database.js.map +1 -1
- package/dist/strand-formation-protocol.d.ts +1 -1
- package/dist/strand-formation-protocol.js +1 -1
- package/dist/strand-instance-manager.d.ts +1 -1
- package/dist/strand-instance-manager.js +1 -1
- package/dist/strand-instance-manager.js.map +1 -1
- package/dist/strand-member-key.d.ts +6 -6
- package/dist/strand-member-key.js +6 -6
- package/dist/strand-member-key.js.map +1 -1
- package/dist/strand-member-registry.d.ts +7 -7
- package/dist/strand-member-registry.js +5 -5
- package/dist/strand-member-registry.js.map +1 -1
- package/dist/strand-membership-writer.d.ts +84 -84
- package/dist/strand-membership-writer.js +90 -90
- package/dist/strand-membership-writer.js.map +1 -1
- package/dist/types.d.ts +52 -32
- package/dist/types.js.map +1 -1
- package/package.json +7 -3
- package/src/cadre-node.ts +170 -126
- package/src/control-cohort.ts +17 -17
- package/src/control-database.ts +76 -59
- package/src/control-formation-recorder.ts +2 -2
- package/src/control-schema.ts +57 -33
- package/src/device-token.ts +1 -1
- package/src/{authority-key.ts → ed25519-key.ts} +12 -11
- package/src/index.ts +21 -19
- package/src/key-store.ts +1 -1
- package/src/peer-authorization.ts +35 -7
- package/src/peer-record.ts +3 -3
- package/src/push-node.ts +64 -0
- package/src/push-notifier-apns.ts +16 -12
- package/src/push-notifier-fcm.ts +9 -10
- package/src/push-notifier.ts +16 -57
- package/src/seed-bootstrap.ts +179 -115
- package/src/seed-trust-policy.ts +18 -18
- package/src/strand-database.ts +6 -6
- package/src/strand-formation-protocol.ts +1 -1
- package/src/strand-instance-manager.ts +2 -2
- package/src/strand-member-key.ts +7 -7
- package/src/strand-member-registry.ts +10 -10
- package/src/strand-membership-writer.ts +127 -127
- package/src/types.ts +52 -32
- package/dist/authority-key.js.map +0 -1
|
@@ -2,12 +2,12 @@ import debug from 'debug';
|
|
|
2
2
|
import { digest, verify } from '@optimystic/quereus-plugin-crypto';
|
|
3
3
|
const log = debug('sereus:cadre:peer-authorization');
|
|
4
4
|
/**
|
|
5
|
-
* Canonical digest an
|
|
5
|
+
* Canonical digest an owner signs to authorize a peer.
|
|
6
6
|
*
|
|
7
7
|
* This is the exact byte construction {@link SeedBootstrapService.authorizePeer}
|
|
8
8
|
* signs over when it inserts an authorized `CadrePeer` row:
|
|
9
9
|
* `digest([peerId], 'sha256', 'base64url')`. Factored into one place so the
|
|
10
|
-
* producer (
|
|
10
|
+
* producer (owner signing) and the verifier (the offline `cadre enroll
|
|
11
11
|
* register` check) can never drift apart — change the digest here and both move
|
|
12
12
|
* together. The SQL mirror is the bare single-field `digest(coalesce(new.PeerId, old.PeerId))`.
|
|
13
13
|
*/
|
|
@@ -15,22 +15,48 @@ export function peerAuthorizationDigest(peerId) {
|
|
|
15
15
|
return digest([peerId], 'sha256', 'base64url');
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
18
|
+
* Canonical digest an owner signs to VOUCH a `CadrePeer` membership row (insert
|
|
19
|
+
* and the owner re-touch update). Binds the peer id to the row's single-use
|
|
20
|
+
* `StampId` nonce, so a captured signed insert cannot be replayed (the `StampId` is
|
|
21
|
+
* unique) and — because {@link cadrePeerRemoveDigest} scopes a DIFFERENT payload — the
|
|
22
|
+
* stored voucher (`VouchSig`) cannot be replayed to authorize a delete.
|
|
23
|
+
*
|
|
24
|
+
* The SQL mirror is `digest(new.PeerId, new.StampId)` (two TEXT fields), matching the
|
|
25
|
+
* canonical multi-field framing in control-database.ts:buildAuthorizationMessage.
|
|
26
|
+
*/
|
|
27
|
+
export function cadrePeerVoucherDigest(peerId, stampId) {
|
|
28
|
+
return digest([peerId, stampId], 'sha256', 'base64url');
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Canonical digest an owner signs to REMOVE a `CadrePeer` row. Deliberately a
|
|
32
|
+
* distinct payload from {@link cadrePeerVoucherDigest} (adds the `'remove'` action
|
|
33
|
+
* tag) so the row's stored voucher — a signature over the voucher digest — can never
|
|
34
|
+
* satisfy this delete check. The signature is supplied in write context and never
|
|
35
|
+
* stored, so no reader can replay it; binding the live row's `StampId` also invalidates
|
|
36
|
+
* any captured remove after a delete+reinsert (the nonce rotates).
|
|
37
|
+
*
|
|
38
|
+
* SQL mirror: `digest(old.PeerId, old.StampId, 'remove')`.
|
|
39
|
+
*/
|
|
40
|
+
export function cadrePeerRemoveDigest(peerId, stampId) {
|
|
41
|
+
return digest([peerId, stampId, 'remove'], 'sha256', 'base64url');
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Verify that `signature` is a valid owner ed25519 signature over `peerId`'s
|
|
45
|
+
* authorization digest, using `ownerPublicKey` (base64url).
|
|
20
46
|
*
|
|
21
47
|
* This is the mirror of the signing done in
|
|
22
48
|
* {@link SeedBootstrapService.authorizePeer}: it checks the signature against
|
|
23
49
|
* {@link peerAuthorizationDigest}. A `true` result means the holder of the
|
|
24
|
-
*
|
|
50
|
+
* owner private key vouched for this peer ID — it does NOT mean the peer is
|
|
25
51
|
* registered anywhere.
|
|
26
52
|
*
|
|
27
53
|
* Returns a boolean and never throws: malformed base64url, a bad/garbage key, or
|
|
28
54
|
* any crypto failure resolves to `false` (callers want a verdict, not an
|
|
29
55
|
* exception). The catch is logged at debug.
|
|
30
56
|
*/
|
|
31
|
-
export function verifyPeerAuthorization(peerId,
|
|
57
|
+
export function verifyPeerAuthorization(peerId, ownerPublicKey, signature) {
|
|
32
58
|
try {
|
|
33
|
-
return verify(peerAuthorizationDigest(peerId), signature,
|
|
59
|
+
return verify(peerAuthorizationDigest(peerId), signature, ownerPublicKey, 'ed25519', 'base64url', 'base64url', 'base64url');
|
|
34
60
|
}
|
|
35
61
|
catch (error) {
|
|
36
62
|
log('verifyPeerAuthorization failed: %o', error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"peer-authorization.js","sourceRoot":"","sources":["../src/peer-authorization.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAEnE,MAAM,GAAG,GAAG,KAAK,CAAC,iCAAiC,CAAC,CAAC;AAErD;;;;;;;;;GASG;AACH,MAAM,UAAU,uBAAuB,CAAC,MAAc;IACpD,OAAO,MAAM,CAAC,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,WAAW,CAAW,CAAC;AAC3D,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,uBAAuB,CACrC,MAAc,EACd,
|
|
1
|
+
{"version":3,"file":"peer-authorization.js","sourceRoot":"","sources":["../src/peer-authorization.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAEnE,MAAM,GAAG,GAAG,KAAK,CAAC,iCAAiC,CAAC,CAAC;AAErD;;;;;;;;;GASG;AACH,MAAM,UAAU,uBAAuB,CAAC,MAAc;IACpD,OAAO,MAAM,CAAC,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,WAAW,CAAW,CAAC;AAC3D,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,sBAAsB,CAAC,MAAc,EAAE,OAAe;IACpE,OAAO,MAAM,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,EAAE,WAAW,CAAW,CAAC;AACpE,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,qBAAqB,CAAC,MAAc,EAAE,OAAe;IACnE,OAAO,MAAM,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,QAAQ,EAAE,WAAW,CAAW,CAAC;AAC9E,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,uBAAuB,CACrC,MAAc,EACd,cAAsB,EACtB,SAAiB;IAEjB,IAAI,CAAC;QACH,OAAO,MAAM,CACX,uBAAuB,CAAC,MAAM,CAAC,EAC/B,SAAS,EACT,cAAc,EACd,SAAS,EACT,WAAW,EACX,WAAW,EACX,WAAW,CACZ,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,GAAG,CAAC,oCAAoC,EAAE,KAAK,CAAC,CAAC;QACjD,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
package/dist/peer-record.d.ts
CHANGED
|
@@ -49,7 +49,7 @@ export declare function peerRecordSignedPayload(peerId: string, multiaddr: strin
|
|
|
49
49
|
* preserved and is the order signed over).
|
|
50
50
|
*
|
|
51
51
|
* @param fields - the record fields to sign (signaling addr first by convention)
|
|
52
|
-
* @param privateKeyB64 - base64url ed25519 seed (see `
|
|
52
|
+
* @param privateKeyB64 - base64url ed25519 seed (see `ed25519KeyPairFromLibp2p`)
|
|
53
53
|
*/
|
|
54
54
|
export declare function signPeerRecord(fields: {
|
|
55
55
|
peerId: string;
|
|
@@ -81,8 +81,8 @@ export declare function orderSignalingFirst(addrs: string[]): string[];
|
|
|
81
81
|
/**
|
|
82
82
|
* Default resolve trust gate: trust any peer that has a `CadrePeer` row.
|
|
83
83
|
*
|
|
84
|
-
* A row only exists because an
|
|
85
|
-
* presence already means "
|
|
84
|
+
* A row only exists because an owner signed its `AuthorizedInsert`, so row
|
|
85
|
+
* presence already means "owner-vouched member". This is the seam where a
|
|
86
86
|
* stricter policy (trust circle, pinned keys) plugs in — see
|
|
87
87
|
* {@link PeerResolveTrustPolicy}.
|
|
88
88
|
*/
|
package/dist/peer-record.js
CHANGED
|
@@ -54,7 +54,7 @@ export function peerRecordSignedPayload(peerId, multiaddr, updatedAt) {
|
|
|
54
54
|
* preserved and is the order signed over).
|
|
55
55
|
*
|
|
56
56
|
* @param fields - the record fields to sign (signaling addr first by convention)
|
|
57
|
-
* @param privateKeyB64 - base64url ed25519 seed (see `
|
|
57
|
+
* @param privateKeyB64 - base64url ed25519 seed (see `ed25519KeyPairFromLibp2p`)
|
|
58
58
|
*/
|
|
59
59
|
export function signPeerRecord(fields, privateKeyB64) {
|
|
60
60
|
const payloadDigest = peerRecordSignedPayload(fields.peerId, fields.addrs.join(','), fields.updatedAt);
|
|
@@ -102,8 +102,8 @@ export function orderSignalingFirst(addrs) {
|
|
|
102
102
|
/**
|
|
103
103
|
* Default resolve trust gate: trust any peer that has a `CadrePeer` row.
|
|
104
104
|
*
|
|
105
|
-
* A row only exists because an
|
|
106
|
-
* presence already means "
|
|
105
|
+
* A row only exists because an owner signed its `AuthorizedInsert`, so row
|
|
106
|
+
* presence already means "owner-vouched member". This is the seam where a
|
|
107
107
|
* stricter policy (trust circle, pinned keys) plugs in — see
|
|
108
108
|
* {@link PeerResolveTrustPolicy}.
|
|
109
109
|
*/
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* push-node.ts — Node-only subpath entry for platform push **construction**.
|
|
3
|
+
*
|
|
4
|
+
* Import from the dedicated subpath, never the package root:
|
|
5
|
+
*
|
|
6
|
+
* ```ts
|
|
7
|
+
* import { createPushNotifier } from '@serfab/cadre-core/push-node';
|
|
8
|
+
* ```
|
|
9
|
+
*
|
|
10
|
+
* The FCM/APNs implementations reach for `node:crypto` / `node:http2`, so they
|
|
11
|
+
* are quarantined here — unreachable from the cross-platform `./index.js` graph
|
|
12
|
+
* (same isolation pattern as `./key-store-file`). A React Native / browser entry
|
|
13
|
+
* never resolves this path, so the Node builtins never reach a bundler that
|
|
14
|
+
* cannot satisfy them. The core references only the {@link PushNotifier}
|
|
15
|
+
* *interface* (`push-notifier.ts`) and a Node host injects the instance built
|
|
16
|
+
* here into `CadreNodeConfig.push.notifier`.
|
|
17
|
+
*/
|
|
18
|
+
import type { PushCredentials } from './types.js';
|
|
19
|
+
import type { PushNotifier } from './push-notifier.js';
|
|
20
|
+
import { createFcmPushNotifier, type FcmPushDeps } from './push-notifier-fcm.js';
|
|
21
|
+
import { createApnsPushNotifier, type ApnsPushDeps } from './push-notifier-apns.js';
|
|
22
|
+
/**
|
|
23
|
+
* Per-platform transport/clock/log seams, injected by tests. Defaults are the
|
|
24
|
+
* real implementations (global `fetch` for FCM, a `node:http2` session for APNs).
|
|
25
|
+
*/
|
|
26
|
+
export interface PushNotifierDeps {
|
|
27
|
+
fcm?: FcmPushDeps;
|
|
28
|
+
apns?: ApnsPushDeps;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Build a {@link PushNotifier} router over the configured credentials. Only the
|
|
32
|
+
* platforms whose credentials are present get a backing implementation; a `send`
|
|
33
|
+
* for an unconfigured platform returns a best-effort `no <platform> credentials`
|
|
34
|
+
* failure rather than throwing.
|
|
35
|
+
*/
|
|
36
|
+
export declare function createPushNotifier(creds: PushCredentials, deps?: PushNotifierDeps): PushNotifier;
|
|
37
|
+
export { createFcmPushNotifier, createApnsPushNotifier };
|
|
38
|
+
export type { FcmPushDeps, ApnsPushDeps };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* push-node.ts — Node-only subpath entry for platform push **construction**.
|
|
3
|
+
*
|
|
4
|
+
* Import from the dedicated subpath, never the package root:
|
|
5
|
+
*
|
|
6
|
+
* ```ts
|
|
7
|
+
* import { createPushNotifier } from '@serfab/cadre-core/push-node';
|
|
8
|
+
* ```
|
|
9
|
+
*
|
|
10
|
+
* The FCM/APNs implementations reach for `node:crypto` / `node:http2`, so they
|
|
11
|
+
* are quarantined here — unreachable from the cross-platform `./index.js` graph
|
|
12
|
+
* (same isolation pattern as `./key-store-file`). A React Native / browser entry
|
|
13
|
+
* never resolves this path, so the Node builtins never reach a bundler that
|
|
14
|
+
* cannot satisfy them. The core references only the {@link PushNotifier}
|
|
15
|
+
* *interface* (`push-notifier.ts`) and a Node host injects the instance built
|
|
16
|
+
* here into `CadreNodeConfig.push.notifier`.
|
|
17
|
+
*/
|
|
18
|
+
import { createFcmPushNotifier } from './push-notifier-fcm.js';
|
|
19
|
+
import { createApnsPushNotifier } from './push-notifier-apns.js';
|
|
20
|
+
/**
|
|
21
|
+
* Build a {@link PushNotifier} router over the configured credentials. Only the
|
|
22
|
+
* platforms whose credentials are present get a backing implementation; a `send`
|
|
23
|
+
* for an unconfigured platform returns a best-effort `no <platform> credentials`
|
|
24
|
+
* failure rather than throwing.
|
|
25
|
+
*/
|
|
26
|
+
export function createPushNotifier(creds, deps = {}) {
|
|
27
|
+
const fcm = creds.fcm ? createFcmPushNotifier(creds.fcm, deps.fcm) : undefined;
|
|
28
|
+
const apns = creds.apns ? createApnsPushNotifier(creds.apns, deps.apns) : undefined;
|
|
29
|
+
async function send(msg) {
|
|
30
|
+
if (msg.platform === 'fcm')
|
|
31
|
+
return fcm ? fcm.send(msg) : noCreds('fcm');
|
|
32
|
+
if (msg.platform === 'apns')
|
|
33
|
+
return apns ? apns.send(msg) : noCreds('apns');
|
|
34
|
+
return { ok: false, unregistered: false, error: `unknown platform ${String(msg.platform)}` };
|
|
35
|
+
}
|
|
36
|
+
async function close() {
|
|
37
|
+
await Promise.all([fcm?.close(), apns?.close()]);
|
|
38
|
+
}
|
|
39
|
+
return { send, close };
|
|
40
|
+
}
|
|
41
|
+
/** Best-effort no-op result for a platform with no configured credentials. */
|
|
42
|
+
function noCreds(platform) {
|
|
43
|
+
return { ok: false, unregistered: false, error: `no ${platform} credentials` };
|
|
44
|
+
}
|
|
45
|
+
// Per-platform builders + their injected-dep types, for a host that wants a
|
|
46
|
+
// single-platform notifier or to inject a fake transport directly.
|
|
47
|
+
export { createFcmPushNotifier, createApnsPushNotifier };
|
|
48
|
+
//# sourceMappingURL=push-node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"push-node.js","sourceRoot":"","sources":["../src/push-node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,OAAO,EAAE,qBAAqB,EA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AAsB;IACrC,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,QAAQ,cAAc,EAAE,CAAC;AACjF,CAAC;AAED,4EAA4E;AAC5E,mEAAmE;AACnE,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,CAAC"}
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* push-notifier-apns.ts — APNs HTTP/2 strand-wake delivery.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* sends a background data push over an HTTP/2 session to Apple's gateway.
|
|
4
|
+
* Node-only: signs a provider JWT (ES256, JOSE raw r‖s via `node:crypto`) and
|
|
5
|
+
* sends a background data push over an HTTP/2 session to Apple's gateway. APNs
|
|
6
|
+
* mandates HTTP/2, so `node:http2` is unavoidable here — one reason the push
|
|
7
|
+
* path is injected rather than rebuilt on WebCrypto/`fetch`.
|
|
8
|
+
*
|
|
9
|
+
* Reachable only through the `@serfab/cadre-core/push-node` subpath — never from
|
|
10
|
+
* the cross-platform `./index.js` graph — so the `node:crypto` / `node:http2`
|
|
11
|
+
* imports below are safe: no RN/browser bundler ever resolves this module. (Plain
|
|
12
|
+
* named imports; the old namespace-import-to-only-warn dance is obsolete now that
|
|
13
|
+
* the module is unreachable from a browser build by construction.)
|
|
6
14
|
*
|
|
7
15
|
* The HTTP/2 call is behind an injected `Http2Requester` seam (bundled with a
|
|
8
16
|
* `close` into an {@link ApnsTransport}) so unit tests assert the request shape
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* push-notifier-apns.ts — APNs HTTP/2 strand-wake delivery.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* sends a background data push over an HTTP/2 session to Apple's gateway.
|
|
4
|
+
* Node-only: signs a provider JWT (ES256, JOSE raw r‖s via `node:crypto`) and
|
|
5
|
+
* sends a background data push over an HTTP/2 session to Apple's gateway. APNs
|
|
6
|
+
* mandates HTTP/2, so `node:http2` is unavoidable here — one reason the push
|
|
7
|
+
* path is injected rather than rebuilt on WebCrypto/`fetch`.
|
|
8
|
+
*
|
|
9
|
+
* Reachable only through the `@serfab/cadre-core/push-node` subpath — never from
|
|
10
|
+
* the cross-platform `./index.js` graph — so the `node:crypto` / `node:http2`
|
|
11
|
+
* imports below are safe: no RN/browser bundler ever resolves this module. (Plain
|
|
12
|
+
* named imports; the old namespace-import-to-only-warn dance is obsolete now that
|
|
13
|
+
* the module is unreachable from a browser build by construction.)
|
|
6
14
|
*
|
|
7
15
|
* The HTTP/2 call is behind an injected `Http2Requester` seam (bundled with a
|
|
8
16
|
* `close` into an {@link ApnsTransport}) so unit tests assert the request shape
|
|
@@ -18,12 +26,8 @@
|
|
|
18
26
|
* are never logged — failure log lines carry only a status/reason and a redacted
|
|
19
27
|
* token prefix.
|
|
20
28
|
*/
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
// namespace import only warns — same reasoning as the `node:http2` import below
|
|
24
|
-
// and the matching note in push-notifier-fcm.ts. Server-only; never run in browser.
|
|
25
|
-
import * as nodeCrypto from 'node:crypto';
|
|
26
|
-
import * as http2 from 'node:http2';
|
|
29
|
+
import { sign } from 'node:crypto';
|
|
30
|
+
import { connect } from 'node:http2';
|
|
27
31
|
import debug from 'debug';
|
|
28
32
|
import { MAX_REASON_LEN, b64urlJson, errText, redact } from './push-notifier-shared.js';
|
|
29
33
|
const APNS_PROD_HOST = 'https://api.push.apple.com';
|
|
@@ -124,7 +128,7 @@ export function createApnsPushNotifier(creds, deps = {}) {
|
|
|
124
128
|
const header = { alg: 'ES256', kid: creds.keyId };
|
|
125
129
|
const claims = { iss: creds.teamId, iat };
|
|
126
130
|
const signingInput = `${b64urlJson(header)}.${b64urlJson(claims)}`;
|
|
127
|
-
const sig =
|
|
131
|
+
const sig = sign('SHA256', Buffer.from(signingInput), {
|
|
128
132
|
key: creds.privateKey,
|
|
129
133
|
dsaEncoding: 'ieee-p1363',
|
|
130
134
|
}).toString('base64url');
|
|
@@ -149,7 +153,7 @@ function createHttp2Transport(host) {
|
|
|
149
153
|
function ensureSession() {
|
|
150
154
|
if (session && !session.closed && !session.destroyed)
|
|
151
155
|
return session;
|
|
152
|
-
const s =
|
|
156
|
+
const s = connect(host);
|
|
153
157
|
// Drop a dead session so ensureSession recreates it on the next request.
|
|
154
158
|
s.on('error', () => { if (session === s)
|
|
155
159
|
session = null; });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"push-notifier-apns.js","sourceRoot":"","sources":["../src/push-notifier-apns.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"push-notifier-apns.js","sourceRoot":"","sources":["../src/push-notifier-apns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,OAAO,EAA2B,MAAM,YAAY,CAAC;AAC9D,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAExF,MAAM,cAAc,GAAG,4BAA4B,CAAC;AACpD,MAAM,iBAAiB,GAAG,oCAAoC,CAAC;AAC/D,oFAAoF;AACpF,MAAM,qBAAqB,GAAG,EAAE,GAAG,KAAM,CAAC;AAE1C,MAAM,SAAS,GAAG,KAAK,CAAC,wBAAwB,CAAC,CAAC;AA2ClD,MAAM,UAAU,sBAAsB,CAAC,KAAsB,EAAE,OAAqB,EAAE;IACpF,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,iBAAiB,CAAC;IACnE,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,IAAI,oBAAoB,CAAC,IAAI,CAAC,CAAC;IAC/D,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,G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
5
5
|
* with `node:crypto`) and POSTs a data message to the FCM v1 endpoint. The legacy
|
|
6
6
|
* server-key `fcm.googleapis.com/fcm/send` API is deprecated, so we use HTTP v1.
|
|
7
7
|
*
|
|
8
|
+
* Reachable only through the `@serfab/cadre-core/push-node` subpath — never from
|
|
9
|
+
* the cross-platform `./index.js` graph — so the `node:crypto` import below is
|
|
10
|
+
* safe: no RN/browser bundler ever resolves this module. (Plain named import;
|
|
11
|
+
* the old namespace-import-to-only-warn dance is obsolete now that the module is
|
|
12
|
+
* unreachable from a browser build by construction.)
|
|
13
|
+
*
|
|
8
14
|
* The network call is behind an injected `fetch`-like seam so unit tests assert
|
|
9
15
|
* the request shape and map every documented response code with no real network
|
|
10
16
|
* and no credentials. Failures are returned as {@link PushSendResult} values.
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* push-notifier-fcm.ts — FCM HTTP v1 strand-wake delivery.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Node-only: mints a Google OAuth2 access token (RS256 JWT bearer grant signed
|
|
5
5
|
* with `node:crypto`) and POSTs a data message to the FCM v1 endpoint. The legacy
|
|
6
6
|
* server-key `fcm.googleapis.com/fcm/send` API is deprecated, so we use HTTP v1.
|
|
7
7
|
*
|
|
8
|
+
* Reachable only through the `@serfab/cadre-core/push-node` subpath — never from
|
|
9
|
+
* the cross-platform `./index.js` graph — so the `node:crypto` import below is
|
|
10
|
+
* safe: no RN/browser bundler ever resolves this module. (Plain named import;
|
|
11
|
+
* the old namespace-import-to-only-warn dance is obsolete now that the module is
|
|
12
|
+
* unreachable from a browser build by construction.)
|
|
13
|
+
*
|
|
8
14
|
* The network call is behind an injected `fetch`-like seam so unit tests assert
|
|
9
15
|
* the request shape and map every documented response code with no real network
|
|
10
16
|
* and no credentials. Failures are returned as {@link PushSendResult} values.
|
|
@@ -13,14 +19,7 @@
|
|
|
13
19
|
* device tokens are never logged — failure log lines carry only a status/error
|
|
14
20
|
* code and a redacted token prefix.
|
|
15
21
|
*/
|
|
16
|
-
|
|
17
|
-
// reached only via the guarded dynamic import in CadreNode, but bundlers still
|
|
18
|
-
// analyse that lazy chunk. A *named* import of `node:crypto` hard-fails the
|
|
19
|
-
// browser build ("sign is not exported by __vite-browser-external"), whereas a
|
|
20
|
-
// namespace import of the deliberately-unaliased external only warns (matching
|
|
21
|
-
// the `node:http2` namespace import in push-notifier-apns.ts). The browser
|
|
22
|
-
// never executes this code (config.push is node-only), so the warning is benign.
|
|
23
|
-
import * as nodeCrypto from 'node:crypto';
|
|
22
|
+
import { sign } from 'node:crypto';
|
|
24
23
|
import debug from 'debug';
|
|
25
24
|
import { MAX_REASON_LEN, b64urlJson, errText, redact } from './push-notifier-shared.js';
|
|
26
25
|
const TOKEN_ENDPOINT = 'https://oauth2.googleapis.com/token';
|
|
@@ -128,7 +127,7 @@ export function createFcmPushNotifier(creds, deps = {}) {
|
|
|
128
127
|
exp: iat + 3600,
|
|
129
128
|
};
|
|
130
129
|
const signingInput = `${b64urlJson(header)}.${b64urlJson(claims)}`;
|
|
131
|
-
const sig =
|
|
130
|
+
const sig = sign('RSA-SHA256', Buffer.from(signingInput), creds.privateKey).toString('base64url');
|
|
132
131
|
return `${signingInput}.${sig}`;
|
|
133
132
|
}
|
|
134
133
|
async function close() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"push-notifier-fcm.js","sourceRoot":"","sources":["../src/push-notifier-fcm.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"push-notifier-fcm.js","sourceRoot":"","sources":["../src/push-notifier-fcm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAExF,MAAM,c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AC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,SAAS,KAAK,QAAQ,CAAC,EAAE,SAAS,CAAC;QACxF,OAAO,UAAU,IAAI,GAAG,CAAC,MAAM,IAAI,IAAI,CAAC;IAC1C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,mFAAmF;AACnF,SAAS,YAAY,CAAC,MAAc,EAAE,IAAY;IAChD,MAAM,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IAChC,OAAO,IAAI,CAAC,CAAC,CAAC,OAAO,MAAM,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,OAAO,MAAM,EAAE,CAAC;AAC1D,CAAC;AAED,KAAK,UAAU,QAAQ,CAAC,GAAoB;IAC1C,IAAI,CAAC;QACH,OAAO,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;IAC1B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
|
package/dist/push-notifier.d.ts
CHANGED
|
@@ -1,29 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* push-notifier.ts — the platform-push **delivery**
|
|
2
|
+
* push-notifier.ts — the platform-push **delivery** contract for strand-wake.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
4
|
+
* This module is the cross-platform-safe *interface* half: the message shape
|
|
5
|
+
* ({@link PushMessage}), the outcome value ({@link PushSendResult}), and the
|
|
6
|
+
* {@link PushNotifier} port a `CadreNode` sends over. It carries ZERO runtime
|
|
7
|
+
* dependencies and imports no implementation — so the RN/browser entry graph can
|
|
8
|
+
* reference the type without ever resolving `node:crypto` / `node:http2`.
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
* `
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
10
|
+
* The concrete FCM/APNs implementations (`push-notifier-fcm.ts` /
|
|
11
|
+
* `push-notifier-apns.ts`) and the `createPushNotifier` router that builds them
|
|
12
|
+
* live behind the Node-only subpath `@serfab/cadre-core/push-node`
|
|
13
|
+
* (`push-node.ts`). A Node host constructs a notifier from that subpath and
|
|
14
|
+
* injects the instance into `CadreNodeConfig.push.notifier`; the cross-platform
|
|
15
|
+
* core never constructs one, so the Node-only builtins stay out of its graph.
|
|
15
16
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* type-only re-export is erased at emit), and the only runtime constructor of a
|
|
20
|
-
* notifier is the in-package fan-out that runs inside a Node `CadreNode`. A
|
|
21
|
-
* cross-platform consumer imports the payload contract + types, never this value.
|
|
17
|
+
* Keep this file zero-import (beyond erased type-only imports): the whole point
|
|
18
|
+
* of the seam is that referencing the interface can never drag an implementation
|
|
19
|
+
* module into a bundler's graph.
|
|
22
20
|
*/
|
|
23
|
-
import type { PushPlatform
|
|
21
|
+
import type { PushPlatform } from './types.js';
|
|
24
22
|
import type { StrandWakePayload } from './strand-wake-payload.js';
|
|
25
|
-
import { type FcmPushDeps } from './push-notifier-fcm.js';
|
|
26
|
-
import { type ApnsPushDeps } from './push-notifier-apns.js';
|
|
27
23
|
/** One strand-wake data message addressed to one device. */
|
|
28
24
|
export interface PushMessage {
|
|
29
25
|
/** The resolved `DeviceToken.token` for the target peer. */
|
|
@@ -54,18 +50,3 @@ export interface PushNotifier {
|
|
|
54
50
|
/** Release transport resources (e.g. the APNs HTTP/2 session). */
|
|
55
51
|
close(): Promise<void>;
|
|
56
52
|
}
|
|
57
|
-
/**
|
|
58
|
-
* Per-platform transport/clock/log seams, injected by tests. Defaults are the
|
|
59
|
-
* real implementations (global `fetch` for FCM, a `node:http2` session for APNs).
|
|
60
|
-
*/
|
|
61
|
-
export interface PushNotifierDeps {
|
|
62
|
-
fcm?: FcmPushDeps;
|
|
63
|
-
apns?: ApnsPushDeps;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Build a {@link PushNotifier} router over the configured credentials. Only the
|
|
67
|
-
* platforms whose credentials are present get a backing implementation; a `send`
|
|
68
|
-
* for an unconfigured platform returns a best-effort `no <platform> credentials`
|
|
69
|
-
* failure rather than throwing.
|
|
70
|
-
*/
|
|
71
|
-
export declare function createPushNotifier(creds: PushCredentials, deps?: PushNotifierDeps): PushNotifier;
|
package/dist/push-notifier.js
CHANGED
|
@@ -1,50 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* push-notifier.ts — the platform-push **delivery**
|
|
2
|
+
* push-notifier.ts — the platform-push **delivery** contract for strand-wake.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
4
|
+
* This module is the cross-platform-safe *interface* half: the message shape
|
|
5
|
+
* ({@link PushMessage}), the outcome value ({@link PushSendResult}), and the
|
|
6
|
+
* {@link PushNotifier} port a `CadreNode` sends over. It carries ZERO runtime
|
|
7
|
+
* dependencies and imports no implementation — so the RN/browser entry graph can
|
|
8
|
+
* reference the type without ever resolving `node:crypto` / `node:http2`.
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
* `
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
10
|
+
* The concrete FCM/APNs implementations (`push-notifier-fcm.ts` /
|
|
11
|
+
* `push-notifier-apns.ts`) and the `createPushNotifier` router that builds them
|
|
12
|
+
* live behind the Node-only subpath `@serfab/cadre-core/push-node`
|
|
13
|
+
* (`push-node.ts`). A Node host constructs a notifier from that subpath and
|
|
14
|
+
* injects the instance into `CadreNodeConfig.push.notifier`; the cross-platform
|
|
15
|
+
* core never constructs one, so the Node-only builtins stay out of its graph.
|
|
15
16
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* type-only re-export is erased at emit), and the only runtime constructor of a
|
|
20
|
-
* notifier is the in-package fan-out that runs inside a Node `CadreNode`. A
|
|
21
|
-
* cross-platform consumer imports the payload contract + types, never this value.
|
|
17
|
+
* Keep this file zero-import (beyond erased type-only imports): the whole point
|
|
18
|
+
* of the seam is that referencing the interface can never drag an implementation
|
|
19
|
+
* module into a bundler's graph.
|
|
22
20
|
*/
|
|
23
|
-
|
|
24
|
-
import { createApnsPushNotifier } from './push-notifier-apns.js';
|
|
25
|
-
/**
|
|
26
|
-
* Build a {@link PushNotifier} router over the configured credentials. Only the
|
|
27
|
-
* platforms whose credentials are present get a backing implementation; a `send`
|
|
28
|
-
* for an unconfigured platform returns a best-effort `no <platform> credentials`
|
|
29
|
-
* failure rather than throwing.
|
|
30
|
-
*/
|
|
31
|
-
export function createPushNotifier(creds, deps = {}) {
|
|
32
|
-
const fcm = creds.fcm ? createFcmPushNotifier(creds.fcm, deps.fcm) : undefined;
|
|
33
|
-
const apns = creds.apns ? createApnsPushNotifier(creds.apns, deps.apns) : undefined;
|
|
34
|
-
async function send(msg) {
|
|
35
|
-
if (msg.platform === 'fcm')
|
|
36
|
-
return fcm ? fcm.send(msg) : noCreds('fcm');
|
|
37
|
-
if (msg.platform === 'apns')
|
|
38
|
-
return apns ? apns.send(msg) : noCreds('apns');
|
|
39
|
-
return { ok: false, unregistered: false, error: `unknown platform ${String(msg.platform)}` };
|
|
40
|
-
}
|
|
41
|
-
async function close() {
|
|
42
|
-
await Promise.all([fcm?.close(), apns?.close()]);
|
|
43
|
-
}
|
|
44
|
-
return { send, close };
|
|
45
|
-
}
|
|
46
|
-
/** Best-effort no-op result for a platform with no configured credentials. */
|
|
47
|
-
function noCreds(platform) {
|
|
48
|
-
return { ok: false, unregistered: false, error: `no ${platform} credentials` };
|
|
49
|
-
}
|
|
21
|
+
export {};
|
|
50
22
|
//# sourceMappingURL=push-notifier.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"push-notifier.js","sourceRoot":"","sources":["../src/push-notifier.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"push-notifier.js","sourceRoot":"","sources":["../src/push-notifier.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG"}
|