@openparachute/hub 0.5.13 → 0.5.14-rc.10

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 (101) hide show
  1. package/README.md +109 -15
  2. package/package.json +2 -2
  3. package/src/__tests__/account-home-ui.test.ts +205 -0
  4. package/src/__tests__/admin-handlers.test.ts +74 -0
  5. package/src/__tests__/admin-host-admin-token.test.ts +62 -0
  6. package/src/__tests__/admin-vault-admin-token.test.ts +44 -0
  7. package/src/__tests__/admin-vaults.test.ts +70 -4
  8. package/src/__tests__/api-account.test.ts +191 -1
  9. package/src/__tests__/api-mint-token.test.ts +682 -3
  10. package/src/__tests__/api-modules-config.test.ts +16 -10
  11. package/src/__tests__/api-modules-ops.test.ts +97 -0
  12. package/src/__tests__/api-modules.test.ts +100 -83
  13. package/src/__tests__/api-ready.test.ts +135 -0
  14. package/src/__tests__/api-revoke-token.test.ts +384 -0
  15. package/src/__tests__/api-users.test.ts +390 -13
  16. package/src/__tests__/chrome-strip.test.ts +15 -15
  17. package/src/__tests__/cli.test.ts +7 -5
  18. package/src/__tests__/cloudflare-detect.test.ts +60 -5
  19. package/src/__tests__/expose-auth-preflight.test.ts +58 -50
  20. package/src/__tests__/expose-cloudflare.test.ts +114 -3
  21. package/src/__tests__/expose-interactive.test.ts +10 -4
  22. package/src/__tests__/expose-public-auto.test.ts +5 -1
  23. package/src/__tests__/expose.test.ts +49 -1
  24. package/src/__tests__/hub-db.test.ts +194 -29
  25. package/src/__tests__/hub-server.test.ts +322 -33
  26. package/src/__tests__/hub.test.ts +11 -0
  27. package/src/__tests__/init.test.ts +827 -0
  28. package/src/__tests__/lifecycle.test.ts +33 -1
  29. package/src/__tests__/migrate.test.ts +433 -51
  30. package/src/__tests__/notes-redirect.test.ts +20 -20
  31. package/src/__tests__/oauth-handlers.test.ts +1060 -29
  32. package/src/__tests__/oauth-ui.test.ts +12 -1
  33. package/src/__tests__/proxy-error-ui.test.ts +212 -0
  34. package/src/__tests__/proxy-state.test.ts +192 -0
  35. package/src/__tests__/resource-binding.test.ts +97 -0
  36. package/src/__tests__/scope-explanations.test.ts +36 -0
  37. package/src/__tests__/serve.test.ts +9 -9
  38. package/src/__tests__/services-manifest.test.ts +40 -40
  39. package/src/__tests__/setup-wizard.test.ts +1114 -66
  40. package/src/__tests__/setup.test.ts +1 -1
  41. package/src/__tests__/status.test.ts +39 -0
  42. package/src/__tests__/users.test.ts +396 -9
  43. package/src/__tests__/vault-auth-status.test.ts +271 -11
  44. package/src/__tests__/vault-hub-origin-env.test.ts +126 -0
  45. package/src/__tests__/well-known.test.ts +9 -9
  46. package/src/__tests__/wizard.test.ts +372 -0
  47. package/src/account-home-ui.ts +547 -0
  48. package/src/admin-handlers.ts +49 -17
  49. package/src/admin-host-admin-token.ts +25 -0
  50. package/src/admin-login-ui.ts +4 -4
  51. package/src/admin-vault-admin-token.ts +17 -0
  52. package/src/admin-vaults.ts +48 -15
  53. package/src/api-account.ts +72 -6
  54. package/src/api-mint-token.ts +132 -24
  55. package/src/api-modules-ops.ts +52 -16
  56. package/src/api-modules.ts +31 -14
  57. package/src/api-ready.ts +102 -0
  58. package/src/api-revoke-token.ts +107 -21
  59. package/src/api-users.ts +497 -58
  60. package/src/bun-link.ts +55 -0
  61. package/src/chrome-strip.ts +6 -6
  62. package/src/cli.ts +93 -24
  63. package/src/cloudflare/config.ts +10 -4
  64. package/src/cloudflare/detect.ts +73 -6
  65. package/src/commands/expose-auth-preflight.ts +55 -63
  66. package/src/commands/expose-cloudflare.ts +114 -10
  67. package/src/commands/expose-interactive.ts +10 -11
  68. package/src/commands/expose-public-auto.ts +6 -4
  69. package/src/commands/expose.ts +8 -0
  70. package/src/commands/init.ts +563 -0
  71. package/src/commands/install.ts +41 -23
  72. package/src/commands/lifecycle.ts +12 -0
  73. package/src/commands/migrate.ts +293 -41
  74. package/src/commands/status.ts +10 -1
  75. package/src/commands/wizard.ts +843 -0
  76. package/src/env-file.ts +10 -0
  77. package/src/help.ts +157 -17
  78. package/src/hub-db.ts +42 -0
  79. package/src/hub-server.ts +136 -23
  80. package/src/hub-settings.ts +13 -2
  81. package/src/hub.ts +16 -9
  82. package/src/notes-redirect.ts +5 -5
  83. package/src/oauth-handlers.ts +342 -173
  84. package/src/oauth-ui.ts +28 -2
  85. package/src/proxy-error-ui.ts +506 -0
  86. package/src/proxy-state.ts +131 -0
  87. package/src/resource-binding.ts +134 -0
  88. package/src/scope-attenuation.ts +85 -0
  89. package/src/scope-explanations.ts +94 -5
  90. package/src/service-spec.ts +39 -18
  91. package/src/setup-wizard.ts +1173 -117
  92. package/src/users.ts +307 -29
  93. package/src/vault/auth-status.ts +152 -25
  94. package/src/vault-hub-origin-env.ts +100 -0
  95. package/web/ui/dist/assets/index-2SSK7JbM.js +61 -0
  96. package/web/ui/dist/assets/index-B28SdMSz.css +1 -0
  97. package/web/ui/dist/index.html +2 -2
  98. package/src/__tests__/vault-tokens-create-interactive.test.ts +0 -183
  99. package/src/commands/vault-tokens-create-interactive.ts +0 -143
  100. package/web/ui/dist/assets/index-7DtAXz7y.css +0 -1
  101. package/web/ui/dist/assets/index-Dzrbe6EP.js +0 -61
@@ -232,10 +232,10 @@ describe("services-manifest", () => {
232
232
  // runner) round-trip byte-identically.
233
233
  describe("ServiceEntry.uis hierarchical sub-units (hub#313)", () => {
234
234
  const app: ServiceEntry = {
235
- name: "parachute-app",
235
+ name: "parachute-surface",
236
236
  port: 1946,
237
- paths: ["/app"],
238
- health: "/app/healthz",
237
+ paths: ["/surface"],
238
+ health: "/surface/healthz",
239
239
  version: "0.1.0",
240
240
  };
241
241
 
@@ -1026,17 +1026,17 @@ describe("legacy short-name row de-dupe (parachute-app#13 / runner#4)", () => {
1026
1026
  JSON.stringify({
1027
1027
  services: [
1028
1028
  {
1029
- name: "parachute-app",
1029
+ name: "parachute-surface",
1030
1030
  port: 1946,
1031
- paths: ["/app"],
1032
- health: "/app/healthz",
1031
+ paths: ["/surface"],
1032
+ health: "/surface/healthz",
1033
1033
  version: "0.2.0",
1034
1034
  },
1035
1035
  {
1036
1036
  name: "app",
1037
1037
  port: 1946,
1038
- paths: ["/app"],
1039
- health: "/app/healthz",
1038
+ paths: ["/surface"],
1039
+ health: "/surface/healthz",
1040
1040
  version: "0.2.0",
1041
1041
  },
1042
1042
  ],
@@ -1044,7 +1044,7 @@ describe("legacy short-name row de-dupe (parachute-app#13 / runner#4)", () => {
1044
1044
  );
1045
1045
  const m = readManifest(path);
1046
1046
  expect(m.services).toHaveLength(1);
1047
- expect(m.services[0]?.name).toBe("parachute-app");
1047
+ expect(m.services[0]?.name).toBe("parachute-surface");
1048
1048
  } finally {
1049
1049
  cleanup();
1050
1050
  }
@@ -1099,10 +1099,10 @@ describe("legacy short-name row de-dupe (parachute-app#13 / runner#4)", () => {
1099
1099
  JSON.stringify({
1100
1100
  services: [
1101
1101
  {
1102
- name: "app",
1102
+ name: "widget",
1103
1103
  port: 1946,
1104
- paths: ["/app"],
1105
- health: "/app/healthz",
1104
+ paths: ["/surface"],
1105
+ health: "/surface/healthz",
1106
1106
  version: "0.2.0",
1107
1107
  },
1108
1108
  ],
@@ -1110,7 +1110,7 @@ describe("legacy short-name row de-dupe (parachute-app#13 / runner#4)", () => {
1110
1110
  );
1111
1111
  const m = readManifest(path);
1112
1112
  expect(m.services).toHaveLength(1);
1113
- expect(m.services[0]?.name).toBe("app");
1113
+ expect(m.services[0]?.name).toBe("widget");
1114
1114
  } finally {
1115
1115
  cleanup();
1116
1116
  }
@@ -1124,17 +1124,17 @@ describe("legacy short-name row de-dupe (parachute-app#13 / runner#4)", () => {
1124
1124
  JSON.stringify({
1125
1125
  services: [
1126
1126
  {
1127
- name: "parachute-app",
1127
+ name: "parachute-surface",
1128
1128
  port: 1946,
1129
- paths: ["/app"],
1130
- health: "/app/healthz",
1129
+ paths: ["/surface"],
1130
+ health: "/surface/healthz",
1131
1131
  version: "0.2.0",
1132
1132
  },
1133
1133
  {
1134
- name: "app",
1134
+ name: "widget",
1135
1135
  port: 9999,
1136
- paths: ["/their-app"],
1137
- health: "/their-app/health",
1136
+ paths: ["/widget"],
1137
+ health: "/widget/health",
1138
1138
  version: "1.0.0",
1139
1139
  },
1140
1140
  ],
@@ -1142,7 +1142,7 @@ describe("legacy short-name row de-dupe (parachute-app#13 / runner#4)", () => {
1142
1142
  );
1143
1143
  const m = readManifest(path);
1144
1144
  expect(m.services).toHaveLength(2);
1145
- expect(m.services.map((s) => s.name).sort()).toEqual(["app", "parachute-app"]);
1145
+ expect(m.services.map((s) => s.name).sort()).toEqual(["parachute-surface", "widget"]);
1146
1146
  } finally {
1147
1147
  cleanup();
1148
1148
  }
@@ -1164,10 +1164,10 @@ describe("legacy short-name row de-dupe (parachute-app#13 / runner#4)", () => {
1164
1164
  JSON.stringify({
1165
1165
  services: [
1166
1166
  {
1167
- name: "parachute-app",
1167
+ name: "parachute-surface",
1168
1168
  port: 1946,
1169
- paths: ["/app"],
1170
- health: "/app/healthz",
1169
+ paths: ["/surface"],
1170
+ health: "/surface/healthz",
1171
1171
  version: "0.2.0",
1172
1172
  },
1173
1173
  {
@@ -1197,17 +1197,17 @@ describe("legacy short-name row de-dupe (parachute-app#13 / runner#4)", () => {
1197
1197
  JSON.stringify({
1198
1198
  services: [
1199
1199
  {
1200
- name: "parachute-app",
1200
+ name: "parachute-surface",
1201
1201
  port: 1946,
1202
- paths: ["/app"],
1203
- health: "/app/healthz",
1202
+ paths: ["/surface"],
1203
+ health: "/surface/healthz",
1204
1204
  version: "0.2.0",
1205
1205
  },
1206
1206
  {
1207
1207
  name: "app",
1208
1208
  port: 1946,
1209
- paths: ["/app"],
1210
- health: "/app/healthz",
1209
+ paths: ["/surface"],
1210
+ health: "/surface/healthz",
1211
1211
  version: "0.2.0",
1212
1212
  },
1213
1213
  ],
@@ -1296,10 +1296,10 @@ describe("retired-module row de-dupe (hub#334)", () => {
1296
1296
  JSON.stringify({
1297
1297
  services: [
1298
1298
  {
1299
- name: "parachute-app",
1299
+ name: "parachute-surface",
1300
1300
  port: 1946,
1301
- paths: ["/app"],
1302
- health: "/app/healthz",
1301
+ paths: ["/surface"],
1302
+ health: "/surface/healthz",
1303
1303
  version: "0.2.0",
1304
1304
  },
1305
1305
  ],
@@ -1308,7 +1308,7 @@ describe("retired-module row de-dupe (hub#334)", () => {
1308
1308
  const mtimeBefore = statSync(path).mtimeMs;
1309
1309
  const m = readManifest(path);
1310
1310
  expect(m.services).toHaveLength(1);
1311
- expect(m.services[0]?.name).toBe("parachute-app");
1311
+ expect(m.services[0]?.name).toBe("parachute-surface");
1312
1312
  // No rewrite when there's nothing to clean.
1313
1313
  expect(statSync(path).mtimeMs).toBe(mtimeBefore);
1314
1314
  } finally {
@@ -1334,10 +1334,10 @@ describe("retired-module row de-dupe (hub#334)", () => {
1334
1334
  version: "0.1.4",
1335
1335
  },
1336
1336
  {
1337
- name: "parachute-app",
1337
+ name: "parachute-surface",
1338
1338
  port: 1946,
1339
- paths: ["/app"],
1340
- health: "/app/healthz",
1339
+ paths: ["/surface"],
1340
+ health: "/surface/healthz",
1341
1341
  version: "0.2.0",
1342
1342
  },
1343
1343
  ],
@@ -1345,7 +1345,7 @@ describe("retired-module row de-dupe (hub#334)", () => {
1345
1345
  );
1346
1346
  const m = readManifest(path);
1347
1347
  expect(m.services).toHaveLength(1);
1348
- expect(m.services[0]?.name).toBe("parachute-app");
1348
+ expect(m.services[0]?.name).toBe("parachute-surface");
1349
1349
  } finally {
1350
1350
  cleanup();
1351
1351
  }
@@ -1411,8 +1411,8 @@ describe("readManifestLenient — skips bad entries instead of throwing (hub#406
1411
1411
  JSON.stringify({
1412
1412
  services: [
1413
1413
  { name: "parachute-vault", port: 1940, paths: ["/vault/default"], health: "/vault/default/health", version: "0.4.8-rc.10" },
1414
- { name: "parachute-app", port: 1946, paths: ["/app"], health: "/app/healthz", version: "0.2.0-rc.13" },
1415
- { name: "app", port: 0, paths: ["/app"], health: "/app/healthz", version: "0.2.0-rc.4" },
1414
+ { name: "parachute-surface", port: 1946, paths: ["/surface"], health: "/surface/healthz", version: "0.2.0-rc.13" },
1415
+ { name: "widget", port: 0, paths: ["/widget"], health: "/widget/health", version: "0.0.1" },
1416
1416
  ],
1417
1417
  }),
1418
1418
  );
@@ -1420,7 +1420,7 @@ describe("readManifestLenient — skips bad entries instead of throwing (hub#406
1420
1420
  const log = { warn: (m: string) => warnings.push(m) };
1421
1421
  const m = readManifestLenient(path, log);
1422
1422
  const names = m.services.map((s) => s.name).sort();
1423
- expect(names).toEqual(["parachute-app", "parachute-vault"]);
1423
+ expect(names).toEqual(["parachute-surface", "parachute-vault"]);
1424
1424
  expect(warnings.some((w) => w.includes("port") && w.includes("integer"))).toBe(true);
1425
1425
  } finally {
1426
1426
  cleanup();
@@ -1479,7 +1479,7 @@ describe("readManifestLenient — skips bad entries instead of throwing (hub#406
1479
1479
  writeFileSync(
1480
1480
  path,
1481
1481
  JSON.stringify({
1482
- services: [{ name: "app", port: 0, paths: ["/app"], health: "/app/healthz", version: "0.2.0-rc.4" }],
1482
+ services: [{ name: "widget", port: 0, paths: ["/widget"], health: "/widget/health", version: "0.0.1" }],
1483
1483
  }),
1484
1484
  );
1485
1485
  expect(() => readManifest(path)).toThrow(ServicesManifestError);