1
1
mirror of https://github.com/go-gitea/gitea.git synced 2026-03-19 21:05:10 +01:00
gitea/routers/private
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
..
tests/repos Fix verifyCommits error when push a new branch (#26664) 2023-08-30 02:27:53 +00:00
actions.go Clean up log messages (#30313) 2024-04-07 19:17:06 +08:00
default_branch.go Clarify path param naming (#32969) 2024-12-24 13:47:45 +00:00
hook_post_receive_test.go Remove incorrect "db.DefaultContext" usages (#35366) 2025-08-28 03:52:43 +00:00
hook_post_receive.go Delete non-exist branch should return 404 (#36694) 2026-03-02 11:08:16 -08:00
hook_pre_receive.go Fix bug when pushing mirror with wiki (#36795) 2026-03-02 20:58:07 +00:00
hook_proc_receive.go User facing messages for AGit errors (#33012) 2025-01-27 02:33:39 +00:00
hook_verification_test.go Upgrade gopls to v0.19.0, add make fix (#34772) 2025-06-18 19:30:40 +00:00
hook_verification.go Use merge tree to detect conflicts when possible (#36400) 2026-01-27 11:57:20 -08:00
internal_repo.go [Feature] Private README.md for organization (#32872) 2024-12-31 04:22:09 +00:00
internal.go Refactor auth middleware (#36848) 2026-03-08 17:59:46 +08:00
key.go Refactor legacy code (#35708) 2025-10-20 11:43:08 -07:00
mail.go Split mail sender sub package from mailer service package (#32618) 2024-11-30 01:15:41 +00:00
main_test.go make writing main test easier (#27270) 2023-09-28 01:38:53 +00:00
manager_process.go Move context from modules to services (#29440) 2024-02-27 08:12:22 +01:00
manager_unix.go Move context from modules to services (#29440) 2024-02-27 08:12:22 +01:00
manager_windows.go Move context from modules to services (#29440) 2024-02-27 08:12:22 +01:00
manager.go Refactor template render (#36438) 2026-01-24 05:11:49 +00:00
restore_repo.go Move context from modules to services (#29440) 2024-02-27 08:12:22 +01:00
serv.go Fix the bug when ssh clone with redirect user or repository (#36039) 2025-12-04 19:17:49 +00:00
ssh_log.go Move context from modules to services (#29440) 2024-02-27 08:12:22 +01:00