1
1
mirror of https://github.com/go-gitea/gitea.git synced 2026-03-10 20:38:24 +01:00
gitea/services/auth
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
..
source Implements OIDC RP-Initiated Logout (#36724) 2026-03-01 06:28:26 +00:00
auth_token_test.go Remove incorrect "db.DefaultContext" usages (#35366) 2025-08-28 03:52:43 +00:00
auth_token.go Enable nilnil linter for new code (#36591) 2026-02-16 09:57:18 +00:00
auth.go Refactor auth middleware (#36848) 2026-03-08 17:59:46 +08:00
basic.go Refactor auth middleware (#36848) 2026-03-08 17:59:46 +08:00
group.go Remove Named interface (#26913) 2023-09-05 15:58:30 +00:00
httpsign.go Enable nilnil linter for new code (#36591) 2026-02-16 09:57:18 +00:00
interface.go Fix error logs and improve some comments/messages (#35105) 2025-07-17 19:09:54 +08:00
main_test.go Enhanced auth token / remember me (#27606) 2023-10-14 00:56:41 +00:00
oauth2_test.go Refactor ActionsTaskID (#36503) 2026-01-31 22:01:08 -08:00
oauth2.go Refactor auth middleware (#36848) 2026-03-08 17:59:46 +08:00
reverseproxy.go Refactor auth middleware (#36848) 2026-03-08 17:59:46 +08:00
session.go Enable nilnil linter for new code (#36591) 2026-02-16 09:57:18 +00:00
signin.go remove util.OptionalBool and related functions (#29513) 2024-03-02 16:42:31 +01:00
source.go Final round of db.DefaultContext refactor (#27587) 2023-10-14 08:37:24 +00:00
sspi.go Refactor auth middleware (#36848) 2026-03-08 17:59:46 +08:00
sspiauth_posix.go Make SSPI auth mockable (#27036) 2023-09-17 23:32:56 +00:00
sspiauth_windows.go Make SSPI auth mockable (#27036) 2023-09-17 23:32:56 +00:00
sync.go Use db.Find instead of writing methods for every object (#28084) 2023-11-24 03:49:41 +00:00