Mike Orr wrote: > > But why? Why cloud up environ needlessly? A thread-local global with a > > library that any app can use up and down the chain accomplishes the > > same thing, without clouding up environ.
> Mainly to standardize the ways in which frameworks and libraries > interact. A robust generic auth library could replace an auth > middleware, but would we get into an "every library does things > differently" situation? Would different auth implementations have a > compatible API so you can switch between them? Would the auth library > be consistent with your other libraries? Why is it so bad to have the > Auth object in the WSGI enviroment; it has to be somewhere. Perhaps that was miscommunicated. When I refer to library, I merely mean that there's a module of functions that you use within your webapp. So a Identity framework package, would come with a group of functions, and a WSGI middleware app. 1) You stick the middleware in front of the application you want to use Identity with. 2) You configure the Identity middleware to point to your db, etc, and any other config it needs. 3) Inside your webapp, you import Identity.functions, or whatever its called, and use the functions This could work, because the Identity middleware sets up request-local globals for use with functions that want to use data that the Identity middleware setup when it was called. The Auth object does have to be somewhere, its just exceptionally irritating, and massive 'repeat yourself' to have to pass it all over the place within your app. That's why I use request-local module globals so that functions can get to the Auth object, without forcing the developer to hang onto an object that's needed all over the place by tons of functions. Hopefully that clarifies what I meant with 'library' vs purely middleware. Either way you have the object and functions, and the setup. The way I'm referring to means you save yourself the effort of passing the environ all over the place. Cheers, Ben --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

