Skip to content

refactor(auth): auth checks live in one module, src/auth - #732

Merged
V3RON merged 10 commits into
feature/701-adrfrom
task/712
Oct 19, 2026
Merged

V3RON merged 10 commits into
feature/701-adrfrom
task/712

Conversation

@V3RON

@V3RON V3RON commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Closes #712

Status

Implement: done (43/43 green) Review: round 2 passed Hardware: n/a Gate: waiting for the stack
Next: none; merges with the #701 stack

  • rg 'token-store|admin-secret|daemon/session' src --glob '!src/auth/**' finds no import. Checked by the audit's grep.
  • main.ts calls createAuth once (rg -c 'createAuth\(' src/daemon/main.ts prints 1). Checked by the audit.
  • pnpm lint passes with the new rule, and its src/lint-rules.test.ts case passes. Checked by the commit hooks and the test.
  • The tests above pass; pnpm test:e2e e2e/token-route.test.ts e2e/gateway-smoke.test.ts e2e/http-api.test.ts passes. Checked by the green and audit runs.
  • src/auth/AGENTS.md exists; src/http/AGENTS.md, src/daemon/AGENTS.md and docs/internal/ARCHITECTURE.md name src/auth where they named the moved files. Checked by the claims review.

Assumptions

  • Assumption: how a test hands a fake strategy to src/core/config.ts — loadConfig takes an optional authStrategies list (default: the registry), as it takes modules.
  • Assumption: a strategy reads headers as a web Headers object — case-insensitive names, no new type.
  • Assumption: TokenStore.verify returns the whole TokenRecord, since the strategy needs the label.
  • Assumption: the agent-device relay identity is { principal, name, role: "agent", via: "relay", ambient: false }.

Review

Spec review: 2 blocking, 2 fixed, 0 notes. Code review: 3 blocking, 3 fixed, 2 notes. Claims review: 5 blocking, 5 fixed, 0 notes.
Rounds: 2. Tokens: 3.9M.
Assessment: complete

Written by an agent.

@V3RON

V3RON commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

Review notes

Not blocking, not verified. Each is one reviewer's claim.

  • code: src/core/config.ts:980 the strategy schema checks the file's block before defaults merge, so a partial block is refused even when the missing field has a default; first matters in Sign in through a sign-in proxy's signed JWT #714.
  • code: src/auth/auth.test.ts:240 the contract-mirror check compares only how both schemas parse the defaults; the loop never runs today.

Written by an agent.

@V3RON
V3RON marked this pull request as ready for review October 19, 2026 14:36
@V3RON
V3RON added this pull request to stack #734 October 19, 2026 14:36
@V3RON
V3RON merged commit 09fb1a7 into main Oct 19, 2026
35 of 45 checks passed
@V3RON
V3RON deleted the task/712 branch October 19, 2026 18:16
V3RON added a commit that referenced this pull request Oct 20, 2026
### Status

Main's CI fails `src/docs-manuals.test.ts` on `src/daemon/AGENTS.md`:
after #732 moved the admin secret and the session resolver into
`src/auth`, two rows still name the deleted files, and one prose line
names a function that no longer exists.

- Drops the `admin-secret.ts` and `session.ts` rows;
`src/auth/AGENTS.md` already covers both.
- Points the "Credential resolution" line at `resolveHelloRole` in
`src/auth`.

Docs only. No code, no test change.

## Review

Spec review: skipped. Code review: skipped. Claims review: 0 blocking, 0
fixed, 0 notes.
Rounds: 1. Tokens: n/a.
Assessment: complete.

*Written by an agent.*
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.

Auth checks live in one module, src/auth

1 participant