mirror of
https://github.com/BaaRai/ARTEX.git
synced 2026-12-03 13:11:05 +00:00
Every /api route is now added with s.handle(mux, pattern, perm, h), which records the permission the route needs. There are two permissions for now: perm.Public for the routes requireAuth already exempts (/api/auth/*, /api/health, /api/ready) and perm.Authenticated for all others. A new check runs after requireAuth and answers 403 when the matched pattern has no recorded permission, so a route added with a plain HandleFunc call is denied instead of served. requireAuth itself is unchanged. Tests check that every route has a permission, that the public routes are exactly the ones requireAuth exempts, that no file registers a route outside s.handle, and that an untagged route returns 403. |
||
|---|---|---|
| .. | ||
| perm.go | ||