I've been working on a declarative security module for WSGI applications I've named repoze.decsec , loosely modeled after the original thoughts about the topic I wrote up a few years ago.
No matter what you might think of Zope, one of the best things that it has had since "day one" is a way to declaratively protect resources in web applications. Zope respects a combination of decorators within code and assertions made through through the web interface (or programmatically) to allow folks to make statements about which portions of their web applications require what level of access to invoke. This access is very granular: essentially you protect a method or an object with a permission, then users can decide which "roles" have some number of permissions in some context. When a user makes a request to the web application, the operation is either allowed or denied depending on the permission that protects the resource he's attempting to access compared to his roles in the context of the resource.
In 1999, this was heady stuff. I had come from a Perl background, where I was writing all of my security checking code in an "imperative" way. Each one of my functions would do a security check and its own login redirection, etc. It was a tragedy. I started using Zope mainly for this feature.
But for some Python web frameworks, good declarative security is still not a built-in feature. They either provide no way make declarative security assertions, or their declarative security model is weak (e.g. in some web frameworks you can only say via code that some method "requires authentication" or is "anonymous allowed", as opposed to being able to make more granular assertions).
Decsec is a mini-framework which users of WSGI-compatible web frameworks can use to implement granular declarative security checking. Its main features are:
action (allow or deny), principal (a
principal name), and permission (a permission name).Decsec does not provide any UI, nor does it handle authentication (that's presumed to be the job of an upstream component). It also relies on the policy of its plugpoints to determine how to retrieve and manufacture permission names and principal names. As a result, it's quite general. It's functional and tested, but not documented. I may not do much more work on it until I need to write code in a framework that doesn't have a good declarative security model.
I think you mean authentication? Decsec seems to be all about authorization.
Replies to this comment