Re: dogpile.cache 0.1.0 released

2012-06-14 Thread Ravi Gidwani
Mike: Is there a document/quide/migration instructions, that one can follow to use dogpile cache in an existing pylons application ? I am currently using beaker cache regions, and will like to replace/try the dogpile region instead. My understanding it that we can configure dogpile in th

Re: Compiling Python

2012-06-14 Thread Chris McDonough
On 06/14/2012 09:24 PM, Eric Ongerth wrote: Seems unnecessarily scary to newcomers to mention compiling your own Python early in the docs, even if we know it's no big deal. Particularly when the main concern at hand (that many people's system instance of python tends to be a poor choice for their

Re: Compiling Python

2012-06-14 Thread Eric Ongerth
Seems unnecessarily scary to newcomers to mention compiling your own Python early in the docs, even if we know it's no big deal. Particularly when the main concern at hand (that many people's system instance of python tends to be a poor choice for their Pyramid development) is easily and almost tri

Re: How would I do cross domain with Pyramid and Nginx

2012-06-14 Thread Mark Huang
Thanks Michael for your response once again (here in google groups as well as stackoverflow, I really appreciate the help). With your example would I be able to "send" some preprocessed data to the real client? The real client requires some data that is processed on my end to generate the PDF.

Re: Pyramid authentication - how to check effective principals in view code

2012-06-14 Thread Daniel Holth
> > One of Pyramid's selling points is its built-in authorization. Pylons > never had that, which required me to write my own in one application or use > repoze.who/what. My own system works but is non-scalable: I punted on > multiple groups and just allowed one group per user, so we have to p

Re: Pyramid authentication - how to check effective principals in view code

2012-06-14 Thread Mike Orr
On Thu, Jun 14, 2012 at 7:17 AM, Chris McDonough wrote: > On 06/14/2012 09:55 AM, Przemyslaw Wegrzyn wrote: > >> >> Well, I know that authors are not happy with overall design, as >> explained here >> http://plope.com/pyramid_auth_**design_api_postmortem

Re: How would I do cross domain with Pyramid and Nginx

2012-06-14 Thread Gael Pasgrimaud
On 14/06/2012 18:51, Michael Merickel wrote: On Thu, Jun 14, 2012 at 11:36 AM, Mark Huang wrote: Andi, could you illustrate what your setup was on Pyramid to do this X-Accel thingy? The idea is to send a response that has the X-Accel header.. nginx sees that header in the response and sends t

Re: How would I do cross domain with Pyramid and Nginx

2012-06-14 Thread Michael Merickel
On Thu, Jun 14, 2012 at 11:36 AM, Mark Huang wrote: > Andi, could you illustrate what your setup was on Pyramid to do this X-Accel > thingy? The idea is to send a response that has the X-Accel header.. nginx sees that header in the response and sends to the real client a response without that hea

Re: How would I do cross domain with Pyramid and Nginx

2012-06-14 Thread Gael Pasgrimaud
Hi, On 14/06/2012 18:36, Mark Huang wrote: So I went to do some self study and realized that Pyramid response object did not support such a header natively. There seemed to be a package called wsgithumbs that did something like this, only thing i

Re: How would I do cross domain with Pyramid and Nginx

2012-06-14 Thread Mark Huang
So I went to do some self study and realized that Pyramid response object did not support such a header natively. There seemed to be a package called wsgithumbs that did something like this, only thing is, the documentation was rather poor. A

Re: How would I do cross domain with Pyramid and Nginx

2012-06-14 Thread Mark Huang
Hi Andi and Jonathan, Both of you guys are spot on. Yes, I want to connect the response of A to the request of B. Currently I managed to perform a rewrite+proxy pass where making a request to http://A.com/pdf/generate_document would forward the request to http://B.com/pdf/generate_document.

Re: Pyramid authentication - how to check effective principals in view code

2012-06-14 Thread Przemyslaw Wegrzyn
On 14/06/12 16:29, Chris McDonough wrote: >> spanning multiple requests. Just to avoid querying it multiple times per >> request. >> >> Or do you mean it can change in the middle of a single request? That's a >> scary idea :) > I just mean storing it for the single request, not a full-blown cache >

Re: Pyramid authentication - how to check effective principals in view code

2012-06-14 Thread Chris McDonough
On 06/14/2012 10:23 AM, Przemyslaw Wegrzyn wrote: On 14/06/12 16:17, Chris McDonough wrote: Well, I know that authors are not happy with overall design, as explained here http://plope.com/pyramid_auth_design_api_postmortem (and I have to say I agree with this post 100%), but principals idea is t

Re: Pyramid authentication - how to check effective principals in view code

2012-06-14 Thread Przemyslaw Wegrzyn
On 14/06/12 16:17, Chris McDonough wrote: >> Well, I know that authors are not happy with overall design, as >> explained here http://plope.com/pyramid_auth_design_api_postmortem (and >> I have to say I agree with this post 100%), but principals idea is there >> anyway, so why not make it more effi

Re: Pyramid authentication - how to check effective principals in view code

2012-06-14 Thread Chris McDonough
On 06/14/2012 09:55 AM, Przemyslaw Wegrzyn wrote: On 14/06/12 15:06, Daniel Holth wrote: Pyramid is better at answering the question "what permission does the user have?", which is likely what's controlling whether they can actually get to the 'edit' page. Use pyramid.security.has_permission('ed

Re: How would I do cross domain with Pyramid and Nginx

2012-06-14 Thread Andi Balke
thanks jonathan, good idea ;) i remember one thing to add to our answers. > - you can proxypass the redirect to another server, but you'd probably > want to add in some sort of authticket type header, so that you ensure > the redirects/proxies were from a server you control i think its notable th

Re: Pyramid authentication - how to check effective principals in view code

2012-06-14 Thread Przemyslaw Wegrzyn
On 14/06/12 15:06, Daniel Holth wrote: > Pyramid is better at answering the question "what permission does the > user have?", which is likely what's controlling whether they can > actually get to the 'edit' page. Use > pyramid.security.has_permission('edit', edit_page_context, request) > instead. R

Re: How would I do cross domain with Pyramid and Nginx

2012-06-14 Thread Jonathan Vanasco
i started typing this before i saw andi's repsonse. If both these domains are on the same machine... nginx has a facility to allow one request to "authorize" a second request. it's the x-accel / x-sendfile modules. http://wiki.nginx.org/X-accel if they're on different machines : - you can pr

Re: Pyramid authentication - how to check effective principals in view code

2012-06-14 Thread Daniel Holth
Pyramid is better at answering the question "what permission does the user have?", which is likely what's controlling whether they can actually get to the 'edit' page. Use pyramid.security.has_permission('edit', edit_page_context, request) instead. After evaluating the work effective_principals

Re: How would I do cross domain with Pyramid and Nginx

2012-06-14 Thread Andi
hi, you question is a little hard to understand for me. but it seems you want to connect the response of a to A request to B. using an ajax call crossdomain is easy if you own both domains. look for cors (cross origin resource sharing). there's also a great js lib (which uses that) out there

Re: Pyramid authentication - how to check effective principals in view code

2012-06-14 Thread Mark Huang
Hmmyou bring up a good point. I'd be interested in the responses stated here. On Thursday, 14 June 2012 06:47:38 UTC-5, Przemyslaw wrote: > > Hi! > > What I need is a possibility to get the list of logged-in user's > principals in my view (so I can e.g. disable 'Edit' link for users not

Pyramid authentication - how to check effective principals in view code

2012-06-14 Thread Przemyslaw Wegrzyn
Hi! What I need is a possibility to get the list of logged-in user's principals in my view (so I can e.g. disable 'Edit' link for users not allowed to edit - pretty common need, I guess). I could use pyramid.security.effective_principals(request) call, but as far as I understand this would trigge

Re: How would I do cross domain with Pyramid and Nginx

2012-06-14 Thread Mark Huang
I figured out the way to configure the nginx, so that part is done. My question still remains. Is it possible to "forward" some data cross-domain and receive soemthing back in response? I noticed the Response object has a body attribute. Is this used to pass data? Regards, Mark Huang On Th