Package ndg :: Package xacml :: Package finder :: Module urlpolicyfinder :: Class UrlPolicyFinder
[hide private]

Class UrlPolicyFinder

source code

                       object --+    
                                |    
policyfinderbase.PolicyFinderBase --+
                                    |
                                   UrlPolicyFinder

Concrete subclass of PolicyFinderBase that interprets ID references as URLs.

Nested Classes [hide private]

Inherited from policyfinderbase.PolicyFinderBase: __metaclass__

Instance Methods [hide private]
 
__init__(self, basePath)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
ndg.xacml.core.policy.Policy
findPolicy(self, policyIdReference, common)
Retrieves a policy for a specified policy ID.
source code
ndg.xacml.core.policy.PolicySet
findPolicySet(self, policySetIdReference, common)
Retrieves a policy set for a specified policy set ID.
source code
ndg.xacml.core.policy.PolicySet
_findPolicyFromReference(self, reference, common)
Retrieves a policy or policy set for a specified ID that has not been read already by interpreting the reference as a URL.
source code
str
_makeUrlFromReference(self, reference)
Makes a URL from the reference.
source code

Inherited from policyfinderbase.PolicyFinderBase: addPolicyReference, addPolicySetReference, setReader

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  _FILE_SCHEME = 'file://'
  _NON_FILE_SCHEMES = ['ftp://', 'http://', 'https://']
  _DEFAULT_SCHEME = 'file://'
  _SCHEME_SEPARATOR = '://'
  _RELATIVE_PATH_PREFIX = './'
  __abstractmethods__ = frozenset([])
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, basePath)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • basePath - base path for resolving relative references @type basePath str
Overrides: object.__init__

findPolicy(self, policyIdReference, common)

source code 

Retrieves a policy for a specified policy ID.

Parameters:
  • policyIdReference (str) - policy ID reference
  • common (from ndg.xacml.parsers.common.Common) - parsing common data
Returns: ndg.xacml.core.policy.Policy
policy
Raises:
Overrides: policyfinderbase.PolicyFinderBase.findPolicy

findPolicySet(self, policySetIdReference, common)

source code 

Retrieves a policy set for a specified policy set ID.

Parameters:
  • policySetIdReference (str) - policy set ID reference
  • common (from ndg.xacml.parsers.common.Common) - parsing common data
Returns: ndg.xacml.core.policy.PolicySet
policy set
Raises:
Overrides: policyfinderbase.PolicyFinderBase.findPolicySet

_findPolicyFromReference(self, reference, common)

source code 

Retrieves a policy or policy set for a specified ID that has not been read already by interpreting the reference as a URL.

Parameters:
  • reference (str) - ID reference
  • common (from ndg.xacml.parsers.common.Common) - parsing common data
Returns: ndg.xacml.core.policy.PolicySet
policy set
Raises:

_makeUrlFromReference(self, reference)

source code 

Makes a URL from the reference. If it already begins with a known scheme prefix, the reference is not modified, otherwise it is made into a file URL (relative to the base path if it does not start with a path separator). file://dir/file and file://./dir/file are treated as relative paths. file:///dir/file is treated as an absolute path.

Parameters:
  • reference (str) - ID reference
Returns: str
URL