@hediet/linkrpc-hub 0.0.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.
Files changed (50) hide show
  1. package/README.md +101 -0
  2. package/dist/chunks/config-BCvkg7jv.d.ts +566 -0
  3. package/dist/chunks/configFile-y6Phntqu.d.ts +9 -0
  4. package/dist/chunks/connectionTokenBinder.interfaces-B-beCg06.js +40 -0
  5. package/dist/chunks/connectionTokenBinder.interfaces-B-beCg06.js.map +1 -0
  6. package/dist/chunks/connectionTokenBinder.interfaces-BhzQ1DTS.d.ts +36 -0
  7. package/dist/chunks/hubConnectionAcceptor-B5-8JsFY.js +2768 -0
  8. package/dist/chunks/hubConnectionAcceptor-B5-8JsFY.js.map +1 -0
  9. package/dist/chunks/hubConnectionAcceptor-BwydvFa4.d.ts +1560 -0
  10. package/dist/chunks/index-CLIUrV88.d.ts +481 -0
  11. package/dist/chunks/node-CTXsQ6oa.js +460 -0
  12. package/dist/chunks/node-CTXsQ6oa.js.map +1 -0
  13. package/dist/chunks/nodeTransit-CWeFnbwt.js +444 -0
  14. package/dist/chunks/nodeTransit-CWeFnbwt.js.map +1 -0
  15. package/dist/chunks/nodeTransit-cmtZgdpW.d.ts +226 -0
  16. package/dist/chunks/runHub-P3YUwwdv.js +1797 -0
  17. package/dist/chunks/runHub-P3YUwwdv.js.map +1 -0
  18. package/dist/chunks/server-BAxchQhy.js +1368 -0
  19. package/dist/chunks/server-BAxchQhy.js.map +1 -0
  20. package/dist/cli.d.ts +1 -0
  21. package/dist/cli.js +38 -0
  22. package/dist/cli.js.map +1 -0
  23. package/dist/config.d.ts +2 -0
  24. package/dist/config.js +305 -0
  25. package/dist/config.js.map +1 -0
  26. package/dist/configFile.d.ts +2 -0
  27. package/dist/configFile.js +27 -0
  28. package/dist/configFile.js.map +1 -0
  29. package/dist/engine/runHub.d.ts +42 -0
  30. package/dist/engine/runHub.js +2 -0
  31. package/dist/hub/server/client.d.ts +2 -0
  32. package/dist/hub/server/client.js +2 -0
  33. package/dist/hub/server/connectionTokenBinder.d.ts +2 -0
  34. package/dist/hub/server/connectionTokenBinder.js +2 -0
  35. package/dist/hub/server/index.d.ts +5 -0
  36. package/dist/hub/server/index.js +5 -0
  37. package/dist/hub/server/node/index.d.ts +218 -0
  38. package/dist/hub/server/node/index.js +2 -0
  39. package/dist/hub/server/transit.d.ts +2 -0
  40. package/dist/hub/server/transit.js +2 -0
  41. package/dist/index.d.ts +512 -0
  42. package/dist/index.js +309 -0
  43. package/dist/index.js.map +1 -0
  44. package/dist/serve.d.ts +14 -0
  45. package/dist/serve.js +31 -0
  46. package/dist/serve.js.map +1 -0
  47. package/dist/spawn.d.ts +12 -0
  48. package/dist/spawn.js +25 -0
  49. package/dist/spawn.js.map +1 -0
  50. package/package.json +83 -0
@@ -0,0 +1,40 @@
1
+ import { defineInterface, requestType } from "@hediet/linkrpc";
2
+ import { number, object, optional, string } from "zod/mini";
3
+ //#region src/hub/server/connectionTokenBinder.interfaces.ts
4
+ /**
5
+ * Privileged **connection-token binder**, served by a trusted, hub-spawned
6
+ * endpoint that carries a `connectionTokenBinder` grant. It mints a single-use
7
+ * `hubrpc::initialize` token that binds up to two independent things for a
8
+ * **future** peer connection:
9
+ *
10
+ * - an `identitySlot` — the managed identity the peer inherits (`identity::*`),
11
+ * authorized against the binder's `identitySlotPrefix`; and
12
+ * - a `serviceIdNamespace` — the serviceId namespace the peer may claim freely
13
+ * (`hubGrantedServiceId::get`), authorized against the binder's
14
+ * `serviceIdPrefix`.
15
+ *
16
+ * Both request fields are optional and authorized independently: omit a field
17
+ * to leave that axis unbound. The peer later presents the returned token in its
18
+ * `hubrpc::initialize` handshake on a `managedIdentity: { mode: "fromToken" }`
19
+ * and/or `grantedServiceId: { mode: "fromToken" }` listener, which redeems it.
20
+ *
21
+ * This is the broker side of the token model: the caller asks the hub to issue a
22
+ * credential for **another** (future) connection — distinct from `identity::*`
23
+ * (which is about the caller's *own* identity). Minting is authorized purely by
24
+ * the binder's configured prefixes: each requested field must fall under its
25
+ * corresponding prefix.
26
+ */
27
+ const connectionTokenBinderInterface = defineInterface({
28
+ id: "connectionTokenBinder",
29
+ description: "Privileged connection-token binder: mints single-use hubrpc::initialize tokens binding an identity slot and/or a serviceId namespace, for redemption by a peer on a `managedIdentity` / `grantedServiceId` { mode: \"fromToken\" } listener. Each field is authorized against the binder's identitySlotPrefix / serviceIdPrefix."
30
+ }, { bindConnectionToken: requestType(object({
31
+ identitySlot: optional(string()),
32
+ serviceIdNamespace: optional(string())
33
+ }), object({
34
+ token: string(),
35
+ expiresAt: number()
36
+ })) });
37
+ //#endregion
38
+ export { connectionTokenBinderInterface as t };
39
+
40
+ //# sourceMappingURL=connectionTokenBinder.interfaces-B-beCg06.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connectionTokenBinder.interfaces-B-beCg06.js","names":[],"sources":["../../src/hub/server/connectionTokenBinder.interfaces.ts"],"sourcesContent":["import { number, object, optional, string } from 'zod/mini';\nimport { defineInterface, requestType } from '@hediet/linkrpc';\n\n/**\n * Privileged **connection-token binder**, served by a trusted, hub-spawned\n * endpoint that carries a `connectionTokenBinder` grant. It mints a single-use\n * `hubrpc::initialize` token that binds up to two independent things for a\n * **future** peer connection:\n *\n * - an `identitySlot` — the managed identity the peer inherits (`identity::*`),\n * authorized against the binder's `identitySlotPrefix`; and\n * - a `serviceIdNamespace` — the serviceId namespace the peer may claim freely\n * (`hubGrantedServiceId::get`), authorized against the binder's\n * `serviceIdPrefix`.\n *\n * Both request fields are optional and authorized independently: omit a field\n * to leave that axis unbound. The peer later presents the returned token in its\n * `hubrpc::initialize` handshake on a `managedIdentity: { mode: \"fromToken\" }`\n * and/or `grantedServiceId: { mode: \"fromToken\" }` listener, which redeems it.\n *\n * This is the broker side of the token model: the caller asks the hub to issue a\n * credential for **another** (future) connection — distinct from `identity::*`\n * (which is about the caller's *own* identity). Minting is authorized purely by\n * the binder's configured prefixes: each requested field must fall under its\n * corresponding prefix.\n */\nexport const connectionTokenBinderInterface = defineInterface(\n {\n id: 'connectionTokenBinder',\n description:\n 'Privileged connection-token binder: mints single-use ' +\n 'hubrpc::initialize tokens binding an identity slot and/or a ' +\n 'serviceId namespace, for redemption by a peer on a `managedIdentity` ' +\n '/ `grantedServiceId` { mode: \"fromToken\" } listener. Each field is ' +\n \"authorized against the binder's identitySlotPrefix / serviceIdPrefix.\",\n },\n {\n bindConnectionToken: requestType(\n object({\n identitySlot: optional(string()),\n serviceIdNamespace: optional(string()),\n }),\n object({ token: string(), expiresAt: number() }),\n ),\n },\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAa,iCAAiC,gBAC1C;CACI,IAAI;CACJ,aACI;AAKR,GACA,EACI,qBAAqB,YACjB,OAAO;CACH,cAAc,SAAS,OAAO,CAAC;CAC/B,oBAAoB,SAAS,OAAO,CAAC;AACzC,CAAC,GACD,OAAO;CAAE,OAAO,OAAO;CAAG,WAAW,OAAO;AAAE,CAAC,CACnD,EACJ,CACJ"}
@@ -0,0 +1,36 @@
1
+ //#region src/hub/server/connectionTokenBinder.interfaces.d.ts
2
+ /**
3
+ * Privileged **connection-token binder**, served by a trusted, hub-spawned
4
+ * endpoint that carries a `connectionTokenBinder` grant. It mints a single-use
5
+ * `hubrpc::initialize` token that binds up to two independent things for a
6
+ * **future** peer connection:
7
+ *
8
+ * - an `identitySlot` — the managed identity the peer inherits (`identity::*`),
9
+ * authorized against the binder's `identitySlotPrefix`; and
10
+ * - a `serviceIdNamespace` — the serviceId namespace the peer may claim freely
11
+ * (`hubGrantedServiceId::get`), authorized against the binder's
12
+ * `serviceIdPrefix`.
13
+ *
14
+ * Both request fields are optional and authorized independently: omit a field
15
+ * to leave that axis unbound. The peer later presents the returned token in its
16
+ * `hubrpc::initialize` handshake on a `managedIdentity: { mode: "fromToken" }`
17
+ * and/or `grantedServiceId: { mode: "fromToken" }` listener, which redeems it.
18
+ *
19
+ * This is the broker side of the token model: the caller asks the hub to issue a
20
+ * credential for **another** (future) connection — distinct from `identity::*`
21
+ * (which is about the caller's *own* identity). Minting is authorized purely by
22
+ * the binder's configured prefixes: each requested field must fall under its
23
+ * corresponding prefix.
24
+ */
25
+ declare const connectionTokenBinderInterface: import("@hediet/linkrpc").InterfaceDefinition<{
26
+ bindConnectionToken: import("@hediet/linkrpc").RequestType<{
27
+ identitySlot?: string | undefined;
28
+ serviceIdNamespace?: string | undefined;
29
+ }, {
30
+ token: string;
31
+ expiresAt: number;
32
+ }, any, never, never>;
33
+ }>;
34
+ //#endregion
35
+ export { connectionTokenBinderInterface as t };
36
+ //# sourceMappingURL=connectionTokenBinder.interfaces-BhzQ1DTS.d.ts.map