You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
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>
2 years ago
..
agit Add more linters to improve code readability (#19989) 2 years ago
asymkey Refactor AssertExistsAndLoadBean to use generics (#20797) 2 years ago
attachment Refactor AssertExistsAndLoadBean to use generics (#20797) 2 years ago
auth Add support for authentication based on reverse proxy email (#19949) 2 years ago
automerge Add more linters to improve code readability (#19989) 2 years ago
comments Move issues related files into models/issues (#19931) 2 years ago
context Move almost all functions' parameter db.Engine to context.Context (#19748) 2 years ago
cron Move some files into models' sub packages (#20262) 2 years ago
externalaccount Refactor auth package (#17962) 3 years ago
forms Limit length of repo description and repo url input fields (#21119) 2 years ago
gitdiff Upgrade chroma to v2.3.0 (#21259) 2 years ago
issue Allow poster to choose reviewers (#21084) 2 years ago
lfs Move some code into models/git (#19879) 2 years ago
mailer Share HTML template renderers and create a watcher framework (#20218) 2 years ago
migrations Move go-licenses to generate and separate generate into a frontend and backend component (#21061) 2 years ago
mirror Add new API endpoints for push mirrors management (#19841) 2 years ago
org Move some files into models' sub packages (#20262) 2 years ago
packages Replace `ServeStream` with `ServeContent` (#20903) 2 years ago
pull Prevent 500 is head repo does not have PullRequest unit in IsUserAllowedToUpdate (#20839) 2 years ago
release Add more checks in migration code (#21011) 2 years ago
repository fix hard-coded timeout and error panic in API archive download endpoint (#20925) 2 years ago
task Move some files into models' sub packages (#20262) 2 years ago
user Refactor AssertExistsAndLoadBean to use generics (#20797) 2 years ago
webhook Webhook for Wiki changes (#20219) 2 years ago
wiki Webhook for Wiki changes (#20219) 2 years ago