source: TI12-security/trunk/NDGSecurity/python/ndg_security_server/ndg/security/server/wsgi/authz/result_handler/__init__.py @ 6284

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/NDGSecurity/python/ndg_security_server/ndg/security/server/wsgi/authz/result_handler/__init__.py@6284
Revision 6284, 2.5 KB checked in by pjkersha, 10 years ago (diff)

Preparing 1.4 release.

Line 
1"""WSGI Policy Enforcement Point basic result handler package - contains modules
2with different result handler implementations.
3
4Functionality in this module moved from original authz package location
5
6NERC DataGrid Project
7"""
8__author__ = "P J Kershaw"
9__date__ = "05/01/10"
10__copyright__ = "(C) 2010 Science and Technology Facilities Council"
11__contact__ = "Philip.Kershaw@stfc.ac.uk"
12__revision__ = "$Id: $"
13__license__ = "BSD - see LICENSE file in top-level directory"
14from ndg.security.server.wsgi.session import (SessionMiddlewareBase, 
15    SessionHandlerMiddlewareError, SessionHandlerMiddlewareConfigError)
16
17class PEPResultHandlerMiddlewareError(SessionHandlerMiddlewareError):
18    """Base exception for PEP Result Handler Middleware implementations"""
19           
20           
21class PEPResultHandlerMiddlewareConfigError(SessionHandlerMiddlewareConfigError):
22    """Configuration errors from PEP Result Handler Middleware implementations
23    """
24   
25   
26class PEPResultHandlerMiddlewareBase(SessionMiddlewareBase):
27    """Abstract Base class for Policy Enforcement Point result handler
28    specialisations
29   
30    This class can be overridden to define custom behaviour for the access
31    denied response e.g. include an interface to enable users to register for
32    the dataset from which they have been denied access.  See
33    AuthorizationMiddlewareBase pepResultHandler keyword.
34   
35    Implementations of this class will be invoked if access is denied to a given
36    resource.  An instance is incorporated into the call stack by passing it in
37    to a MultiHandler instance. 
38   
39    The MultiHandler is configured in the AuthorizationMiddlewareBase
40    class - see ndg.security.server.wsgi.authz.  The MultiHandler is passed a
41    checker method which determines whether to allow access, or call this
42    interface.   The checker is implemented in the PEPFilter.  See
43    ndg.security.server.wsgi.authz
44   
45    This class includes user session key and isAuthenticated property inherited
46    from SessionMiddlewareBase
47    """
48   
49    @SessionMiddlewareBase.initCall
50    def __call__(self, environ, start_response):
51        """Set access denied response in derived class
52       
53        @type environ: dict
54        @param environ: WSGI environment variables dictionary
55        @type start_response: function
56        @param start_response: standard WSGI start response function
57        @rtype: iterable
58        @return: response
59        """ 
60        raise NotImplementedError()
Note: See TracBrowser for help on using the repository browser.