Skip to content

Factory route layer behind T3's authentication #57

Closed

Description

@tomkaczocha

Outcome

The factory has an HTTP route layer behind T3's own authentication. Every later factory route (#27, #55) is added to it and gets T3's sign-in and scopes for free.

Acceptance criteria

  • apps/server/src/factory/t3/ exposes the factory's route layer. server.ts adds it to layerMakeRoutes in one line, and that line is listed in factory/SEAMS.
  • The layer uses T3's existing HTTP auth (the same authentication EnvironmentHttpApi gets from AuthHttp.layerAuthenticatedAuth) through the adapter. The factory does not parse tokens or cookies itself.
  • It serves one route, GET /api/factory/status, returning { state: "running" | "idle", reason?: string }. idle with a reason covers "no config" and "config failed to load".
  • The adapter offers a scope check that routes use. A request without a session gets 401. A test proves 401 without credentials, 200 with a session, and 403 for a session that lacks a scope the route requires (use a test-only route that requires AuthSettingsWriteScope).
  • Paired, relay and tunnel sessions authenticate exactly as they do for T3's own HTTP API, and there is no separate factory token.
  • Open question 1 in factory/docs/design.md is answered with what was found and moved under a "Decided" heading.

Depends on

None.

Notes

Reference

  • Design: factory/docs/design.md in this repo.
  • Upstream's AGENTS.md applies. Run only the tests and typechecks for the paths you touch (vp test run <path>, vp run --filter t3 typecheck), never the repo-wide checks.
  • Edit no upstream file that is not listed in factory/SEAMS. A new seam needs a line in factory/SEAMS and a reason in the PR body.

Activity

  1. added and removed
    factory:proposedA bot filed it; ignored until a person sets ready
    on Oct 16, 2026
  2. added and removed on Oct 16, 2026
  3. self-assigned this
    on Oct 16, 2026
  4. added and removed on Oct 16, 2026
  5. rawphp commented on Oct 16, 2026

    @rawphp

    Factory status: building

  6. added
    factory:pr-openPR is open and passed the gate
    and removed
    factory:pr-openPR is open and passed the gate
    on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions