Repository navigation
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
@V3RON would love your thoughts |
|
Thanks for this. The gap is real: a proxy that lets the unsigned console page through (oauth2-proxy with skip-auth routes, for example) leaves a person with only the token form. The console side of this PR (the scheme check, the same-tab link, keeping the token form) looks good. Where the URL comes from and where it goes needs to change, though. Here are the problems, then the design we'd like. Problems with the current approach
Proposed designIn short: the proxy strategy owns 1. Auth: the strategy offers the URL, the core passes it on
export interface AuthStrategy {
authenticate(request: AuthRequest): Promise<StrategyAnswer>;
/** Where a person starts this strategy's sign-in, when it has one. */
readonly signInUrl?: string;
}
export interface Auth {
// ...existing
readonly signInUrl?: string;
}
const signInUrl = strategies.find((s) => s.signInUrl !== undefined)?.signInUrl;2. HTTP: only the identity route adds it
export function requireAuth(
auth: Pick<Auth, "authenticateRequest">,
options: { readonly signInUrl?: string } = {},
): MiddlewareHandler<AuthEnv>
const agentAuth = requireAuth(deps.auth);
const identityAuth = requireAuth(deps.auth, { signInUrl: deps.auth.signInUrl });
// ...
app.openapi({ ...identityRoute, middleware: [identityAuth] }, ...)
3. Console: your code, plus two additions
4. Contract, protocol, ADR, docs
5. Tests
Happy to answer questions on any of this. Written by an agent. |
|
Review of head Better solutionThe problem. Some proxies (oauth2-proxy with skip-auth routes, for example) let the unsigned console page and Is the approach right? The console half is right: an operator-set URL, a scheme check, a same-tab link and the token form kept. Nothing simpler exists in Simlock today. The console cannot guess a proxy's login route, so a config key is needed. The daemon half puts the URL in the wrong place. I agree with the design in the comment above:
One change to that design: leave Side effects
ReviewBlind pre-merge review (code and claims lenses; no spec lens, because the PR closes no issue), round 1 at Blocking
Checked and fine: the Next: after the rebase and the redesign above, a second review round covers the new code. Written by an agent. |
6905940 to
5141bab
Compare
Review ledgerRound 1: 171bb28 {"findings":[{"id":"R1","role":"code","class":"testing 2","outcome":"fixed","fix":"925bd78ebc16d4794308101750e34cf30433a359","path":"src/core/config-auth-and-proxy.test.ts","round":"1"}]}Written by an agent. |
## Summary Rewrites the website docs as task pages and concept pages, 63 pages in all: - **Task page:** one task: a `Result:` line, *Before you start*, steps that end in a `Check:` line, and a *When it fails* table. - **Concept page:** what a feature is and how it behaves, with no steps. Getting started has one install page per OS (macOS, Linux, Windows preview). New sections: Concepts and Troubleshooting. New reference pages: MCP tools, Node client and Web console. Each fact lives on one page; other pages link to it. Also: - Removed URLs redirect to their new pages. - The docs links in the CLI, the console, the manuals and `README.md` point at the new pages. - The sidebar sections in `website/src/site/pages.ts` name the new folders. - SSO sign-in (#1632) and the gateway catalog wait (#1788) are documented. - Docs the code contradicted are fixed. ## Validation - [x] `pnpm --dir website build`: 140 pages, no broken internal links - [x] `node website/scripts/check-openapi.mjs` - [x] `pnpm test:changed` (3610 passed) - [x] `pnpm typecheck` - [ ] Walk each install page on a clean machine ## Review Spec review: skipped. Code review: 0 blocking, 0 fixed, 0 notes. Claims review: 2 blocking, 2 fixed, 0 notes. Assessment: complete Rounds: 2. Tokens: 18.8M. - claims: Ctrl-C on a waiting `simlock lease` cancels the request (`concepts/queue-and-capacity`), fixed in 4a580f9. - claims: a phone is not erased after a lease; only apps added since enrolment are removed (`using-devices/keep-a-device`), fixed in 4a580f9. *Written by an agent.*
Summary
Add optional
http.proxyAuth.signInUrlso worker and gateway consoles can open a fixed proxy-login URL in the same tab. Keep the token form and refusal reason visible, and show the link on the ended-session screen.The strategy owns the URL. Only
GET /v1/identityadds it to a 401; other routes and 403 bodies stay unchanged. OpenAPI and ADRs document that scope. A{path}in the URL becomes the page the person was on. Protocol bounds move together from 101 to 102.Validation
Head:
925bd78eb.171bb2847:pnpm test:changed7,450 passed, two skipped;pnpm typecheckclean.925bd78ebadds two test rows only.{path}: config accepts a template and refuses one that is no longer http/https after substitution, includinghttps://{path}/start, which parses as written (src/core/config-auth-and-proxy.test.ts); the console replaces{path}with the encoded path and search and drops that same template (ui/src/model/sign-in-url.test.ts,ui/src/app/sign-in.dom.test.tsx). Mutation probes: checking the URL as written, in the schema or insignInHref, fails a test.ui/src/app/proxy-sign-in.dom.test.tsx); deleting thesignInUrlspread inui/src/data/session.tsfails it.925bd78eb: running.Review
Spec review: skipped. Code review: 1 blocking, 1 fixed, 0 notes. Claims review: 0 blocking, 0 fixed, 0 notes.
Rounds: 1. Tokens: 1.8M.
Runs: 9. Cost USD: 4.2324. Agent seconds: 2032.
Assessment: complete
Workflow
Merge risk
Merge risk: medium
Alignment: good ✅ — Matches the maintainer's revised design.
Impact: medium 👀 — Touches auth metadata; permissions stay unchanged.
Verification: good ✅ — Unit, browser, real-proxy and mutation checks pass.
Rollback cost: medium 👀 — Protocol 102 requires coordinated gateway/worker upgrades or rollback.
Error detection: decent 👀 — CI covers response shapes and console sign-in.
Status
Implement: done (
{path}+ R1 test) Review: round 1 + fix-check passed at 925bd78, 0 open Hardware: n/a Gate: not runNext: maintainer marks ready and merges once CI is green
Written by an agent.