Package com.sun.identity.policy
Class PolicyEvaluator
- java.lang.Object
-
- com.sun.identity.policy.PolicyEvaluator
-
@Deprecated public class PolicyEvaluator extends Object
Deprecated.since 12.0.0The classPolicyEvaluatorevaluates policies and provides policy decisions.
-
-
Field Summary
Fields Modifier and Type Field Description static StringADVICING_ORGANIZATIONDeprecated.static StringALL_RESOURCESDeprecated.Constant used to identity all the resources of a service type.static intDEFAULT_RESULTS_CACHE_RESOURCE_CAPDeprecated.static intDEFAULT_RESULTS_CACHE_SESSION_CAPDeprecated.static StringEMPTY_RESOURCE_NAMEDeprecated.Constant used to identity empty resourcestatic StringREALM_DNDeprecated.Constant used for key to pass the realm DN in the env map, so that Condition(s) can look up the relevantPolicyConfigconfig map, if necessary.static StringRESULTS_CACHE_RESOURCE_CAPDeprecated.static StringRESULTS_CACHE_SESSION_CAPDeprecated.static intresultsCacheResourceCapDeprecated.static intresultsCacheSessionCapDeprecated.static SSOTokenListenerssoListenerDeprecated.listener object to be used in cleaning up the userNSRoleCache, subjectEvaluationCache , user role cache in LDAPRoles and policyResultsCache upon user token expiration.static MapssoListenerRegistryDeprecated.static StringSUN_AM_ORIGINAL_REQUESTED_RESOURCEDeprecated.Constant used for key to pass the requested resource name uncanonicalized in the env map, so that Condition(s)/ResponseProvider(s) could use the requested resource name, if necessarystatic StringSUN_AM_REQUESTED_ACTIONSDeprecated.Constant used for key to pass the requested actions names in the env map, so that Condition(s)/ResponseProvider(s) could use the requested actions names, if necessarystatic StringSUN_AM_REQUESTED_RESOURCEDeprecated.Constant used for key to pass the requested resource name canonicalized in the env map, so that Condition(s)/ResponseProvider(s) could use the requested resource name, if necessary
-
Constructor Summary
Constructors Constructor Description PolicyEvaluator(String serviceTypeName)Deprecated.Constructor to create aPolicyEvaluatorgiven theServiceTypename.PolicyEvaluator(String orgName, String serviceTypeName)Deprecated.Constructor to create aPolicyEvaluatorgiven organization name and theServiceTypename.PolicyEvaluator(String orgName, String serviceTypeName, String applicationName)Deprecated.Creates a new policy evaluator instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddPolicyListener(PolicyListener policyListener)Deprecated.Adds a policy listener that would be notified whenever a policy is added, removed or changedPolicyDecisiongetPolicyDecision(SSOToken token, String resourceName, Set actionNames)Deprecated.Evaluates privileges of the user to perform the specified actions on the specified resource.PolicyDecisiongetPolicyDecision(SSOToken token, String resourceName, Set actionNames, Map envParameters)Deprecated.Evaluates privileges of the user to perform the specified actions on the specified resource.SetgetProtectedResourcesIgnoreConditions(SSOToken token, String rootResource)Deprecated.Gets protected resources for a user identified by single sign on token Conditions defined in the policies are ignored while computing protected resources.SetgetResourceNames(SSOToken token, String resourceName, boolean followReferral)Deprecated.Gets resource names that are exact matches, sub resources or wild card matches of argument resource name.SetgetResourceNames(SSOToken token, String resourceName, boolean followReferral, Set visitedOrgs)Deprecated.Gets resource names that are exact matches, sub resources or wild card matches of argument resource name.ResourceResultgetResourceResult(SSOToken token, String resourceName, String scope, Map envParameters)Deprecated.UsegetResourceResults()SetgetResourceResults(SSOToken token, String resourceName, String scope, Map envParameters)Deprecated.Gets resource result objects given a resource name.static SetgetUserNSRoleValues(SSOToken token)Deprecated.Get the set of role DNs of a user.booleanisAllowed(SSOToken token, String resourceName, String actionName)Deprecated.Evaluates a simple privilege of boolean type.booleanisAllowed(SSOToken token, String resourceName, String actionName, Map envParameters)Deprecated.Evaluates simple privileges of boolean type.voidremovePolicyListener(PolicyListener policyListener)Deprecated.Removes a policy listener that was previously registered to receive notifications whenever a policy is added, removed or changed.
-
-
-
Field Detail
-
ALL_RESOURCES
public static final String ALL_RESOURCES
Deprecated.Constant used to identity all the resources of a service type. The resources include the sub resources of all resource prefixes of resource type- See Also:
- Constant Field Values
-
ADVICING_ORGANIZATION
public static final String ADVICING_ORGANIZATION
Deprecated.- See Also:
- Constant Field Values
-
EMPTY_RESOURCE_NAME
public static final String EMPTY_RESOURCE_NAME
Deprecated.Constant used to identity empty resource- See Also:
- Constant Field Values
-
SUN_AM_REQUESTED_RESOURCE
public static final String SUN_AM_REQUESTED_RESOURCE
Deprecated.Constant used for key to pass the requested resource name canonicalized in the env map, so that Condition(s)/ResponseProvider(s) could use the requested resource name, if necessary- See Also:
- Constant Field Values
-
SUN_AM_ORIGINAL_REQUESTED_RESOURCE
public static final String SUN_AM_ORIGINAL_REQUESTED_RESOURCE
Deprecated.Constant used for key to pass the requested resource name uncanonicalized in the env map, so that Condition(s)/ResponseProvider(s) could use the requested resource name, if necessary- See Also:
- Constant Field Values
-
SUN_AM_REQUESTED_ACTIONS
public static final String SUN_AM_REQUESTED_ACTIONS
Deprecated.Constant used for key to pass the requested actions names in the env map, so that Condition(s)/ResponseProvider(s) could use the requested actions names, if necessary- See Also:
- Constant Field Values
-
REALM_DN
public static final String REALM_DN
Deprecated.Constant used for key to pass the realm DN in the env map, so that Condition(s) can look up the relevantPolicyConfigconfig map, if necessary.LDAPFilterConditionneeds to use PolicyConfig config map.- See Also:
- Constant Field Values
-
RESULTS_CACHE_SESSION_CAP
public static final String RESULTS_CACHE_SESSION_CAP
Deprecated.- See Also:
- Constant Field Values
-
DEFAULT_RESULTS_CACHE_SESSION_CAP
public static int DEFAULT_RESULTS_CACHE_SESSION_CAP
Deprecated.
-
resultsCacheSessionCap
public static int resultsCacheSessionCap
Deprecated.
-
RESULTS_CACHE_RESOURCE_CAP
public static final String RESULTS_CACHE_RESOURCE_CAP
Deprecated.- See Also:
- Constant Field Values
-
DEFAULT_RESULTS_CACHE_RESOURCE_CAP
public static int DEFAULT_RESULTS_CACHE_RESOURCE_CAP
Deprecated.
-
resultsCacheResourceCap
public static int resultsCacheResourceCap
Deprecated.
-
ssoListenerRegistry
public static Map ssoListenerRegistry
Deprecated.
-
ssoListener
public static SSOTokenListener ssoListener
Deprecated.listener object to be used in cleaning up the userNSRoleCache, subjectEvaluationCache , user role cache in LDAPRoles and policyResultsCache upon user token expiration.
-
-
Constructor Detail
-
PolicyEvaluator
public PolicyEvaluator(String serviceTypeName) throws SSOException, NameNotFoundException, PolicyException
Deprecated.Constructor to create aPolicyEvaluatorgiven theServiceTypename.- Parameters:
serviceTypeName- the name of theServiceTypefor which this evaluator can be used.- Throws:
SSOException- ifSSOTokenused byPolicyEvaluatoris invalidNameNotFoundException- if the service with nameserviceTypeNameis not foundPolicyException- for any other abnormal condition
-
PolicyEvaluator
public PolicyEvaluator(String orgName, String serviceTypeName) throws SSOException, PolicyException, NameNotFoundException
Deprecated.Constructor to create aPolicyEvaluatorgiven organization name and theServiceTypename.- Parameters:
orgName- the name of the organization under which the evaluation is being doneserviceTypeName- the name of theServiceTypefor which this evaluator can be used.- Throws:
SSOExceptionPolicyExceptionNameNotFoundException
-
PolicyEvaluator
public PolicyEvaluator(String orgName, String serviceTypeName, String applicationName) throws PolicyException, SSOException
Deprecated.Creates a new policy evaluator instance.- Parameters:
orgName- the name of the organization under which the evaluation is being doneserviceTypeName- the name of theServiceTypefor which this evaluator can be usedapplicationName- the application name containing the policies in question- Throws:
PolicyException- should some error occur constructor the evaluatorSSOException- should some error occur with regards to any SSO token
-
-
Method Detail
-
isAllowed
public boolean isAllowed(SSOToken token, String resourceName, String actionName) throws PolicyException, SSOException
Deprecated.Evaluates a simple privilege of boolean type. The privilege indicate if the user can perform specified action on the specified resource. Invoking this method would result inPolicyException, if the syntax for theactionNameis not declared to be boolean, in the service schema.- Parameters:
token- single sign on token of the user evaluating policiesresourceName- name of the resource the user is trying to accessactionName- name of the action the user is trying to perform on the resource- Returns:
- the result of the evaluation as a boolean value
- Throws:
SSOException- single-sign-on token invalid or expiredPolicyException
-
isAllowed
public boolean isAllowed(SSOToken token, String resourceName, String actionName, Map envParameters) throws SSOException, PolicyException
Deprecated.Evaluates simple privileges of boolean type. The privilege indicate if the user can perform specified action on the specified resource. The evaluation depends on user's application environment parameters. Invoking this method would result inPolicyException, if the syntax for theactionNameis not declared to be boolean, in the service schema.- Parameters:
token- single sign on token of the user evaluating policiesresourceName- name of the resource the user is trying to accessactionName- name of the action the user is trying to perform on the resourceenvParameters- run-time environment parameters- Returns:
- the result of the evaluation as a boolean value
- Throws:
SSOException- single-sign-on token invalid or expiredPolicyException- for any other abnormal condition
-
getPolicyDecision
public PolicyDecision getPolicyDecision(SSOToken token, String resourceName, Set actionNames) throws PolicyException, SSOException
Deprecated.Evaluates privileges of the user to perform the specified actions on the specified resource.- Parameters:
token- single sign on token of the user evaluating policiesresourceName- name of the resource the user is trying to accessactionNames- aSetofStingobjects representing names of the actions the user is trying to perform on the resource- Returns:
- policy decision
- Throws:
SSOException- single-sign-on token invalid or expiredPolicyException- for any other abnormal condition.
-
getPolicyDecision
public PolicyDecision getPolicyDecision(SSOToken token, String resourceName, Set actionNames, Map envParameters) throws SSOException, PolicyException
Deprecated.Evaluates privileges of the user to perform the specified actions on the specified resource. The evaluation depends on user's application environment parameters.- Parameters:
token- single sign on token of the user evaluating policiesresourceName- name of the resource the user is trying to accessactionNames-Setof names(String) of the action the user is trying to perform on the resourceenvParameters-Mapof run-time environment parameters- Returns:
- policy decision
- Throws:
SSOException- single-sign-on token invalid or expiredPolicyException- for any other abnormal condition
-
getProtectedResourcesIgnoreConditions
public Set getProtectedResourcesIgnoreConditions(SSOToken token, String rootResource) throws SSOException, PolicyException
Deprecated.Gets protected resources for a user identified by single sign on token Conditions defined in the policies are ignored while computing protected resources. Only resources that are sub resources of the givenrootResourceor equal to the givenrootResourcewould be returned. If all policies applicable to a resource are only referral policies, noProtectedResourcewould be returned for such a resource.- Parameters:
token- single sign on token of the userrootResource- only resources that are sub resources of the givenrootResourceor equal to the givenrootResourcewould be returnedrootResourcewould be returned. IfPolicyEvaluator.ALL_RESOURCESis passed asrootResource, resources under all root resources of the service type are considered while computing protected resources.- Returns:
Setof protected resources. The set containsProtectedResourceobjects.- Throws:
SSOException- if single sign on token is invalidPolicyException- for any other abnormal condition- See Also:
ProtectedResource
-
getResourceResults
public Set getResourceResults(SSOToken token, String resourceName, String scope, Map envParameters) throws SSOException, PolicyException
Deprecated.Gets resource result objects given a resource name. The set containsResourceResultobjects for all resources that would affect policy decisions for any resource associated with the argument resource name. To determine whether to include theResourceResultof a resource, we compare argument resource name and policy resource name, treating wild characters in the policy resource name as wild. If the comparison resulted inEXACT_MATCH,WILD_CARD_MACTHorSUB_RESOURCE_MACTH, the resource result would be included.- Parameters:
token- single sign on token of the user evaluating policiesresourceName- name of the resourcescope- indicates whether to compute the resource result based on the policy decision for only theresourceNameor all the resources associated with the resource name. The valid scope values are:ResourceResult.SUBTREE_SCOPEResourceResult.STRICT_SUBTREE_SCOPEResourceResult.SELF_SCOPE-
If the scope is
ResourceResult.SUBTREE_SCOPE, the method will return a set ofResourceResultobjects, one of them for theresourceNameand its sub resources; the others are for resources that match theresourceNameby wildcard. If the scope isResourceResult.STRICT_SUBTREE_SCOPE, the method will return a set object that contains oneResourceResultobject. TheResourceResultcontains the policy decisions regarding theresourceNameand its sub resources. If the scope isResourceResult.SELF_SCOPE, the method will return a set object that contains oneResourceResultobject. TheResourceResultcontains the policy decision regarding theresourceNameonly.
envParameters- run-time environment parameters- Returns:
- set of
ResourceResultobjects - Throws:
SSOException- iftokenis invalidPolicyException- for any other abnormal condition- See Also:
ResourceMatch.EXACT_MATCH,ResourceMatch.SUB_RESOURCE_MATCH,ResourceMatch.WILDCARD_MATCH,ResourceResult.SUBTREE_SCOPE,ResourceResult.STRICT_SUBTREE_SCOPE,ResourceResult.SELF_SCOPE
-
getResourceResult
public ResourceResult getResourceResult(SSOToken token, String resourceName, String scope, Map envParameters) throws SSOException, PolicyException
Deprecated.UsegetResourceResults()Gets resource result given a resource name.ResourceResultis a tree representation of policy decisions for all resources rooted at the resource name. To determine whether a resource defined in the policy is a sub resource of argument resource name, argument resource name and policy resource name are compared, treating wild characters as literals. If comparison resulted inEXACT_MACTHorSUB_RESOURCE_MACTH, the resource would be included- Parameters:
token- single sign on token of the user evaluating policiesresourceName- name of the resourcescope- indicates whether to compute the resource result based on the policy decision for only theresourceNameor all the resources associated with the resource name. The valid scope values are:ResourceResult.SUBTREE_SCOPEResourceResult.STRICT_SUBTREE_SCOPEResourceResult.SELF_SCOPE
ResourceResult.SUBTREE_SCOPEorResourceResult.STRICT_SUBTREE_SCOPE, the method will return aResourceResultobject that contains the policy decisions regarding theresourceNameand its sub resources. If the scope isResourceResult.SELF_SCOPE, the method will return aResourceResultobject that contains the policy decision regarding theresourceNameonly. Note, scope valuesResourceResult.SUBTREE_SCOPEandResourceResult.STRICT_SUBTREE_SCOPEare being treated as the same for backword compatibility reasons. This method is being deprecated. The methodgetResourceResults()should be used instead.envParameters- run-time environment parameters- Returns:
ResourceResult.- Throws:
SSOException- iftokenis invalidPolicyException- for any other abnormal condition- See Also:
ResourceMatch.EXACT_MATCH,ResourceMatch.SUB_RESOURCE_MATCH,ResourceMatch.WILDCARD_MATCH,ResourceResult.SUBTREE_SCOPE,ResourceResult.STRICT_SUBTREE_SCOPE,ResourceResult.SELF_SCOPE
-
getResourceNames
public Set getResourceNames(SSOToken token, String resourceName, boolean followReferral) throws PolicyException, SSOException
Deprecated.Gets resource names that are exact matches, sub resources or wild card matches of argument resource name. To determine whether to include a resource name of a resource, we compare argument resource name and policy resource name, treating wild characters in the policy resource name as wild. If the comparison resulted inEXACT_MATCH,WILD_CARD_MACTHorSUB_RESOURCE_MACTH, the resource result would be included.- Parameters:
token- single sign on tokenresourceName- resoure namefollowReferral- indicates whether to follow the referrals defined in policies to compute resource names- Returns:
- names of sub resources for the given
resourceName. The return value would also include theresourceName. - Throws:
SSOException- iftokenis invalidPolicyException- for any other abnormal condition- See Also:
ResourceMatch.EXACT_MATCH,ResourceMatch.SUB_RESOURCE_MATCH,ResourceMatch.WILDCARD_MATCH
-
getResourceNames
public Set getResourceNames(SSOToken token, String resourceName, boolean followReferral, Set visitedOrgs) throws PolicyException, SSOException
Deprecated.Gets resource names that are exact matches, sub resources or wild card matches of argument resource name. To determine whether to include a resource name of a resource, we compare argument resource name and policy resource name, treating wild characters in the policy resource name as wild. If the comparsion resulted inEXACT_MATCH,WILD_CARD_MACTHorSUB_RESOURCE_MACTH, the resource result would be included.- Parameters:
token- single sign on tokenresourceName- resoure namefollowReferral- indicates whether to follow the referrals defined in policies to compute resource namesvisitedOrgs- organizations that were already visited to compute resource names- Returns:
- names of sub resources for the given
resourceName. The return value would also include theresourceName. - Throws:
SSOException- iftokenis invalidPolicyException- for any other abnormal condition- See Also:
ResourceMatch.EXACT_MATCH,ResourceMatch.SUB_RESOURCE_MATCH,ResourceMatch.WILDCARD_MATCH
-
addPolicyListener
public void addPolicyListener(PolicyListener policyListener)
Deprecated.Adds a policy listener that would be notified whenever a policy is added, removed or changed- Parameters:
policyListener- the listener to be added
-
removePolicyListener
public void removePolicyListener(PolicyListener policyListener)
Deprecated.Removes a policy listener that was previously registered to receive notifications whenever a policy is added, removed or changed. It is not an error to attempt to remove a listener that was not registered. It would return silently.- Parameters:
policyListener- the listener to be removed
-
getUserNSRoleValues
public static Set getUserNSRoleValues(SSOToken token) throws SSOException, PolicyException
Deprecated.Get the set of role DNs of a user. The role DNs are cached to improve the performance of IdentityServerRole subject membership validation.- Parameters:
token- single sign on token of the user evaluating policies- Returns:
- The set of user
nsRoleattribute values - Throws:
SSOException- single-sign-on token invalid or expiredPolicyException- if an error occured while getting the user's nsRole attribute value set
-
-