Re: [Web-SIG] help with the implementation of a WSGI middleware

2008-07-10 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ian Bicking wrote: > Phillip J. Eby wrote: >> I don't object to stuffing things in the environment; I object to: >> >> 1. Putting APIs in there (the API should be regular functions or >> objects, thanks) >> 2. Wrapping middleware around an app to put

Re: [Web-SIG] help with the implementation of a WSGI middleware

2008-07-08 Thread Manlio Perillo
Phillip J. Eby ha scritto: At 11:21 PM 7/7/2008 +0200, Manlio Perillo wrote: So this is not a "bad" middleware, IMHO. True, but it's part of the application, rather than being transparent. Ok, I agree. Does this means that such non trasparent middlewares must not be inserted inside the "g

Re: [Web-SIG] help with the implementation of a WSGI middleware

2008-07-07 Thread Ian Bicking
Phillip J. Eby wrote: I don't object to stuffing things in the environment; I object to: 1. Putting APIs in there (the API should be regular functions or objects, thanks) 2. Wrapping middleware around an app to put in APIs that it's going to have to know about anyway. Well, sometimes this oc

Re: [Web-SIG] help with the implementation of a WSGI middleware

2008-07-07 Thread Phillip J. Eby
At 04:36 PM 7/7/2008 -0500, Ian Bicking wrote: Phillip J. Eby wrote: At 09:58 PM 7/7/2008 +0200, Manlio Perillo wrote: In this case the first solution is to use this middleware as a decorator, instead of a full middleware. This is the correct way to implement non-transparent middleware; i.e.,

Re: [Web-SIG] help with the implementation of a WSGI middleware

2008-07-07 Thread Phillip J. Eby
At 11:21 PM 7/7/2008 +0200, Manlio Perillo wrote: So this is not a "bad" middleware, IMHO. True, but it's part of the application, rather than being transparent. By the way, a middleware that is responsible for user authentication: http://hg.mperillo.ath.cx/wsgix/file/tip/wsgix/auth/http_midd

Re: [Web-SIG] help with the implementation of a WSGI middleware

2008-07-07 Thread Ian Bicking
Phillip J. Eby wrote: At 09:58 PM 7/7/2008 +0200, Manlio Perillo wrote: In this case the first solution is to use this middleware as a decorator, instead of a full middleware. This is the correct way to implement non-transparent middleware; i.e., so-called middleware which is in fact an appli

Re: [Web-SIG] help with the implementation of a WSGI middleware

2008-07-07 Thread Manlio Perillo
Phillip J. Eby ha scritto: At 09:58 PM 7/7/2008 +0200, Manlio Perillo wrote: In this case the first solution is to use this middleware as a decorator, instead of a full middleware. This is the correct way to implement non-transparent middleware; i.e., so-called middleware which is in fact an

Re: [Web-SIG] help with the implementation of a WSGI middleware

2008-07-07 Thread Phillip J. Eby
At 09:58 PM 7/7/2008 +0200, Manlio Perillo wrote: In this case the first solution is to use this middleware as a decorator, instead of a full middleware. This is the correct way to implement non-transparent middleware; i.e., so-called middleware which is in fact an application API. See: htt

[Web-SIG] help with the implementation of a WSGI middleware

2008-07-07 Thread Manlio Perillo
As I have informally written in previous messages, I'm writing a small WSGI framework. The framework is available here (a Mercurial repository): http://hg.mperillo.ath.cx/wsgix In wsgix I have written two middleware that I find interesting since I have learned a bit more about how to write mi