You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d80dc1a
Browse filesBrowse the repository at this point in the historyBrowse files
<!-- Use a conventional commit-style title, such as "fix(hub): retain
prototype history". -->
## Why
<!-- Explain the problem and why this change matters in a short,
plain-English paragraph. Link the issue when applicable. -->
People working on Hub need a quick way to try authenticated pages
without registering a GitHub or Entra application first.
## What changes
<!-- Describe what becomes different for a first-time reader. Explain
necessary terms. Include accurate Mermaid diagrams when they clarify the
proposal, using before/after diagrams when helpful. Add screenshots for
meaningful UI changes. -->
<!-- Omit validation sections, checklists, and routine test/CI summaries
such as "CI is green" or "tests passed". Mention only known verification
gaps that affect the change, not disclaimers about drafting the
description. -->
<!-- For UI changes, prune obsolete and duplicate stories in the
affected catalogues as part of the change. Explain removed UI or
consolidated coverage where needed; see
hub/docs/storybook.md#ui-changes-and-pull-request-evidence. -->
`npm run dev:api` starts the API with one fixed local developer who has
administrator access. Local sign-in uses Hub's normal authorization,
admission, session, rate-limit, and audit flow, and refuses non-local
databases and remotely reachable listeners or origins. `npm run
dev:api:live` disables local sign-in and requires GitHub or Entra
settings. After signing in locally, `npm run db:seed:index` can populate
the sample repository without a user ID. Real GitHub or Entra sign-in
was not exercised because provider credentials were unavailable.
## Storybook screenshots
<!-- For Hub or canvas UI changes, follow
hub/docs/storybook.md#ui-changes-and-pull-request-evidence. Embed
uploaded screenshots of EVERY added or changed story, including stories
affected indirectly by shared code, styles, copy, or fixtures. Label
each with its full story title/name, theme, and viewport. Keep this
section last and refresh images after UI revisions. Name any missing
story and its rendering/upload blocker; incomplete evidence is not
completion. Remove this section only when no story presentation changes.
-->
**Hub/Pages/Home / Local Developer — dark — 1440 × 1100**

**Hub/Pages/Home / Local Developer — light (system preference) — 1440 ×
1100**

---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 494096eb-fdb5-4c27-b5da-8d4dc060b19d
Copy file name to clipboardExpand all lines: hub/AGENTS.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,8 @@ Hub is being rebuilt in TypeScript. Read the [root instructions](../AGENTS.md),
12
12
13
13
Run Node commands from `hub/`, locally or inside the devcontainer. PostgreSQL and Prisma support configured GitHub authentication, administrator enrollment, Hub sessions, and a seeded read-only prototype index; see [authentication](docs/authentication.md). Other prototype APIs and repository-specific permissions are not built. Agree on the design before adding more product models, permissions, deployment choices, or product API routes.
14
14
15
+
Use `npm run dev:api` to run Hub with local developer sign-in; this is the default choice for trying or testing Hub. Use `npm run dev:api:live` only when the task needs real GitHub or Entra sign-in configured in `.env`. [Development](docs/development.md#start-with-the-real-api) explains both modes.
16
+
15
17
`npm test` does not require PostgreSQL. Use `npm run test:database` for `.db.test.ts` and `.db.test.tsx` cases in Node.js or jsdom. Follow the database isolation and reset rules in [testing](docs/testing-and-operations.md).
16
18
17
19
Keep the top-level `HubThemeProvider` around Hub and Storybook content. It synchronizes the resolved light/dark mode to `<html data-color-mode>` so portals inherit Brand and `--hub-*` tokens. Do not add a fixed light theme to an overlay.
Copy file name to clipboardExpand all lines: hub/docs/architecture.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@ Domain operations receive only the transaction-scoped repositories they need. A
36
36
37
37
The [authentication and session flow](authentication.md) uses this foundation to validate explicit GitHub and [Microsoft Entra OIDC](entra-oidc.md) configuration, complete provider user authentication, resolve the immutable external identity, apply current provider-owned assignment evidence, decide current Hub admission, and issue an opaque browser session. An installation may configure either or both providers, and provider network work remains outside identity transactions.
38
38
39
-
The administrator-management API and retained frontend list and search existing Hub users, designate one to 50 administrators, and revoke one administrator-managed assignment. Sensitive role changes reuse the current session's GitHubor Entra authorization flow and bind one short-lived, one-use continuation to the live session, external identity, operation, and target memberships. The callback and mutation reread current authority before changing roles. This surface does not invite users or manage general membership lifecycle.
39
+
The administrator-management API and retained frontend list and search existing Hub users, designate one to 50 administrators, and revoke one administrator-managed assignment. Sensitive role changes reuse the current session's GitHub, Entra, or local authorization flow and bind one short-lived, one-use continuation to the live session, external identity, operation, and target memberships. The callback and mutation reread current authority before changing roles. This surface does not invite users or manage general membership lifecycle.
40
40
41
41
The administrator security-audit API and retained frontend list Hub-wide identity and administrator records newest first through bounded opaque-cursor pagination. The API rereads the live administrator session and projects stored records through action-specific presentation allowlists. The frontend keeps the cursor opaque, shows stable membership UUIDs when available, and does not load provisional product workspace contracts. Repository audit, export, retention changes, and deletion remain separate work.
Copy file name to clipboardExpand all lines: hub/docs/authentication.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -90,6 +90,12 @@ Administrator-enrollment rate limits write at most one durable denial audit for
90
90
91
91
Database guards cover invariants that application validation alone cannot protect across concurrent writers or future code paths. They keep membership ownership and history immutable, keep assignment ownership, provenance, and role immutable, allow only one active administrator-managed assignment per membership, prevent reactivation of revoked administrator-managed assignments, require an assignment identity to belong to the membership user, keep external evidence ordering state immutable and monotonic, permit only first session termination, protect the global revocation identity and exact revision increment, and keep an authorization attempt's server-selected purpose, bootstrap-secret generation, nonce, and revocation generation immutable. Ordinary value-shape and time-order checks remain in the application contracts.
92
92
93
+
## Local developer sign-in
94
+
95
+
Run `npm run dev:api` to test Hub on your own machine without registering a GitHub or Entra application. This command enables `HUB_LOCAL_SIGN_IN` and adds a `local` provider with the same start, callback, admission, session, sign-out, rate-limit, and audit behavior as the hosted providers. Its start redirects straight back to `/api/auth/local/callback` instead of an outside sign-in page. The callback always proves one fixed `local-developer` identity with provider-assigned administrator access, so the first sign-in creates an active administrator membership without bootstrap enrollment. Administrator management re-authorizes through the same local flow. Use `npm run dev:api:live` to disable local sign-in and test configured GitHub or Entra providers.
96
+
97
+
Because anyone who can reach the API could sign in this way, startup requires `NODE_ENV=development` and a local development `DATABASE_URL`. It also requires `HOST` to be `127.0.0.1`, `::1`, or `localhost` and `HUB_APPLICATION_ORIGIN` to be a loopback origin. It cannot be combined with GitHub or Entra. Startup chooses the local provider revision itself: it keeps the current revision for an unchanged restart and moves to the next revision after the mode was turned off or the origin changed. When the origin, encryption key, or bootstrap secret is unset, startup uses `http://127.0.0.1:5173` and throwaway secrets. Restarting with a throwaway key only invalidates sign-ins that were in progress.
98
+
93
99
## Safety boundaries
94
100
95
101
GitHub and Entra configuration are explicit and independently revisioned. Only the public github.com endpoints and the exact configured single-tenant Entra issuer are accepted. Provider requests have fixed deadlines, reject redirects, and discard provider tokens and client assertions after validation.
0 commit comments