On 13/06/2006, at 17:27, Charles Duffy wrote:
> > Jorge Vargas wrote: >> I don't know why I though he wanted to implement a provider. > > The problem I have right now is that the IdentityFailure exception, > thrown when an access control check fails, always redirects to the > identity.failure_url form. I don't want to do that, necessarily: For > those controllers which will be called by programmatically generated > HTTP requests (as opposed to ones from a browser with an actual > end-user behind them), I want to return a HTTP 401 (Authentication > Required) to the client in place of a form redirection. > > That said, IdentityFailure is raised by a bunch of different Identity > code, and I'm not sure how to modify its behavior to depend on the > properties of the associated controller -- for that matter, I don't > even see a way to even get a reference to the controller from the > exception being thrown without grabbing the stack frame out of the > Python and doing some exceedingly ugly stuff. And if I *did* know how > to do that, I'd have to figure out how to make IdentityFailure act > as a > cherrypy.HTTPError rather than a cherrypy.InternalRedirect based on > the > properties of the controller being executed when the exception was > thrown. > > All of it's doable through brute force and introspection, but figuring > out a way that isn't ugly as sin (and thus which might be liable for > inclusion upstream) may be interesting. WARNING: Some self-promotion follows... Well, you might be interested in an alternative identity/ authorization library I'm using in my apps. It's based on Paste's middleware for authentication (which provides HTTP Basic and Digest auth.) and PEAK security for authorization. It's designed from ground-up to be lightweight and EXTREMELY flexible (thanks to middleware and generic functions). If you want to take a peek it's SVN is at http://svn.toscat.net/ TurboPeakSecurity. Feel free to ask any questions you might have. Alberto P.S. As soon as I have the time I plan to document it and incorporate it into TG's "projects" repository. Ahhh, time, precious time.... --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears -~----------~----~----~----~------~----~------~--~---

