Repository navigation
feat(hub): add local developer sign-in - #229
Merged
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 494096eb-fdb5-4c27-b5da-8d4dc060b19d
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The documentation omits that re-enabling GitHub or Entra after local mode requires increasing each provider's revision by exactly one, leaving contributors without guidance to avoid a startup failure.
4 open issues
What changed in this PR
Adds local developer sign-in so contributors can try Hub’s authenticated pages and administrator tools without configuring GitHub or Entra.
Changes:
- Makes local sign-in the default development mode, with local database and loopback safeguards.
- Connects the local provider to existing authentication, administrator authorization, and frontend flows.
- Simplifies sample-data seeding and documents local versus live-provider setup.
| File | Description |
|---|---|
hub/server/utils/is-local-development-database/index.ts |
Centralizes local database checks. |
hub/server/utils/is-local-development-database/index.test.ts |
Covers allowed and rejected database targets. |
hub/server/scripts/start-local-api/index.ts |
Enables local sign-in before startup. |
hub/server/scripts/start-local-api/index.test.ts |
Checks local-mode startup settings. |
hub/server/scripts/start-live-api/index.ts |
Requires provider settings and disables local sign-in. |
hub/server/scripts/start-live-api/index.test.ts |
Covers live-mode startup requirements. |
hub/server/scripts/seed-prototype-index/index.ts |
Finds the local developer automatically. |
hub/server/routes/index.ts |
Registers local authentication routes. |
hub/server/routes/api/auth/types.ts |
Adds local-provider dependency types. |
hub/server/routes/api/auth/providers/get/index.ts |
Supports local-provider discovery. |
hub/server/routes/api/auth/create-authentication-route-dependencies/index.ts |
Composes local authentication dependencies. |
hub/server/routes/api/administrators/authorizations/start/rate-limit/index.ts |
Applies authorization limits to local sessions. |
hub/server/routes/api/administrators/authorizations/start/post/index.ts |
Starts administrator authorization through local sign-in. |
hub/server/repositories/authentication-providers/find-latest-authentication-provider-revision/types.ts |
Defines the revision lookup dependency. |
hub/server/repositories/authentication-providers/find-latest-authentication-provider-revision/index.ts |
Reads the latest stored provider revision. |
hub/server/index.ts |
Resolves and validates local authentication settings. |
hub/server/index.test.ts |
Covers startup rejection of shared databases. |
hub/server/domains/authentication/resolve-local-sign-in-environment/index.ts |
Enforces local boundaries and supplies defaults. |
hub/server/domains/authentication/resolve-local-sign-in-environment/index.test.ts |
Covers safeguards and generated settings. |
hub/server/domains/authentication/read-authentication-configuration-state/index.ts |
Recognizes local sign-in configuration. |
hub/server/domains/authentication/errors.ts |
Adds a local configuration error type. |
hub/server/domains/authentication/create-local-user-authentication-adapter/index.ts |
Authenticates one fixed local administrator. |
hub/server/domains/authentication/create-local-user-authentication-adapter/constants.ts |
Defines the stable local identity. |
hub/server/domains/authentication/create-local-authentication-context/index.ts |
Builds the context and selects revisions. |
hub/server/domains/authentication/create-local-authentication-context/index.test.ts |
Covers revision reuse and advancement. |
hub/server/domains/admission/authentication-flow.db.test.ts |
Covers local admission and provider reactivation. |
hub/package.json |
Separates local and live development commands. |
hub/docs/frontend.md |
Explains frontend use of both modes. |
hub/docs/development.md |
Documents startup choices and sample seeding. |
hub/docs/authentication.md |
Describes local authentication and safety boundaries. |
hub/docs/architecture.md |
Includes local administrator authorization. |
hub/client/pages/home-index-page/types.ts |
Adds the local sign-in action type. |
hub/client/pages/home-index-page/stories.tsx |
Adds the local developer story. |
hub/client/pages/home-index-page/index.tsx |
Displays a local-account sign-in icon. |
hub/client/application/hub/view-models/administrator-provider-label/index.ts |
Labels local developer accounts. |
hub/client/application/hub-application/index.tsx |
Discovers local sign-in and excludes enrollment. |
hub/client/application/hub-application/index.test.tsx |
Covers local sign-in and enrollment filtering. |
hub/AGENTS.md |
Explains which development mode to use. |
hub/.env.example |
Documents direct-start local sign-in settings. |
Review effort: Max (auto)
weastler
approved these changes
Nov 12, 2026
alliscode
approved these changes
Nov 12, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 494096eb-fdb5-4c27-b5da-8d4dc060b19d
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Why
People working on Hub need a quick way to try authenticated pages without registering a GitHub or Entra application first.
What changes
npm run dev:apistarts 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:livedisables local sign-in and requires GitHub or Entra settings. After signing in locally,npm run db:seed:indexcan populate the sample repository without a user ID. Real GitHub or Entra sign-in was not exercised because provider credentials were unavailable.Storybook screenshots
Hub/Pages/Home / Local Developer — dark — 1440 × 1100
Hub/Pages/Home / Local Developer — light (system preference) — 1440 × 1100