public class SelectorModule extends AttributeFinderModule
AttributeSelector
so
that programmers can remove this functionality if they want (it's optional in the spec), so they
can replace this code with more efficient, specific code as needed, and so they can easily swap
in different XPath libraries.
Note that if no matches are found, this module will return an empty bag (unless some error
occurred). The AttributeSelector
is still deciding what to return to the policy
based on the MustBePresent attribute.
This module uses the Xalan XPath implementation, and supports only version 1.0 of XPath. It is a fully functional, correct implementation of XACML's AttributeSelector functionality, but is not designed for environments that make significant use of XPath queries. Developers for any such environment should consider implementing their own module.
Constructor and Description |
---|
SelectorModule() |
Modifier and Type | Method and Description |
---|---|
EvaluationResult |
findAttribute(String contextPath,
URI attributeType,
String contextSelector,
Node root,
EvaluationCtx context,
String xpathVersion)
Tries to find attribute values based on the given selector data.
|
boolean |
isSelectorSupported()
Returns true since this module supports retrieving attributes based on the data provided in
an AttributeSelectorType.
|
findAttribute, getIdentifier, getSupportedCategories, getSupportedIds, invalidateCache, isDesignatorSupported
public boolean isSelectorSupported()
isSelectorSupported
in class AttributeFinderModule
public EvaluationResult findAttribute(String contextPath, URI attributeType, String contextSelector, Node root, EvaluationCtx context, String xpathVersion)
AttributeFinderModule
BagAttribute
, even if only one value was found. If no
values were found, but no other error occurred, an empty bag is returned. This method may
need to invoke the context data to look for other attribute values, so a module writer must
take care not to create a scenario that loops forever.findAttribute
in class AttributeFinderModule
contextPath
- the XPath expression to search againstattributeType
- the datatype of the attributes to findcontextSelector
- the selector to find the context to apply XPath expression
if this is null, applied for default content. This is only used with XACML 3.0root
- the DOM node that XPath evaluation is done. this only used by XACML 3.0
this can be null, if other XACML versions are used.context
- the representation of the request dataxpathVersion
- the XPath version to useCopyright © 2021 WSO2. All rights reserved.