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
net/http/fcgi: REMOTE_USER not exposed #16546
Comments
For something as specific as this, I'd rather add something to |
Any news about this? We use Apache2/FCGI with Kerberos authentication to our Active Directory, and this missing REMOTE_USER is preventing to use Golang in this case. |
No news. Are you interested in adding this? I'm not sure whether you're already familiar enough with Go to add this support. If so, it's all yours. Otherwise, I'm happy to review a change from anybody. (As long as the change doesn't expand the |
The mechanics here don't seem super complicated. Rather the most contentious aspect is probably the API. Here's a first crack at something that would be added to
Some of the documentation is redundant, but I include it here to illustrate the intention of code that I've left out.
(I'd like to work on this issue.) |
Thank you for your effort. Could you post anywhere a working version of the code, so we can test it? |
For additional motivation: an SO post shows that a resolution to this exact problem has been in demand since 2015. |
CL https://golang.org/cl/40012 mentions this issue. |
The current interface can't access all environment variables directly or via cgi.RequestFromMap, which only reads variables on its "white list" to be set on the http.Request it returns. If an fcgi variable is not on the "white list" - e.g. REMOTE_USER - the old code has no access to its value. This passes variables in the Request context that aren't used to add data to the Request itself and adds a method that parses those env vars from the Request's context. Fixes golang#16546 Change-Id: Ibf933a768b677ece1bb93d7bf99a14cef36ec671 Reviewed-on: https://go-review.googlesource.com/40012 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
http.Request
is used to represent the incoming request state fornet/cgi
andnet/fcgi
.net/fcgi
useshttp.RequestFromMap
to construct theRequest
to pass to the handler.RequestFromMap
does nothing with the REMOTE_USER parameter, which contains the authentication information from the web server. In thenet/cgi
case, that's fine because the user can just access the environment variable directly, but innet/fcgi
, the underlying params map is not exposed to the user.Either the underlying params should be exposed somehow, or a RemoteUser needs to be added to the
Request
struct and filled in from params./cc @bradfitz
The text was updated successfully, but these errors were encountered: