source: TI12-security/trunk/NDG_XACML/ndg/xacml/core/context/handler.py @ 7072

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/NDG_XACML/ndg/xacml/core/context/handler.py@7072
Revision 7072, 1.4 KB checked in by pjkersha, 9 years ago (diff)

Incomplete - task 2: XACML-Security Integration

  • Major cleanup of function factories for efficiency. Only the required factories and function classes are loaded and any loaded classes are cached for future calls. All unit tests pass.
  • Property svn:keywords set to Id
Line 
1"""NDG Security Context handler definition
2
3NERC DataGrid Project
4"""
5__author__ = "P J Kershaw"
6__date__ = "24/02/10"
7__copyright__ = "(C) 2010 Science and Technology Facilities Council"
8__contact__ = "Philip.Kershaw@stfc.ac.uk"
9__license__ = "BSD - see LICENSE file in top-level directory"
10__contact__ = "Philip.Kershaw@stfc.ac.uk"
11__revision__ = "$Id$"
12from abc import ABCMeta, abstractmethod
13
14
15class PEPInterface(object):
16    """Policy Enforcement Point Interface"""
17    __metaclass__ = ABCMeta
18    __slots__ = ()
19           
20    @abstractmethod
21    def handlePEPRequest(self, pepRequest):
22        """Handle request from Policy Enforcement Point
23       
24        @param pepRequest: request from PEP, derived class determines its type
25        e.g. SAML AuthzDecisionQuery
26        @type pepRequest: type
27        @return: PEP response - derived class determines type
28        @rtype: None
29        """
30        raise NotImplementedError()
31       
32       
33class CtxHandlerInterface(PEPInterface):
34    """Context Handler interface."""
35    __metaclass__ = ABCMeta
36    __slots__ = ()
37   
38    def pipQuery(self, request, designator):
39        """Query a Policy Information Point to retrieve the attribute values
40        corresponding to the specified input designator.  Optionally, update the
41        requestCtx.  This could be a subject, environment or resource.  Matching
42        attributes values are returned
43        """
44        return []
45       
Note: See TracBrowser for help on using the repository browser.