source: TI12-security/trunk/NDGSecurity/python/ndg_security_common/ndg/security/common/authz/pip/__init__.py @ 6597

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/NDGSecurity/python/ndg_security_common/ndg/security/common/authz/pip/__init__.py@6597
Revision 6597, 1.8 KB checked in by pjkersha, 11 years ago (diff)

New Policy Information Point class ndg.security.common.authz.pip.esg.PIP for ESG Authorisation Service.

Line 
1"""Policy Information Point Package containing various PIP implementations. 
2The PIP is a helper to the PDP providing information to enable it to make access
3control decisions
4
5NERC DataGrid Project
6"""
7__author__ = "P J Kershaw"
8__date__ = "19/02/10"
9__copyright__ = "(C) 2009 Science and Technology Facilities Council"
10__contact__ = "Philip.Kershaw@stfc.ac.uk"
11__license__ = "BSD - see LICENSE file in top-level directory"
12__contact__ = "Philip.Kershaw@stfc.ac.uk"
13__revision__ = "$Id: __init__.py 3755 2008-04-04 09:11:44Z pjkersha $"
14from ndg.security.common.authz import _AttrDict
15
16
17class PIPAttributeQuery(_AttrDict):
18    '''Policy Information Point Query class.'''
19    namespaces = (
20        "urn:ndg:security:authz:1.0:attr:subject",
21        "urn:ndg:security:authz:1.0:attr:attributeAuthorityURI",
22    ) 
23    (SUBJECT_NS, ATTRIBUTEAUTHORITY_NS) = namespaces   
24
25
26class PIPAttributeResponse(dict):
27    '''Policy Information Point Response class.'''
28    namespaces = (
29        Subject.ROLES_NS,
30    )
31   
32
33class PIPBase(object):
34    """Policy Information Point base class.  PIP enables PDP to get user
35    attribute information in order to make access control decisions
36    """
37    __slots__ = ()
38   
39    def __init__(self, prefix='', **cfg):
40        '''Initialise settings for connection to an Attribute Authority'''
41        raise NotImplementedError(PIPBase.__init__.__doc__)
42   
43    def attributeQuery(self, attributeQuery):
44        """Query the Attribute Authority specified in the request to retrieve
45        the attributes if any corresponding to the subject
46       
47        @type attributeResponse: PIPAttributeQuery
48        @param attributeResponse:
49        @rtype: PIPAttributeResponse
50        @return: response containing the attributes retrieved from the
51        Attribute Authority"""
52        raise NotImplementedError(PIPBase.attributeQuery.__doc__)
Note: See TracBrowser for help on using the repository browser.