Ignore:
Timestamp:
25/03/10 08:27:00 (10 years ago)
Author:
pjkersha
Message:

Added request subject, resource, action and environment types

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI12-security/trunk/NDG_XACML/ndg/xacml/core/pdp.py

    r6745 r6771  
    1010__contact__ = "Philip.Kershaw@stfc.ac.uk" 
    1111__revision__ = "$Id: $" 
     12from abc import ABCMeta, abstractmethod 
     13from ndg.xacml.core.context.request import Request 
    1214 
     15 
     16class PDPInterface: 
     17    __metaclass__ = ABCmeta 
     18     
     19    @classmethod 
     20    def __subclasshook__(cls, C): 
     21        """Derived class must implement __call__""" 
     22        if cls is PDPInterface: 
     23            if any("evaluate" in B.__dict__ for B in C.__mro__): 
     24                return True 
     25             
     26        return NotImplemented 
     27 
     28    @abstractmethod 
     29    def evaluate(self, request): 
     30        '''evaluate the input request and return an access control decision 
     31        in the returned response 
     32         
     33        @param request: XACML context request 
     34        @type request: ndg.xacml.core.context.request.Request 
     35        @return: XACML context response 
     36        @rtype: ndg.xacml.core.context.response.Response 
     37        ''' 
     38        if not isinstance(request, Request): 
     39            raise TypeError('Expecting %r type for input request; got %r ' 
     40                            'instead' % (Request, type(request)) 
     41                             
     42 
Note: See TracChangeset for help on using the changeset viewer.