@macula-io/ts 0.15.0 → 0.17.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 +34 -24
- package/dist/binding.d.ts +1 -1
- package/dist/binding.js +2 -2
- package/dist/binding.js.map +1 -1
- package/dist/content.js +6 -7
- package/dist/content.js.map +1 -1
- package/dist/directdial.d.ts +3 -3
- package/dist/directdial.js +3 -3
- package/dist/pool.js +13 -15
- package/dist/pool.js.map +1 -1
- package/dist/session.d.ts +57 -63
- package/dist/session.js +96 -110
- package/dist/session.js.map +1 -1
- package/dist/ucan.d.ts +11 -9
- package/dist/ucan.js +33 -35
- package/dist/ucan.js.map +1 -1
- package/package.json +1 -1
- package/prebuilds/darwin-arm64/@macula-io+ts.node +0 -0
- package/prebuilds/darwin-x64/@macula-io+ts.node +0 -0
- package/prebuilds/linux-arm64/@macula-io+ts.node +0 -0
- package/prebuilds/linux-x64/@macula-io+ts.node +0 -0
- package/prebuilds/win32-x64/@macula-io+ts.node +0 -0
package/dist/session.js
CHANGED
|
@@ -50,26 +50,20 @@ export class Session {
|
|
|
50
50
|
#identity;
|
|
51
51
|
#activeServe = null;
|
|
52
52
|
#activeSubscription = null;
|
|
53
|
-
// Serializes every
|
|
54
|
-
//
|
|
55
|
-
//
|
|
56
|
-
//
|
|
57
|
-
//
|
|
58
|
-
//
|
|
59
|
-
//
|
|
60
|
-
//
|
|
61
|
-
//
|
|
62
|
-
//
|
|
63
|
-
//
|
|
64
|
-
//
|
|
65
|
-
//
|
|
66
|
-
//
|
|
67
|
-
// gap: every control-stream-reading native call funnels through
|
|
68
|
-
// #enqueue, so only one is ever in flight at a time, regardless of
|
|
69
|
-
// which method it came from. publish()/putContent()/getContent() do
|
|
70
|
-
// NOT go through this -- see their own docs for why (a pure write,
|
|
71
|
-
// and each own dedicated QUIC stream, respectively -- neither reads
|
|
72
|
-
// this shared stream at all).
|
|
53
|
+
// Serializes every native call that uses this Session's control
|
|
54
|
+
// stream: call()/callWithUcan()/the DHT methods, plus serve()'s
|
|
55
|
+
// advertise, each poll tick and unadvertise, plus subscribe()'s start
|
|
56
|
+
// and stop, so only one of them is in flight at a time. It was added
|
|
57
|
+
// when macula-go read the control stream without a lock, so two reads
|
|
58
|
+
// racing it corrupted the stream -- verified live: `Promise.all` of 4
|
|
59
|
+
// concurrent call()s on one Session left EVERY later read on that
|
|
60
|
+
// Session permanently failing "claimed frame length ... exceeds the
|
|
61
|
+
// 16777215-byte cap". macula-go v0.10.0, which this release embeds,
|
|
62
|
+
// reads the control stream on one goroutine and routes each reply,
|
|
63
|
+
// event and inbound CALL to what is waiting for it, so concurrent calls
|
|
64
|
+
// no longer race; this release keeps the queue as it was.
|
|
65
|
+
// publish()/putContent()/getContent() do NOT go through it -- see their
|
|
66
|
+
// own docs (a pure write, and each own dedicated QUIC stream).
|
|
73
67
|
#queue = Promise.resolve();
|
|
74
68
|
#enqueue(fn) {
|
|
75
69
|
const result = this.#queue.then(fn, fn);
|
|
@@ -108,31 +102,27 @@ export class Session {
|
|
|
108
102
|
}
|
|
109
103
|
return this.#handle;
|
|
110
104
|
}
|
|
111
|
-
/** call()'s own handle-plus-
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
* serve()/subscribe()/the DHT methods do -- and the live pubsub round
|
|
124
|
-
* trip this SDK's own test performs (subscribe(), then publish() on
|
|
125
|
-
* the SAME Session while that subscription is active) depends on
|
|
126
|
-
* publish() staying unguarded here. */
|
|
105
|
+
/** call()'s own handle-plus-one-role check, factored out since the DHT
|
|
106
|
+
* methods below and the direct-dial methods are CALLs too (macula-go's
|
|
107
|
+
* dht.FindRecord et al. are a connection.Session.Call under the hood,
|
|
108
|
+
* see cabi/dht.go). A Session takes one role at a time: calls, one
|
|
109
|
+
* serve(), or one subscribe(). macula-go v0.10.0 routes each reply,
|
|
110
|
+
* event and inbound CALL on its own, so a call beside a serve() or
|
|
111
|
+
* subscribe() no longer races; this release keeps the check as it was.
|
|
112
|
+
* publish() is deliberately NOT checked: it only ever WRITES a
|
|
113
|
+
* fire-and-forget frame (connection.Session.Publish), and the live
|
|
114
|
+
* pubsub round trip this SDK's own test performs (subscribe(), then
|
|
115
|
+
* publish() on the SAME Session while that subscription is active)
|
|
116
|
+
* depends on publish() staying unchecked here. */
|
|
127
117
|
#requireHandleNotServing(caller) {
|
|
128
118
|
const handle = this.#requireHandle();
|
|
129
119
|
if (this.#activeServe !== null) {
|
|
130
120
|
throw new Error(`macula-ts: Session.${caller}() while serve("${this.#activeServe.procedure}") is active on the same ` +
|
|
131
|
-
`Session
|
|
121
|
+
`Session is not supported -- open a second Session for the other role.`);
|
|
132
122
|
}
|
|
133
123
|
if (this.#activeSubscription !== null) {
|
|
134
124
|
throw new Error(`macula-ts: Session.${caller}() while subscribe("${this.#activeSubscription.topic}") is active on the ` +
|
|
135
|
-
`same Session
|
|
125
|
+
`same Session is not supported -- open a second Session for the other role.`);
|
|
136
126
|
}
|
|
137
127
|
return handle;
|
|
138
128
|
}
|
|
@@ -210,13 +200,10 @@ export class Session {
|
|
|
210
200
|
*
|
|
211
201
|
* Real network I/O -- a signed frame out and a wait for the reply,
|
|
212
202
|
* up to opts.deadlineMs -- so this runs off the main thread on the
|
|
213
|
-
* native side, like connect()/close().
|
|
214
|
-
*
|
|
215
|
-
*
|
|
216
|
-
*
|
|
217
|
-
* connection races (an unrelated frame arriving first is discarded,
|
|
218
|
-
* not queued) -- open a second Session for the other role instead,
|
|
219
|
-
* exactly what this SDK's own live test does. */
|
|
203
|
+
* native side, like connect()/close(). Rejects while a serve() or
|
|
204
|
+
* subscribe() is active on the SAME Session (#requireHandleNotServing):
|
|
205
|
+
* a Session takes one role at a time, so open a second Session for the
|
|
206
|
+
* other role, exactly what this SDK's own live test does. */
|
|
220
207
|
async call(procedure, payload, opts = {}) {
|
|
221
208
|
const handle = this.#requireHandleNotServing("call");
|
|
222
209
|
const timeoutMs = opts.deadlineMs ?? DEFAULT_CALL_TIMEOUT_MS;
|
|
@@ -254,9 +241,8 @@ export class Session {
|
|
|
254
241
|
* security property that isn't actually enforced.
|
|
255
242
|
*
|
|
256
243
|
* Real network I/O, off the main thread on the native side, and
|
|
257
|
-
* subject to the
|
|
258
|
-
* (`#requireHandleNotServing`)
|
|
259
|
-
* control stream. */
|
|
244
|
+
* subject to the same one-role check as `call()`
|
|
245
|
+
* (`#requireHandleNotServing`). */
|
|
260
246
|
async callWithUcan(procedure, payload, ucanToken, opts = {}) {
|
|
261
247
|
const handle = this.#requireHandleNotServing("callWithUcan");
|
|
262
248
|
const timeoutMs = opts.deadlineMs ?? DEFAULT_CALL_TIMEOUT_MS;
|
|
@@ -282,11 +268,15 @@ export class Session {
|
|
|
282
268
|
* between this and the JS handler) would map to
|
|
283
269
|
* TemporaryRelayFailure, per that same file.
|
|
284
270
|
*
|
|
285
|
-
* Only one serve() registration is allowed per Session at a time
|
|
286
|
-
*
|
|
287
|
-
*
|
|
288
|
-
*
|
|
289
|
-
*
|
|
271
|
+
* Only one serve() registration is allowed per Session at a time: each
|
|
272
|
+
* poll tick takes the next inbound CALL from the session's one queue
|
|
273
|
+
* (macula-go's ServeOneCall) and answers a CALL for a procedure it
|
|
274
|
+
* doesn't serve with unknown_next_peer, so a second serve() would answer
|
|
275
|
+
* CALLs meant for the first. Open a second Session for a second
|
|
276
|
+
* procedure instead of trying to serve two procedures off one. serve()
|
|
277
|
+
* also refuses while a subscribe() is active on the same Session, and
|
|
278
|
+
* call()/the DHT methods refuse while a serve() is (the one-role rule,
|
|
279
|
+
* #requireHandleNotServing).
|
|
290
280
|
*
|
|
291
281
|
* `opts.bytes` picks how bytes in each inbound CALL's payload reach
|
|
292
282
|
* `handler`: "hex" (the default) or "tagged" (rpc.ts's BytesOutput).
|
|
@@ -302,13 +292,13 @@ export class Session {
|
|
|
302
292
|
async serve(procedure, handler, opts = {}) {
|
|
303
293
|
const bytesMode = bytesModeFor(opts.bytes);
|
|
304
294
|
if (this.#activeServe !== null) {
|
|
305
|
-
throw new Error(`macula-ts: Session is already serving "${this.#activeServe.procedure}" --
|
|
306
|
-
`
|
|
307
|
-
`
|
|
295
|
+
throw new Error(`macula-ts: Session is already serving "${this.#activeServe.procedure}" -- a second serve() on the ` +
|
|
296
|
+
`same Session would answer CALLs meant for the first, since each serve() takes the next inbound CALL ` +
|
|
297
|
+
`from the session's one queue; open a second Session instead.`);
|
|
308
298
|
}
|
|
309
299
|
if (this.#activeSubscription !== null) {
|
|
310
300
|
throw new Error(`macula-ts: Session.serve() while subscribe("${this.#activeSubscription.topic}") is active on the same ` +
|
|
311
|
-
`Session
|
|
301
|
+
`Session is not supported -- open a second Session for the other role.`);
|
|
312
302
|
}
|
|
313
303
|
const handle = this.#requireHandle();
|
|
314
304
|
const identityHandle = this.#identity.handleForFfi();
|
|
@@ -386,9 +376,9 @@ export class Session {
|
|
|
386
376
|
* signature or checks its expiry -- see DhtRecord's own doc (dht.ts).
|
|
387
377
|
*
|
|
388
378
|
* Real network I/O, off the main thread on the native side, exactly
|
|
389
|
-
* like call() -- and subject to the same
|
|
390
|
-
*
|
|
391
|
-
*
|
|
379
|
+
* like call() -- and subject to the same one-role rule as call() (see
|
|
380
|
+
* #requireHandleNotServing's own doc): it refuses while a serve() or
|
|
381
|
+
* subscribe() is active on the same Session. */
|
|
392
382
|
async findRecordsByType(recordType) {
|
|
393
383
|
const handle = this.#requireHandleNotServing("findRecordsByType");
|
|
394
384
|
const json = await this.#enqueue(() => native.dhtFindRecordsByType(handle, this.#identity.handleForFfi(), recordType));
|
|
@@ -400,7 +390,7 @@ export class Session {
|
|
|
400
390
|
* procedure, not just the first one found. `key` must be exactly 32
|
|
401
391
|
* bytes -- see dht/record.go's ProcedureKey/StationEndpointKey/
|
|
402
392
|
* ContentKey (macula-go) for how those are derived from the thing
|
|
403
|
-
* being looked up. Same I/O and
|
|
393
|
+
* being looked up. Same I/O and one-role notes as
|
|
404
394
|
* findRecordsByType(). */
|
|
405
395
|
async findRecords(key) {
|
|
406
396
|
const handle = this.#requireHandleNotServing("findRecords");
|
|
@@ -412,7 +402,7 @@ export class Session {
|
|
|
412
402
|
* dht.FindRecord). Resolves `null` when none exists -- mirrors
|
|
413
403
|
* macula-go's own dht.ErrNotFound, translated to a value instead of a
|
|
414
404
|
* thrown error since "not found" is an expected, routine outcome
|
|
415
|
-
* here, not exceptional. Same I/O and
|
|
405
|
+
* here, not exceptional. Same I/O and one-role notes as
|
|
416
406
|
* findRecordsByType(). */
|
|
417
407
|
async findRecord(key) {
|
|
418
408
|
const handle = this.#requireHandleNotServing("findRecord");
|
|
@@ -454,7 +444,7 @@ export class Session {
|
|
|
454
444
|
* silently becomes CBOR text. Typed arguments rule that mistake out
|
|
455
445
|
* (see DhtRecord's own doc). `ttlMs` defaults to DHT_DEFAULT_TTL_MS
|
|
456
446
|
* (48h). Resolves with the signed record actually stored. Same I/O
|
|
457
|
-
* and
|
|
447
|
+
* and one-role notes as findRecordsByType(). */
|
|
458
448
|
async putProcedureAdvertisement(procedure, servingStation, opts = {}) {
|
|
459
449
|
const handle = this.#requireHandleNotServing("putProcedureAdvertisement");
|
|
460
450
|
requireKey32(servingStation);
|
|
@@ -471,7 +461,7 @@ export class Session {
|
|
|
471
461
|
* own doc for wrapping macula-go's real constructor instead of a
|
|
472
462
|
* generic JSON-payload builder (announcer_node/mcid are the same kind
|
|
473
463
|
* of raw-byte field). `ttlMs` defaults to DHT_DEFAULT_TTL_MS (48h).
|
|
474
|
-
* Same I/O and
|
|
464
|
+
* Same I/O and one-role notes as findRecordsByType(). */
|
|
475
465
|
async putContentAnnouncement(mcid, endpoint, ttlMs = DHT_DEFAULT_TTL_MS) {
|
|
476
466
|
const handle = this.#requireHandleNotServing("putContentAnnouncement");
|
|
477
467
|
if (mcid.length !== 34) {
|
|
@@ -484,11 +474,12 @@ export class Session {
|
|
|
484
474
|
* serving station and its dialable host/port (macula-go's
|
|
485
475
|
* `directdial.Resolve`), via this Session used only to query the DHT
|
|
486
476
|
* -- it does not need to be connected to the station that ends up
|
|
487
|
-
* serving `procedure`.
|
|
488
|
-
*
|
|
489
|
-
* `
|
|
490
|
-
*
|
|
491
|
-
* `
|
|
477
|
+
* serving `procedure`. Every advertisement that verifies is a
|
|
478
|
+
* candidate, and the DHT is asked again until one's station endpoint
|
|
479
|
+
* resolves or `opts.deadlineMs` passes (10 s when unset, macula-go's
|
|
480
|
+
* `directdial.DefaultResolveTimeout`); a `procedure` nobody ever called
|
|
481
|
+
* `advertiseDirect()` for rejects once that time is up (a plain `Error`
|
|
482
|
+
* wrapping macula-go's `ErrProcedureNotAdvertised`), never a hang.
|
|
492
483
|
*
|
|
493
484
|
* `opts.realm` must match whatever realm `procedure` was
|
|
494
485
|
* `advertiseDirect()`d under, or the discovery URI the two sides
|
|
@@ -500,12 +491,16 @@ export class Session {
|
|
|
500
491
|
* diagnostics).
|
|
501
492
|
*
|
|
502
493
|
* Real network I/O, off the main thread on the native side, subject to
|
|
503
|
-
* the same
|
|
494
|
+
* the same one-role rule as `call()`/the DHT methods
|
|
504
495
|
* (`#requireHandleNotServing`). */
|
|
505
496
|
async resolveDirect(procedure, opts = {}) {
|
|
497
|
+
if (opts.deadlineMs !== undefined && !(opts.deadlineMs > 0)) {
|
|
498
|
+
throw new RangeError(`macula-ts: resolveDirect deadlineMs must be a positive number of milliseconds, got ${opts.deadlineMs}`);
|
|
499
|
+
}
|
|
506
500
|
const handle = this.#requireHandleNotServing("resolveDirect");
|
|
507
501
|
const realm = realmBytesFromHex(opts.realm);
|
|
508
|
-
const
|
|
502
|
+
const deadlineMs = opts.deadlineMs ?? 0;
|
|
503
|
+
const json = await this.#enqueue(() => native.directdialResolve(handle, this.#identity.handleForFfi(), realm, procedure, deadlineMs));
|
|
509
504
|
return JSON.parse(json);
|
|
510
505
|
}
|
|
511
506
|
/** Direct-dial (caller side): resolves `procedure`'s provider (via
|
|
@@ -527,9 +522,9 @@ export class Session {
|
|
|
527
522
|
*
|
|
528
523
|
* Real network I/O (DHT lookups, a fresh QUIC dial, then the CALL
|
|
529
524
|
* itself) -- off the main thread on the native side, subject to the
|
|
530
|
-
* same
|
|
531
|
-
*
|
|
532
|
-
*
|
|
525
|
+
* same one-role rule as `call()` for THIS Session's own DHT-querying use
|
|
526
|
+
* (the separate dialed connection this opens internally is not this
|
|
527
|
+
* Session and is never exposed as one). */
|
|
533
528
|
async callDirect(procedure, payload, opts = {}) {
|
|
534
529
|
const handle = this.#requireHandleNotServing("callDirect");
|
|
535
530
|
const timeoutMs = opts.deadlineMs ?? DEFAULT_CALL_TIMEOUT_MS;
|
|
@@ -553,7 +548,7 @@ export class Session {
|
|
|
553
548
|
* method's and ucan.ts's own doc for why: macula's UCAN gate is a
|
|
554
549
|
* bearer-token check, not an audience match).
|
|
555
550
|
*
|
|
556
|
-
* Same I/O and
|
|
551
|
+
* Same I/O and one-role notes as `callDirect()`. */
|
|
557
552
|
async callDirectWithUcan(procedure, payload, ucanToken, opts = {}) {
|
|
558
553
|
const handle = this.#requireHandleNotServing("callDirectWithUcan");
|
|
559
554
|
const timeoutMs = opts.deadlineMs ?? DEFAULT_CALL_TIMEOUT_MS;
|
|
@@ -592,10 +587,8 @@ export class Session {
|
|
|
592
587
|
*
|
|
593
588
|
* **Must NOT be called on a Session that is also actively
|
|
594
589
|
* `serve()`-ing** -- enforced by the same `#requireHandleNotServing`
|
|
595
|
-
*
|
|
596
|
-
*
|
|
597
|
-
* control stream `serve()`'s poll loop is also reading, and the two
|
|
598
|
-
* would race (matches `directdial.AdvertiseDirect`'s own doc). A
|
|
590
|
+
* one-role check `call()`/the DHT methods use, since this method's own
|
|
591
|
+
* `PutRecord` is a CALL. A
|
|
599
592
|
* provider that also serves `procedure` needs a SEPARATE Session (and
|
|
600
593
|
* identity -- this fleet enforces one connection per identity, kicking
|
|
601
594
|
* whichever connects second) to call this on.
|
|
@@ -620,13 +613,11 @@ export class Session {
|
|
|
620
613
|
* observes a subscriber's own publish arriving back at it rather than
|
|
621
614
|
* asserting it as a hard guarantee, for the same reason).
|
|
622
615
|
*
|
|
623
|
-
* Deliberately NOT
|
|
624
|
-
*
|
|
625
|
-
*
|
|
626
|
-
*
|
|
627
|
-
*
|
|
628
|
-
* on the SAME Session a subscribe() of its own is active on -- exactly
|
|
629
|
-
* what a subscriber publishing to (and receiving) its own topic needs.
|
|
616
|
+
* Deliberately NOT subject to the one-role rule call()/serve()/
|
|
617
|
+
* subscribe()/the DHT methods share (see #requireHandleNotServing's own
|
|
618
|
+
* doc) -- publish() only ever writes, so it runs on the SAME Session a
|
|
619
|
+
* subscribe() of its own is active on -- exactly what a subscriber
|
|
620
|
+
* publishing to (and receiving) its own topic needs.
|
|
630
621
|
*
|
|
631
622
|
* `opts.realm` (see CallOptions.realm's own doc for the hex-string
|
|
632
623
|
* format and exact-match semantics) scopes which realm this EVENT is
|
|
@@ -644,21 +635,18 @@ export class Session {
|
|
|
644
635
|
await native.sessionPublish(handle, this.#identity.handleForFfi(), realm, topic, payloadJson, opts.ttlMs ?? 0);
|
|
645
636
|
}
|
|
646
637
|
/** Pubsub: sends a signed SUBSCRIBE for `topic`, then delivers every
|
|
647
|
-
* inbound EVENT for it to `handler` --
|
|
648
|
-
*
|
|
649
|
-
*
|
|
650
|
-
*
|
|
651
|
-
*
|
|
652
|
-
* RecvEvent). Delivery is Go-driven, not JS-driven: unlike serve()'s
|
|
638
|
+
* inbound EVENT for it to `handler` -- a background goroutine on the Go
|
|
639
|
+
* side reads the macula-go connection.Subscription that SUBSCRIBE
|
|
640
|
+
* opened (see cabi/pubsub.go's own doc for why the SUBSCRIBE goes out
|
|
641
|
+
* before that goroutine starts). Delivery is Go-driven, not JS-driven:
|
|
642
|
+
* unlike serve()'s
|
|
653
643
|
* poll loop, nothing on this side calls into the native layer
|
|
654
644
|
* repeatedly to ask "did anything arrive yet" -- the addon calls INTO
|
|
655
645
|
* this handler asynchronously, via a Napi::ThreadSafeFunction wired to
|
|
656
646
|
* that background goroutine, whenever an EVENT actually shows up.
|
|
657
647
|
*
|
|
658
648
|
* Only one subscribe() (and no active serve()) is allowed per Session
|
|
659
|
-
* at a time --
|
|
660
|
-
* (#requireHandleNotServing's own doc): the background reader and any
|
|
661
|
-
* other read off this Session's shared control stream would race.
|
|
649
|
+
* at a time -- the one-role rule (#requireHandleNotServing's own doc).
|
|
662
650
|
* Open a second Session for a second topic (or to serve/call
|
|
663
651
|
* concurrently) instead.
|
|
664
652
|
*
|
|
@@ -693,12 +681,11 @@ export class Session {
|
|
|
693
681
|
async subscribe(topic, handler, opts = {}) {
|
|
694
682
|
if (this.#activeServe !== null) {
|
|
695
683
|
throw new Error(`macula-ts: Session.subscribe() while serve("${this.#activeServe.procedure}") is active on the same ` +
|
|
696
|
-
`Session
|
|
684
|
+
`Session is not supported -- open a second Session for the other role.`);
|
|
697
685
|
}
|
|
698
686
|
if (this.#activeSubscription !== null) {
|
|
699
|
-
throw new Error(`macula-ts: Session is already subscribed to "${this.#activeSubscription.topic}" --
|
|
700
|
-
`
|
|
701
|
-
`subscribe() on the same Session races; open a second Session instead.`);
|
|
687
|
+
throw new Error(`macula-ts: Session is already subscribed to "${this.#activeSubscription.topic}" -- one ` +
|
|
688
|
+
`subscribe() per Session is supported; open a second Session instead.`);
|
|
702
689
|
}
|
|
703
690
|
const handle = this.#requireHandle();
|
|
704
691
|
const identityHandle = this.#identity.handleForFfi();
|
|
@@ -764,8 +751,8 @@ export class Session {
|
|
|
764
751
|
}
|
|
765
752
|
/** Content transfer: stores `data` (macula-go's content.Put, on this
|
|
766
753
|
* Session's own fresh dedicated QUIC stream -- Session.
|
|
767
|
-
* OpenDedicatedStream on the Go side, NOT the
|
|
768
|
-
* call()/serve()/the DHT methods/subscribe() all
|
|
754
|
+
* OpenDedicatedStream on the Go side, NOT the control stream
|
|
755
|
+
* call()/serve()/the DHT methods/subscribe() all use), chunking
|
|
769
756
|
* automatically above manifest.DefaultChunkSize (256 KiB) and
|
|
770
757
|
* returning the hex-encoded mcid it's now addressable by. `name` is
|
|
771
758
|
* used ONLY on the chunked path (attached to the resulting manifest)
|
|
@@ -776,12 +763,11 @@ export class Session {
|
|
|
776
763
|
* station may forget this content later, and there is no list/delete
|
|
777
764
|
* operation. Treat this as "hand these bytes to a peer once."
|
|
778
765
|
*
|
|
779
|
-
* Because Put opens its own dedicated stream
|
|
780
|
-
*
|
|
781
|
-
*
|
|
782
|
-
*
|
|
783
|
-
*
|
|
784
|
-
* putContent()/getContent()) on the same Session without racing.
|
|
766
|
+
* Because Put opens its own dedicated stream, this is, unlike call()/
|
|
767
|
+
* serve()/the DHT methods/subscribe(), never subject to Session's
|
|
768
|
+
* one-role rule (#requireHandleNotServing) -- it can run concurrently
|
|
769
|
+
* with an active serve()/subscribe() (or another putContent()/
|
|
770
|
+
* getContent()) on the same Session.
|
|
785
771
|
*
|
|
786
772
|
* Real network I/O (one or more signed CALLs on the new stream) --
|
|
787
773
|
* runs off the main thread on the native side, like every other
|
|
@@ -805,9 +791,9 @@ export class Session {
|
|
|
805
791
|
* (a bad session, a malformed mcid, a real transport error) rejects
|
|
806
792
|
* with a plain Error instead.
|
|
807
793
|
*
|
|
808
|
-
*
|
|
809
|
-
* putContent() -- safe alongside an active serve()/subscribe()
|
|
810
|
-
* same Session. Real network I/O, runs off the main thread. */
|
|
794
|
+
* Not subject to the one-role rule, for the same dedicated-stream
|
|
795
|
+
* reason as putContent() -- safe alongside an active serve()/subscribe()
|
|
796
|
+
* on the same Session. Real network I/O, runs off the main thread. */
|
|
811
797
|
async getContent(mcid) {
|
|
812
798
|
const handle = this.#requireHandle();
|
|
813
799
|
const data = await native.contentGet(handle, this.#identity.handleForFfi(), mcid);
|
package/dist/session.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.js","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AAAA,gEA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AAM,IAAI,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,EAAE,IAAI,CAAC,CAAC;QAClF,IAAI,IAAI,KAAK,IAAI;YAAE,MAAM,IAAI,oBAAoB,CAAC,IAAI,CAAC,CAAC;QACxD,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAED,SAAS,YAAY,CAAC,GAAe;IACnC,IAAI,GAAG,CAAC,MAAM,KAAK,EAAE,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,oDAAoD,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;IACpF,CAAC;AACH,CAAC"}
|
package/dist/ucan.d.ts
CHANGED
|
@@ -54,9 +54,11 @@ export declare class Ucan {
|
|
|
54
54
|
/** The `iss` claim -- an opaque DID string (see didFromNodeId's own
|
|
55
55
|
* doc: not parsed or resolved by this module, carried through as-is). */
|
|
56
56
|
readonly issuer: string;
|
|
57
|
-
/** The `aud` claim
|
|
58
|
-
*
|
|
59
|
-
*
|
|
57
|
+
/** The `aud` claim: for a token Ucan.mint() wrote, the NodeID, as
|
|
58
|
+
* lowercase hex, of the caller it is for. A gated provider accepts the
|
|
59
|
+
* token only from that caller; this module and Session.callWithUcan
|
|
60
|
+
* don't compare it with any local identity (see this module's own
|
|
61
|
+
* doc). */
|
|
60
62
|
readonly audience: string;
|
|
61
63
|
readonly capabilities: readonly UcanCapability[];
|
|
62
64
|
/** The `exp` claim, unix seconds, or `null` if this token has none
|
|
@@ -87,12 +89,12 @@ export declare class Ucan {
|
|
|
87
89
|
/** Mints a fresh UCAN token, self-issued and signed by `issuer`'s own
|
|
88
90
|
* private key (macula-go's `ucan.Create`) -- the resulting token
|
|
89
91
|
* verifies against `issuer`'s own public key (NodeID), matching
|
|
90
|
-
* `ucan.Create`'s documented convention. `
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
* method.
|
|
92
|
+
* `ucan.Create`'s documented convention. `iss` is written as
|
|
93
|
+
* `did:macula:<hex NodeID>` (`didFromNodeId`) and `aud` as `audience`'s
|
|
94
|
+
* lowercase hex (`audienceFromNodeId`), the form a gated provider
|
|
95
|
+
* compares with the calling identity: pass the NodeID of the identity
|
|
96
|
+
* that will present the token. There is no way to mint with custom
|
|
97
|
+
* claim strings through this method.
|
|
96
98
|
*
|
|
97
99
|
* No network I/O -- this never touches a Session or a station; a
|
|
98
100
|
* token can be minted entirely offline given only an `Identity`. */
|
package/dist/ucan.js
CHANGED
|
@@ -18,35 +18,31 @@
|
|
|
18
18
|
// out of scope for this slice. See README.md's "What's explicitly not
|
|
19
19
|
// yet implemented" section.
|
|
20
20
|
//
|
|
21
|
-
//
|
|
22
|
-
//
|
|
23
|
-
//
|
|
24
|
-
//
|
|
25
|
-
//
|
|
26
|
-
//
|
|
27
|
-
//
|
|
28
|
-
// `audience` (any 32-byte NodeID is accepted, including one with no
|
|
29
|
-
// relationship to the minting identity at all), and Session.callWithUcan
|
|
30
|
-
// (session.ts) attaches whatever token it is given with no local
|
|
31
|
-
// "does my identity match this token's audience" guard. Adding either
|
|
32
|
-
// would reject configurations the real wire-level gate accepts fine, and
|
|
33
|
-
// would misrepresent a security property the mesh does not actually
|
|
34
|
-
// enforce.
|
|
21
|
+
// A provider gated with ucan.Required accepts a token only when it
|
|
22
|
+
// verifies against the required issuer and its `aud` claim is the calling
|
|
23
|
+
// identity's NodeID as lowercase hex. Ucan.mint() writes `audience` in
|
|
24
|
+
// that form, so mint a token for the identity that will present it; any
|
|
25
|
+
// 32-byte NodeID is accepted as the audience, related to the minting
|
|
26
|
+
// identity or not. Session.callWithUcan (session.ts) attaches whatever
|
|
27
|
+
// token it is given and leaves the check to the provider.
|
|
35
28
|
import { native } from "./binding.js";
|
|
36
|
-
/**
|
|
37
|
-
* "did:macula:<lowercase hex NodeID>"
|
|
38
|
-
* (
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* is keyed by a raw public key it already has out of band (ucan.Verify's
|
|
45
|
-
* own `publicKey []byte` parameter, ucan/policy.go's
|
|
46
|
-
* `Required(issuerPublicKey []byte)`), never by parsing this string. */
|
|
29
|
+
/** The `iss` claim this module writes for a NodeID:
|
|
30
|
+
* "did:macula:<lowercase hex NodeID>". macula-go's ucan package never
|
|
31
|
+
* parses or resolves it (that's macula_did_nif's job on the Erlang
|
|
32
|
+
* reference, out of scope for both SDKs) -- the cryptographic check a
|
|
33
|
+
* relying party performs is keyed by a raw public key it already has out
|
|
34
|
+
* of band (ucan.Verify's own `publicKey []byte` parameter,
|
|
35
|
+
* ucan/policy.go's `Required(issuerPublicKey []byte)`), never by parsing
|
|
36
|
+
* this string. */
|
|
47
37
|
function didFromNodeId(nodeId) {
|
|
48
38
|
return `did:macula:${Buffer.from(nodeId).toString("hex")}`;
|
|
49
39
|
}
|
|
40
|
+
/** The `aud` claim this module writes for a NodeID: its lowercase hex,
|
|
41
|
+
* the form a gated provider compares with the calling identity
|
|
42
|
+
* (macula-go's ucan.Policy.Check). */
|
|
43
|
+
function audienceFromNodeId(nodeId) {
|
|
44
|
+
return Buffer.from(nodeId).toString("hex");
|
|
45
|
+
}
|
|
50
46
|
/** A decoded (never verified -- see this module's own doc) UCAN token:
|
|
51
47
|
* its raw wire text plus every claim cabi/ucan.go's macula_ucan_decode
|
|
52
48
|
* exposes. Both Ucan.mint() and Ucan.decode() return this same shape --
|
|
@@ -63,9 +59,11 @@ export class Ucan {
|
|
|
63
59
|
/** The `iss` claim -- an opaque DID string (see didFromNodeId's own
|
|
64
60
|
* doc: not parsed or resolved by this module, carried through as-is). */
|
|
65
61
|
issuer;
|
|
66
|
-
/** The `aud` claim
|
|
67
|
-
*
|
|
68
|
-
*
|
|
62
|
+
/** The `aud` claim: for a token Ucan.mint() wrote, the NodeID, as
|
|
63
|
+
* lowercase hex, of the caller it is for. A gated provider accepts the
|
|
64
|
+
* token only from that caller; this module and Session.callWithUcan
|
|
65
|
+
* don't compare it with any local identity (see this module's own
|
|
66
|
+
* doc). */
|
|
69
67
|
audience;
|
|
70
68
|
capabilities;
|
|
71
69
|
/** The `exp` claim, unix seconds, or `null` if this token has none
|
|
@@ -110,12 +108,12 @@ export class Ucan {
|
|
|
110
108
|
/** Mints a fresh UCAN token, self-issued and signed by `issuer`'s own
|
|
111
109
|
* private key (macula-go's `ucan.Create`) -- the resulting token
|
|
112
110
|
* verifies against `issuer`'s own public key (NodeID), matching
|
|
113
|
-
* `ucan.Create`'s documented convention. `
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
* method.
|
|
111
|
+
* `ucan.Create`'s documented convention. `iss` is written as
|
|
112
|
+
* `did:macula:<hex NodeID>` (`didFromNodeId`) and `aud` as `audience`'s
|
|
113
|
+
* lowercase hex (`audienceFromNodeId`), the form a gated provider
|
|
114
|
+
* compares with the calling identity: pass the NodeID of the identity
|
|
115
|
+
* that will present the token. There is no way to mint with custom
|
|
116
|
+
* claim strings through this method.
|
|
119
117
|
*
|
|
120
118
|
* No network I/O -- this never touches a Session or a station; a
|
|
121
119
|
* token can be minted entirely offline given only an `Identity`. */
|
|
@@ -123,7 +121,7 @@ export class Ucan {
|
|
|
123
121
|
if (audience.length !== 32) {
|
|
124
122
|
throw new Error(`macula-ts: UCAN audience NodeID must be exactly 32 bytes, got ${audience.length}`);
|
|
125
123
|
}
|
|
126
|
-
const token = native.ucanMint(issuer.handleForFfi(), didFromNodeId(issuer.nodeId),
|
|
124
|
+
const token = native.ucanMint(issuer.handleForFfi(), didFromNodeId(issuer.nodeId), audienceFromNodeId(audience), JSON.stringify(capabilities ?? []), opts.expiresAt, opts.notBefore, opts.nonce ?? "", opts.facts !== undefined ? JSON.stringify(opts.facts) : undefined, opts.proofs !== undefined ? JSON.stringify(opts.proofs) : undefined);
|
|
127
125
|
return Ucan.decode(token);
|
|
128
126
|
}
|
|
129
127
|
/** Decodes `token`'s claims WITHOUT verifying its signature or
|