-
-
Notifications
You must be signed in to change notification settings - Fork 410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow whitelist to take a username mapping. #94
base: master
Are you sure you want to change the base?
Conversation
This is an interesting idea, I'm not against it but I wonder if there is a more generic fix - could you link me to the gitea docs that outline the proxy header based auth (I couldn't see this on the authentication docs page). |
There isn't much docs, unfortunately.
Full disclosure: I've been contemplating dropping Traefik because it seems very limited for my use-case. Gitea can do OAuth2 on its own, but (1) I like keeping the auth setup simple to avoid mistakes and (2) Traefik doesn't support ignoring forward-auth for only certain routes, AFAICT. |
I've thought a little more about this and I think this is a bit of a gitea quirk, however I think there is a more generic implementation that would make sense; rather than adding the map to the whitelist, perhaps we could create another config field called
|
Thanks for thinking about it. More powerful, but more verbose. That works for me. To allow multiple users, each user would use a separate
|
756ba9b
to
541c54b
Compare
Sorry about the 1.5 year delay. My code was running fine, but now I want to use the new rule configuration, and remembered. :) See the README for the syntax. To support environment variables, I chose comma as the outermost separator. |
One open question: It would be useful (in terms of verbosity) to always send |
E.g. Gitea doesn't allow at-signs in usernames. This is a simple (but verbose) way to rewrite email addresses in small installations.
Gitea is a service that can use a reverse proxy header for authentication, but doesn't allow at-signs in usernames. The reverse proxy support is part of SSO support, and is tailored to having a single domain for everyone, and the reverse proxy doing the username mapping. For enterprise domains, we could implement stripping or mangling of the domain, but in private installations where friends gather, this isn't compatible with the federating principle of OAuth2.
I'm using it for personal personal repositories, but want to allow others to be able to access it. For small sites, I think having the ability to just do a simple mapping is easier than changing each of the protected services.
I believe this is conceptually compatible with #63, with trivial merging.