Layer's browser takes wildcards in the sites agents may use and in saved sign-ins #65
Loading…
Reference in a new issue
No description provided.
Delete branch "michael/github-pr-11"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
From https://github.com/code-villain-hq/vault/pull/11 by @frazer84.
What changes
browser_request_site): a site can hold a*, which stands for any run of letters, digits and dashes within one name, e.g.pr-*.example.com. It allowspr-12.example.comand its subdomains, as a site already covers its subdomains. A leading*.behaves as before: it is dropped, sinceexample.comalready covers*.example.com.*.staging.example.comorpr-*.example.com, and is filled on every host it stands for. Sign-ins still treat subdomains as other sites, so a*covers exactly one name:*.staging.example.comis notstaging.example.com, nora.b.staging.example.com. Port rules are unchanged.*may only stand in front of the domain.*,*.com,example.*,ex*.comanda.*.comare refused as sites. Under.localhostanything goes, since it is all this machine.browser_request_sitedescription say so. BRW-3 and BRW-18 indocs/features.mdare updated.Why
Preview and per-branch environments (
pr-123.dev.example.com,feature-x.staging.example.com) each have their own host. You had to allow every new one, which subdomain coverage only fixes when they share a parent, and save its test account again for each host, since a sign-in is tied to one host. A wildcard does both once.The guard on where
*may go is what keeps BRW-3 and BRW-19 meaningful. A wildcard that could stand in the domain (example.*) would let an agent browse, or have a test password filled on, a domain somebody else owns. With the domain written out, a wildcard only reaches hosts under a domain the user named. Password filling keeps its other rules: only into a password field, and never over plainhttpoff this machine.How it was checked
From
code/apps/layer:bun run check: every step passes up tocargo test (server), including guard,vp check, build,cargo fmt,cargo clippy -D warnings, andcargo test (app)(986 passed).cargo test (server)fails on its 12 Postgres-backed tests withfailed to connect to setup test database: PoolTimedOut, because this Mac has no local Postgres. They fail the same way onmain.bun testin web and both kits, and the web build.sites.rs: wildcard matching within one name, subdomains of a wildcard site, lookalikes (evil-pr-1.example.com,pr-1.example.com.evil.test), and refused broad patterns.sign_in.rs: wildcard sites with and without a port, one name only, and*.localhoston any port.🤖 Generated with Claude Code
https://claude.ai/code/session_01P8G9Kc8iSELqvWGnZtW2wm