-
Notifications
You must be signed in to change notification settings - Fork 86
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
Log user from basic authentication requests #19
base: master
Are you sure you want to change the base?
Conversation
Just a few remarks:
|
|
I'm not sure we want to add this overhead to every request, no. If you're going to make every thread pay a tax here, at least make it a cheaper tax -- add a field If you do it that way, logging the user name is a Maybe decons (and other authentication methods can reuse the field) instead of a HashMap lookup that usually fails + a bunch of http-basic-auth-specific string twiddling we probably did once already. |
This reverts commit a522c4c.
…Enumerator.Internal)
@gregorycollins I could add the More problematic is that at least It would a lot easier to put a user field in the |
@carlssonia I'd have no problem with changing the way anything is logged inside snap-server, logging is something we haven't spent a lot of time on in here. Space behaviour is not an issue here, Request objects are relatively small (and we don't hold on to the request body itself in there, of course). After reading your message, I actually agree that it might be easier to put a user field in the Response, but I'm not sure it makes semantic sense to do this. We probably want to do some thinking about this before moving in any particular direction; until it feels like we have the right design, I'm not sure that we should move forward. |
@gregorycollins - Sorry for letting this sit for this long unattended! Any chance that a patch with a user field in Response would be acceptable? I would love to get something working here since it's difficult to replicate the logging function outside Snap.Internal.Http.Server. This is because stuff like response content length is only available there. Another approach could be to add a Response field that is a custom logging function, say with the signature of System.Fastlogger.combinedLogEntry. If Snap.Internal.Http.Server.logA' abstracted out its use of combinedLogEntry and used the one in the response (which would default to combinedLogEntry), client code could add arbitrary information to the access log, so it would be more generally useful. Would you prefer this more general approach? |
depends on my pull request to snap-core.