Re: [Web-SIG] How to make REMOTE_USER variable private across WSGI middlewares?

2017-08-11 Thread Etienne Robillard
I fixed this bug! :) My application logic was causing a redirect loop in the oauth2 authentication mecanism. Have a nice day, E Le 2017-08-10 à 06:25, Etienne Robillard a écrit : Hi, A little update on this issue. I switched to werkzeug/gevent for storing the http request in a

Re: [Web-SIG] How to make REMOTE_USER variable private across WSGI middlewares?

2017-08-10 Thread Etienne Robillard
Hi, A little update on this issue. I switched to werkzeug/gevent for storing the http request in a thread-local object. I also use a contextmanager to set the current request for a thread. However, since the value of REMOTE_USER is set from a WSGI middleware, it doesn't persist into my

Re: [Web-SIG] How to make REMOTE_USER variable private across WSGI middlewares?

2016-10-12 Thread Etienne Robillard
Hi Randy, Thanks for your comment. Le 2016-10-11 à 19:44, Randy Syring a écrit : For what it's worth, I also think you might misunderstand how WSGI works. I believe the environment object is supposed to exist in a request context. I'm assuming you only need one user per request, so

Re: [Web-SIG] How to make REMOTE_USER variable private across WSGI middlewares?

2016-10-11 Thread Etienne Robillard
Here's the source code: https://bitbucket.org/tkadm30/django-hotsauce/src/6a862e22e045cb10a84f3b08e4c237ed592ecec7/lib/notmm/controllers/wsgi.pyx A live demo is here: http://www.isotopesoftware.ca/ The problem is in the init_request method. The current implementation uses threading.local. I

Re: [Web-SIG] How to make REMOTE_USER variable private across WSGI middlewares?

2016-10-11 Thread Randy Syring
I think this is not the best mailing list to ask a question like this. You are probably better served to ask on Stack Overflow or some other place with more activity. For what it's worth, I also think you might misunderstand how WSGI works. I believe the environment object is supposed to

[Web-SIG] How to make REMOTE_USER variable private across WSGI middlewares?

2016-10-10 Thread Etienne Robillard
Hi, I'm attempting to develop a OAuth 2.0 authentication middleware which sets REMOTE_USER variable into the WSGI environ object, however I'm unable to make this variable unique for the logged user. Is it recommended to use threading.local or gevent to make the WSGI environment persisting