Skip to content

feat(hub): add local developer sign-in - #229

Merged
nshki merged 2 commits into
build/hub/newfrom
nshki/feat/hub/local-sign-in
Nov 12, 2026
Merged

nshki merged 2 commits into
build/hub/newfrom
nshki/feat/hub/local-sign-in

Conversation

@nshki

@nshki nshki commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

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: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

Hub/Pages/Home / Local Developer — dark — 1440 × 1100

Hub/Pages/Home / Local Developer, dark, 1440 by 1100

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

Hub/Pages/Home / Local Developer, light system preference, 1440 by 1100

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 494096eb-fdb5-4c27-b5da-8d4dc060b19d
@nshki
nshki requested a review from a team as a code owner November 12, 2026 19:01
Copilot AI adaptive review requested due to automatic review settings November 12, 2026 19:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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)

Comment thread hub/docs/development.md Resolved
Comment thread hub/server/index.ts Resolved
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 494096eb-fdb5-4c27-b5da-8d4dc060b19d
@nshki
nshki merged commit d80dc1a into build/hub/new Nov 12, 2026
32 checks passed
@nshki
nshki deleted the nshki/feat/hub/local-sign-in branch November 12, 2026 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants