@iicp/web-node 0.2.1 → 0.2.2

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.
@@ -316,6 +316,10 @@ export class BrowserNodeProvider {
316
316
  headers: {
317
317
  Authorization: `Bearer ${this._nodeToken}`,
318
318
  "Content-Type": "application/json",
319
+ // Opaque node tokens need an explicit subject hint; JWT-backed
320
+ // clients can be resolved from their claims, but browser providers
321
+ // intentionally use the portable opaque registration credential.
322
+ "X-Node-Id": this.nodeId,
319
323
  },
320
324
  body: JSON.stringify({ relay_node_id: this.cfg.relayNodeId ?? "*" }),
321
325
  });
@@ -360,7 +364,11 @@ export class BrowserNodeProvider {
360
364
  try {
361
365
  await fetch(`${this.directoryBase}/v1/register`, {
362
366
  method: "DELETE",
363
- headers: { Authorization: `Bearer ${this._nodeToken}` },
367
+ headers: {
368
+ Authorization: `Bearer ${this._nodeToken}`,
369
+ // Opaque registration credentials carry no subject claim.
370
+ "X-Node-Id": this.nodeId,
371
+ },
364
372
  keepalive: true,
365
373
  });
366
374
  this.log("deregistered from directory");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iicp/web-node",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Browser-native IICP node (consume + serve): discovery-mesh client with mandatory E2E encryption (IICP-CX) + WebLLM provider. Zero-config, ESM.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",