bench-forgejo/services
Hasnain Lakhani 64c3d55de7
Add support for authentication based on reverse proxy email (#19949)
This is useful in scenarios where the reverse proxy may have knowledge
of user emails, but does not know about usernames set on gitea,
as in the feature request in #19948.

I tested this by setting up a fresh gitea install with one user `mhl`
and email `m.hasnain.lakhani@gmail.com`. I then created a private repo,
and configured gitea to allow reverse proxy authentication.

Via curl I confirmed that these two requests now work and return 200s:

curl http://localhost:3000/mhl/private -I --header "X-Webauth-User: mhl"
curl http://localhost:3000/mhl/private -I --header "X-Webauth-Email: m.hasnain.lakhani@gmail.com"

Before this commit, the second request did not work.

I also verified that if I provide an invalid email or user,
a 404 is correctly returned as before

Closes #19948

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
2022-09-28 02:00:15 +02:00
..
agit Add more linters to improve code readability (#19989) 2022-06-20 12:02:49 +02:00
asymkey Refactor AssertExistsAndLoadBean to use generics (#20797) 2022-08-16 10:22:25 +08:00
attachment Refactor AssertExistsAndLoadBean to use generics (#20797) 2022-08-16 10:22:25 +08:00
auth Add support for authentication based on reverse proxy email (#19949) 2022-09-28 02:00:15 +02:00
automerge Add more linters to improve code readability (#19989) 2022-06-20 12:02:49 +02:00
comments Move issues related files into models/issues (#19931) 2022-06-13 17:37:59 +08:00
context Move almost all functions' parameter db.Engine to context.Context (#19748) 2022-05-20 22:08:52 +08:00
cron Move some files into models' sub packages (#20262) 2022-08-25 10:31:57 +08:00
externalaccount Refactor auth package (#17962) 2022-01-02 21:12:35 +08:00
forms Limit length of repo description and repo url input fields (#21119) 2022-09-16 15:19:16 +08:00
gitdiff Upgrade chroma to v2.3.0 (#21259) 2022-09-26 13:50:03 +08:00
issue Allow poster to choose reviewers (#21084) 2022-09-09 18:27:47 +01:00
lfs Move some code into models/git (#19879) 2022-06-12 23:51:54 +08:00
mailer Share HTML template renderers and create a watcher framework (#20218) 2022-08-28 10:43:25 +01:00
migrations Move go-licenses to generate and separate generate into a frontend and backend component (#21061) 2022-09-05 14:04:18 +08:00
mirror Add new API endpoints for push mirrors management (#19841) 2022-07-30 18:45:59 +02:00
org Move some files into models' sub packages (#20262) 2022-08-25 10:31:57 +08:00
packages Replace ServeStream with ServeContent (#20903) 2022-08-25 12:05:21 -04:00
pull Prevent 500 is head repo does not have PullRequest unit in IsUserAllowedToUpdate (#20839) 2022-08-18 13:31:15 +03:00
release Add more checks in migration code (#21011) 2022-09-04 13:47:56 +03:00
repository fix hard-coded timeout and error panic in API archive download endpoint (#20925) 2022-08-29 11:45:20 +02:00
task Move some files into models' sub packages (#20262) 2022-08-25 10:31:57 +08:00
user Refactor AssertExistsAndLoadBean to use generics (#20797) 2022-08-16 10:22:25 +08:00
webhook Webhook for Wiki changes (#20219) 2022-09-04 20:54:23 +01:00
wiki Webhook for Wiki changes (#20219) 2022-09-04 20:54:23 +01:00