public class PolicyManager extends Object implements ContextPolicyManager
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_REALM |
static String |
DEFAULT_REALM_CONTEXT_VALUE |
Constructor and Description |
---|
PolicyManager() |
Modifier and Type | Method and Description |
---|---|
void |
configure()
Called by blueprint once all properties have been initialized.
|
ContextPolicy |
copyContextPolicy(ContextPolicy contextPolicy)
Duplicates the given context policy
|
Collection<ContextPolicy> |
getAllContextPolicies()
Returns a Collection of all
ContextPolicy objects |
List<String> |
getContextAuthTypes(String path,
Map<String,List<String>> contextToAuthTypes)
Gets the authorization types of the given path.
|
ContextPolicy |
getContextPolicy(String path)
Returns the policy associated with the given context path.
|
String |
getContextRealm(String path,
Map<String,String> contextToRealm)
Gets the context realm of the given path.
|
List<ContextAttributeMapping> |
getContextReqAttrs(String path,
Map<String,List<ContextAttributeMapping>> contextToReqAttrs)
Gets the required attributes of the context associated to the given path.
|
Map<String,ContextPolicy> |
getPolicyStore()
Returns a duplicate of the current policy store.
|
List<String> |
getWhiteListContexts()
Returns a duplicate of the current white list contexts
|
boolean |
isWhiteListed(String contextPath)
Returns true if the policy is white listed.
|
String |
rollbackPath(String path) |
void |
setAuthenticationTypes(List<String> authenticationTypes) |
void |
setContextPolicy(String path,
ContextPolicy newContextPolicy)
Sets a policy for a particular path
|
void |
setPolicies(Map<String,Object> properties)
Initializes the policy store.
|
void |
setRealms(List<String> realms) |
void |
setRequiredAttributes(List<String> requiredAttributes) |
void |
setTraversalDepth(int traversalDepth) |
void |
setWhiteListContexts(List<String> contexts) |
public static final String DEFAULT_REALM
public static final String DEFAULT_REALM_CONTEXT_VALUE
public ContextPolicy getContextPolicy(String path)
ContextPolicyManager
getContextPolicy
in interface ContextPolicyManager
path
- - context pathpublic Collection<ContextPolicy> getAllContextPolicies()
ContextPolicyManager
ContextPolicy
objectsgetAllContextPolicies
in interface ContextPolicyManager
public void setContextPolicy(String path, ContextPolicy newContextPolicy)
ContextPolicyManager
setContextPolicy
in interface ContextPolicyManager
path
- - context pathnewContextPolicy
- - context policypublic void setPolicies(Map<String,Object> properties)
configure()
and
when an update is made to the org.codice.ddf.security.policy.context.impl.PolicyManager
configuration pid. properties
- map of properties to use to initialize the policy store. Since there is no
configuration file bound to these properties by default, this map may be null
.public Map<String,ContextPolicy> getPolicyStore()
public List<String> getWhiteListContexts()
public ContextPolicy copyContextPolicy(ContextPolicy contextPolicy)
contextPolicy
- public String getContextRealm(String path, Map<String,String> contextToRealm)
path
- - Path associated to contextcontextToRealm
- - Map of all paths and their context realmspublic List<String> getContextAuthTypes(String path, Map<String,List<String>> contextToAuthTypes)
path
- - Path associated with contextcontextToAuthTypes
- - Map of all paths and their context authorization typespublic List<ContextAttributeMapping> getContextReqAttrs(String path, Map<String,List<ContextAttributeMapping>> contextToReqAttrs)
-
- Path associated to contextcontextToReqAttrs
- - Map of all paths to contexts and their associated required
attributespublic boolean isWhiteListed(String contextPath)
ContextPolicyManager
isWhiteListed
in interface ContextPolicyManager
contextPath
- - - context pathpublic void setTraversalDepth(int traversalDepth)
public void configure()
This work is licensed under a Creative Commons Attribution 4.0 International License.