Tests: Cloudflare Access sign-in, the sign-in rate limit and account settings #399
Reference in New Issue
Block a user
Delete Branch "%!s()"
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?
access.rs is at 68% of its lines, and the browser suite never reaches it (0%):
fetchandprefetch, which get the team's signing keys, and the parts ofverifythat check a real token, are untested. In web.rs,vouched_nameand parts ofauth,too_many(the sign-in flood answer) andpatch_me(blocked words, the TypeSafe key) are untested; in cli.rs,user_cmd(45 lines: add, passwd, rm, list). This is who gets in.Tests to add:
too_many) and a right one after the wait still works (the load test's signin covers volume, not this)ipx user add|passwd|rm|listagainst a scratch databaseSeen with the coverage of both suites merged line by line (cargo:
sh scripts/coverage.sh, browser:sh scripts/coverage.sh api; reports in target/coverage/cargo, api and page; #390, #394), as of 2026-11-07. A test added here shows in Grafana's Coverage row at the next run.Tests added in
3bb59c2. web.rs runs the router with a peer address: the proxy's header is believed only from the trusted proxy; with Access set the name is the signed token's, and another app's token, an expired one, garbage, no token, no header, or a good token not via Caddy are each refused; wrong passwords and unknown names are 401 and the right one afterwards signs in with a session cookie; PATCH /api/me refuses an over-long block list and a malformed TypeSafe key before asking TypeSafe. access.rs reads the keys from a local stand-in for the team's certs (a 503 and a 404 are errors); the refetch of an unseen key id was already tested. cli.rs: ipx user add, list, passwd (which signs every browser out), rename and rm against a scratch database. Not done: the 429 for a flood of wrong passwords, which does not exist (#409), and a TypeSafe key TypeSafe refuses, which needs IPX_TYPESAFE_URL set process-wide and is left to #398's stand-in.