gitea/modules/web
wxiaoguang 3f1ef703d5
Refactor auth middleware (#36848)
Principles: let the caller decide what it needs, but not let the
framework (middleware) guess what it should do.

Then a lot of hacky code can be removed. And some FIXMEs can be fixed.

This PR introduces a new kind of middleware: "PreMiddleware", it will be
executed before all other middlewares on the same routing level, then a
route can declare its options for other middlewares.

By the way, allow the workflow badge to be accessed by Basic or OAuth2
auth.

Fixes: https://github.com/go-gitea/gitea/pull/36830
Fixes: https://github.com/go-gitea/gitea/issues/36859
2026-03-08 17:59:46 +08:00
..
middleware Instance-wide (global) info banner and maintenance mode (#36571) 2026-02-26 23:16:11 +08:00
routing Refactor auth middleware (#36848) 2026-03-08 17:59:46 +08:00
types Refactor web package and context package (#25298) 2023-06-18 09:59:09 +02:00
handler.go Refactor auth middleware (#36848) 2026-03-08 17:59:46 +08:00
routemock.go Make Golang correctly delete temp files during uploading (#36128) 2025-12-11 19:59:42 +01:00
routemock_test.go Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
router.go Refactor auth middleware (#36848) 2026-03-08 17:59:46 +08:00
router_combo.go Refactor arch route handlers (#32993) 2024-12-28 03:31:46 +00:00
router_path.go Refactor auth middleware (#36848) 2026-03-08 17:59:46 +08:00
router_test.go Refactor auth middleware (#36848) 2026-03-08 17:59:46 +08:00