@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.
- package/README.md +109 -15
- package/package.json +2 -2
- package/src/__tests__/account-home-ui.test.ts +205 -0
- package/src/__tests__/admin-handlers.test.ts +74 -0
- package/src/__tests__/admin-host-admin-token.test.ts +62 -0
- package/src/__tests__/admin-vault-admin-token.test.ts +44 -0
- package/src/__tests__/admin-vaults.test.ts +70 -4
- package/src/__tests__/api-account.test.ts +191 -1
- package/src/__tests__/api-mint-token.test.ts +682 -3
- package/src/__tests__/api-modules-config.test.ts +16 -10
- package/src/__tests__/api-modules-ops.test.ts +97 -0
- package/src/__tests__/api-modules.test.ts +100 -83
- package/src/__tests__/api-ready.test.ts +135 -0
- package/src/__tests__/api-revoke-token.test.ts +384 -0
- package/src/__tests__/api-users.test.ts +390 -13
- package/src/__tests__/chrome-strip.test.ts +15 -15
- package/src/__tests__/cli.test.ts +7 -5
- package/src/__tests__/cloudflare-detect.test.ts +60 -5
- package/src/__tests__/expose-auth-preflight.test.ts +58 -50
- package/src/__tests__/expose-cloudflare.test.ts +114 -3
- package/src/__tests__/expose-interactive.test.ts +10 -4
- package/src/__tests__/expose-public-auto.test.ts +5 -1
- package/src/__tests__/expose.test.ts +49 -1
- package/src/__tests__/hub-db.test.ts +194 -29
- package/src/__tests__/hub-server.test.ts +322 -33
- package/src/__tests__/hub.test.ts +11 -0
- package/src/__tests__/init.test.ts +827 -0
- package/src/__tests__/lifecycle.test.ts +33 -1
- package/src/__tests__/migrate.test.ts +433 -51
- package/src/__tests__/notes-redirect.test.ts +20 -20
- package/src/__tests__/oauth-handlers.test.ts +1060 -29
- package/src/__tests__/oauth-ui.test.ts +12 -1
- package/src/__tests__/proxy-error-ui.test.ts +212 -0
- package/src/__tests__/proxy-state.test.ts +192 -0
- package/src/__tests__/resource-binding.test.ts +97 -0
- package/src/__tests__/scope-explanations.test.ts +36 -0
- package/src/__tests__/serve.test.ts +9 -9
- package/src/__tests__/services-manifest.test.ts +40 -40
- package/src/__tests__/setup-wizard.test.ts +1114 -66
- package/src/__tests__/setup.test.ts +1 -1
- package/src/__tests__/status.test.ts +39 -0
- package/src/__tests__/users.test.ts +396 -9
- package/src/__tests__/vault-auth-status.test.ts +271 -11
- package/src/__tests__/vault-hub-origin-env.test.ts +126 -0
- package/src/__tests__/well-known.test.ts +9 -9
- package/src/__tests__/wizard.test.ts +372 -0
- package/src/account-home-ui.ts +547 -0
- package/src/admin-handlers.ts +49 -17
- package/src/admin-host-admin-token.ts +25 -0
- package/src/admin-login-ui.ts +4 -4
- package/src/admin-vault-admin-token.ts +17 -0
- package/src/admin-vaults.ts +48 -15
- package/src/api-account.ts +72 -6
- package/src/api-mint-token.ts +132 -24
- package/src/api-modules-ops.ts +52 -16
- package/src/api-modules.ts +31 -14
- package/src/api-ready.ts +102 -0
- package/src/api-revoke-token.ts +107 -21
- package/src/api-users.ts +497 -58
- package/src/bun-link.ts +55 -0
- package/src/chrome-strip.ts +6 -6
- package/src/cli.ts +93 -24
- package/src/cloudflare/config.ts +10 -4
- package/src/cloudflare/detect.ts +73 -6
- package/src/commands/expose-auth-preflight.ts +55 -63
- package/src/commands/expose-cloudflare.ts +114 -10
- package/src/commands/expose-interactive.ts +10 -11
- package/src/commands/expose-public-auto.ts +6 -4
- package/src/commands/expose.ts +8 -0
- package/src/commands/init.ts +563 -0
- package/src/commands/install.ts +41 -23
- package/src/commands/lifecycle.ts +12 -0
- package/src/commands/migrate.ts +293 -41
- package/src/commands/status.ts +10 -1
- package/src/commands/wizard.ts +843 -0
- package/src/env-file.ts +10 -0
- package/src/help.ts +157 -17
- package/src/hub-db.ts +42 -0
- package/src/hub-server.ts +136 -23
- package/src/hub-settings.ts +13 -2
- package/src/hub.ts +16 -9
- package/src/notes-redirect.ts +5 -5
- package/src/oauth-handlers.ts +342 -173
- package/src/oauth-ui.ts +28 -2
- package/src/proxy-error-ui.ts +506 -0
- package/src/proxy-state.ts +131 -0
- package/src/resource-binding.ts +134 -0
- package/src/scope-attenuation.ts +85 -0
- package/src/scope-explanations.ts +94 -5
- package/src/service-spec.ts +39 -18
- package/src/setup-wizard.ts +1173 -117
- package/src/users.ts +307 -29
- package/src/vault/auth-status.ts +152 -25
- package/src/vault-hub-origin-env.ts +100 -0
- package/web/ui/dist/assets/index-2SSK7JbM.js +61 -0
- package/web/ui/dist/assets/index-B28SdMSz.css +1 -0
- package/web/ui/dist/index.html +2 -2
- package/src/__tests__/vault-tokens-create-interactive.test.ts +0 -183
- package/src/commands/vault-tokens-create-interactive.ts +0 -143
- package/web/ui/dist/assets/index-7DtAXz7y.css +0 -1
- package/web/ui/dist/assets/index-Dzrbe6EP.js +0 -61
package/src/hub.ts
CHANGED
|
@@ -91,8 +91,15 @@ function renderSignedIn(displayName: string, csrfToken: string): string {
|
|
|
91
91
|
// Inline POST form so sign-out works without JS. Submit button is
|
|
92
92
|
// styled as a text link via `.auth-signout` so the visual weight
|
|
93
93
|
// matches the surrounding "Signed in as <name>" text.
|
|
94
|
+
//
|
|
95
|
+
// The "Account" link is the single breadcrumb to `/account/` — the
|
|
96
|
+
// self-service home where any signed-in user (admin or invited
|
|
97
|
+
// member) can change their password, see their vault, and sign out.
|
|
98
|
+
// Without it, a friend who's been handed credentials has no way to
|
|
99
|
+
// discover the change-password surface after the first-login prompt.
|
|
94
100
|
return `<div class="auth-indicator">
|
|
95
101
|
<span class="muted">Signed in as <strong>${escapeHtml(displayName)}</strong></span>
|
|
102
|
+
<a href="/account/" class="auth-account">Account</a>
|
|
96
103
|
<form method="POST" action="/logout" class="auth-signout-form">
|
|
97
104
|
<input type="hidden" name="${CSRF_FIELD_NAME}" value="${escapeAttr(csrfToken)}" />
|
|
98
105
|
<button type="submit" class="auth-signout">Sign out</button>
|
|
@@ -203,7 +210,7 @@ const HTML_TEMPLATE = `<!doctype html>
|
|
|
203
210
|
margin: 0;
|
|
204
211
|
display: inline;
|
|
205
212
|
}
|
|
206
|
-
.auth-signout, .auth-signin {
|
|
213
|
+
.auth-signout, .auth-signin, .auth-account {
|
|
207
214
|
background: none;
|
|
208
215
|
border: none;
|
|
209
216
|
padding: 0;
|
|
@@ -214,10 +221,10 @@ const HTML_TEMPLATE = `<!doctype html>
|
|
|
214
221
|
text-decoration-thickness: 1px;
|
|
215
222
|
text-underline-offset: 2px;
|
|
216
223
|
}
|
|
217
|
-
.auth-signout:hover, .auth-signin:hover {
|
|
224
|
+
.auth-signout:hover, .auth-signin:hover, .auth-account:hover {
|
|
218
225
|
color: var(--accent-hover);
|
|
219
226
|
}
|
|
220
|
-
a.auth-signin {
|
|
227
|
+
a.auth-signin, a.auth-account {
|
|
221
228
|
/* Anchor needs explicit reset since the a element has its own
|
|
222
229
|
color/decoration. */
|
|
223
230
|
border-bottom: none;
|
|
@@ -471,9 +478,9 @@ const HTML_TEMPLATE = `<!doctype html>
|
|
|
471
478
|
* Render the "Get started" section (hub#342) above the Services grid.
|
|
472
479
|
*
|
|
473
480
|
* One hardcoded target, conditional on its prerequisite being installed:
|
|
474
|
-
* - "Open Notes" → /
|
|
475
|
-
*
|
|
476
|
-
* mere presence of
|
|
481
|
+
* - "Open Notes" → /surface/notes/ (requires parachute-surface installed;
|
|
482
|
+
* Surface auto-bootstraps Notes-as-UI per parachute-surface §17, so the
|
|
483
|
+
* mere presence of Surface means /surface/notes/ is live)
|
|
477
484
|
*
|
|
478
485
|
* The earlier "Browse Vault" tile retired in workstream C (2026-05-25)
|
|
479
486
|
* once vault declared uiUrl in its module.json (per patterns#96). With
|
|
@@ -500,12 +507,12 @@ const HTML_TEMPLATE = `<!doctype html>
|
|
|
500
507
|
function renderGetStarted(services) {
|
|
501
508
|
if (!getStartedGrid || !getStartedSection) return;
|
|
502
509
|
const tiles = [];
|
|
503
|
-
const
|
|
504
|
-
if (
|
|
510
|
+
const hasSurface = services.some((s) => s && s.name === 'parachute-surface');
|
|
511
|
+
if (hasSurface) {
|
|
505
512
|
tiles.push({
|
|
506
513
|
title: 'Open Notes',
|
|
507
514
|
desc: 'Browse + capture in the Notes app — reads from your vault.',
|
|
508
|
-
href: '/
|
|
515
|
+
href: '/surface/notes/',
|
|
509
516
|
});
|
|
510
517
|
}
|
|
511
518
|
if (tiles.length === 0) {
|
package/src/notes-redirect.ts
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Notes-as-app migration Phase 2 (parachute-app design doc §16).
|
|
3
3
|
*
|
|
4
4
|
* When parachute-app ships and Notes installs as `parachute-app add
|
|
5
|
-
* @openparachute/notes-ui --name notes --path /
|
|
5
|
+
* @openparachute/notes-ui --name notes --path /surface/notes`, operators with
|
|
6
6
|
* existing `/notes/*` bookmarks need a transparent bridge. The hub serves a
|
|
7
|
-
* 301 redirect from `/notes/*` → `/
|
|
7
|
+
* 301 redirect from `/notes/*` → `/surface/notes/*` so:
|
|
8
8
|
*
|
|
9
9
|
* - cached operator URLs (notes PWA install banners, browser history,
|
|
10
10
|
* in-vault links) keep working
|
|
@@ -44,14 +44,14 @@ export function isLegacyNotesPath(pathname: string): boolean {
|
|
|
44
44
|
* string. The query is preserved verbatim; the fragment isn't visible
|
|
45
45
|
* server-side (clients reassemble it after following the redirect).
|
|
46
46
|
*
|
|
47
|
-
* The transform is purely path-rewrite — `/notes` → `/
|
|
48
|
-
* → `/
|
|
47
|
+
* The transform is purely path-rewrite — `/notes` → `/surface/notes`, `/notes/`
|
|
48
|
+
* → `/surface/notes/`, `/notes/foo/bar` → `/surface/notes/foo/bar`.
|
|
49
49
|
*/
|
|
50
50
|
export function buildNotesRedirectTarget(pathname: string, search: string): string {
|
|
51
51
|
// Slice off the leading "/notes" — what remains is either "" (bare /notes),
|
|
52
52
|
// "/" (trailing slash), or "/<rest>" (sub-path).
|
|
53
53
|
const tail = pathname.slice("/notes".length);
|
|
54
|
-
return `/
|
|
54
|
+
return `/surface/notes${tail}${search}`;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
/**
|