Class PolicyManager
java.lang.Object
org.codice.ddf.security.policy.context.impl.PolicyManager
- All Implemented Interfaces:
org.codice.ddf.security.policy.context.ContextPolicyManager
public class PolicyManager
extends Object
implements org.codice.ddf.security.policy.context.ContextPolicyManager
Implementation of ContextPolicyManager. This implementation starts with a default empty policy at
the "/" context and accepts new policies as a Map<String, String> orMap<String,
String[]>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled by blueprint once all properties have been initialized.org.codice.ddf.security.policy.context.ContextPolicycopyContextPolicy(org.codice.ddf.security.policy.context.ContextPolicy contextPolicy) Duplicates the given context policyCollection<org.codice.ddf.security.policy.context.ContextPolicy> Gets the authorization types of the given path.org.codice.ddf.security.policy.context.ContextPolicygetContextPolicy(String path) List<org.codice.ddf.security.policy.context.attributes.ContextAttributeMapping> getContextReqAttrs(String path, Map<String, List<org.codice.ddf.security.policy.context.attributes.ContextAttributeMapping>> contextToReqAttrs) Gets the required attributes of the context associated to the given path.booleanReturns a duplicate of the current policy store.booleanReturns a duplicate of the current white list contextsbooleanisWhiteListed(String contextPath) rollbackPath(String path) voidsetContextPolicy(String path, org.codice.ddf.security.policy.context.ContextPolicy newContextPolicy) voidsetEndpointAuthenticationTypes(String authenticationTypes) voidsetGuestAccess(boolean guestAccess) voidsetPolicies(Map<String, Object> properties) Initializes the policy store.voidsetPolicyFilePath(String policyFilePath) voidsetRequiredAttributes(List<String> requiredAttributes) voidsetSecurityLogger(ddf.security.audit.SecurityLogger securityLogger) voidsetSessionAccess(boolean sessionAccess) voidsetTraversalDepth(int traversalDepth) voidsetWebAuthenticationTypes(String authenticationTypes) voidsetWhiteListContexts(List<String> contexts)
-
Constructor Details
-
PolicyManager
public PolicyManager()
-
-
Method Details
-
getContextPolicy
- Specified by:
getContextPolicyin interfaceorg.codice.ddf.security.policy.context.ContextPolicyManager
-
getAllContextPolicies
- Specified by:
getAllContextPoliciesin interfaceorg.codice.ddf.security.policy.context.ContextPolicyManager
-
setContextPolicy
public void setContextPolicy(String path, org.codice.ddf.security.policy.context.ContextPolicy newContextPolicy) - Specified by:
setContextPolicyin interfaceorg.codice.ddf.security.policy.context.ContextPolicyManager
-
setPolicies
Initializes the policy store. This method will be called every time the policy attributes change. This will happen after the component has been initialized (seeconfigure()and when an update is made to theorg.codice.ddf.security.policy.context.impl.PolicyManagerconfiguration pid.
See https://osgi.org/javadoc/r6/cmpn/org/osgi/service/cm/ManagedService.html for more details on how and when this method may be called.- Parameters:
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 benull.
-
getPolicyStore
Returns a duplicate of the current policy store.- Returns:
- duplicate policy store
-
getWhiteListContexts
Returns a duplicate of the current white list contexts- Returns:
-
setWhiteListContexts
-
copyContextPolicy
public org.codice.ddf.security.policy.context.ContextPolicy copyContextPolicy(org.codice.ddf.security.policy.context.ContextPolicy contextPolicy) Duplicates the given context policy- Parameters:
contextPolicy-- Returns:
- copy of contextPolicy
-
getContextAuthTypes
Gets the authorization types of the given path. If authorization types of given path do not exist it rolls back until a parent path exists with such authorization types is found If no parent path exists, the authorization types defaults to an empty list- Parameters:
path- - Path associated with contextcontextToAuthTypes- - Map of all paths and their context authorization types- Returns:
- List of authorization types
-
getContextReqAttrs
public List<org.codice.ddf.security.policy.context.attributes.ContextAttributeMapping> getContextReqAttrs(String path, Map<String, List<org.codice.ddf.security.policy.context.attributes.ContextAttributeMapping>> contextToReqAttrs) Gets the required attributes of the context associated to the given path. If required attributes of given path do not exist it rolls back until a parent context path exists with such required attributes is found If no parent path exists, the context defaults to empty list- Parameters:
contextToReqAttrs- - Map of all paths to contexts and their associated required attributes- Returns:
- List of required attributes
-
rollbackPath
-
setWebAuthenticationTypes
-
setEndpointAuthenticationTypes
-
setRequiredAttributes
-
isWhiteListed
- Specified by:
isWhiteListedin interfaceorg.codice.ddf.security.policy.context.ContextPolicyManager
-
setTraversalDepth
public void setTraversalDepth(int traversalDepth) -
setGuestAccess
public void setGuestAccess(boolean guestAccess) -
getGuestAccess
public boolean getGuestAccess()- Specified by:
getGuestAccessin interfaceorg.codice.ddf.security.policy.context.ContextPolicyManager
-
setSessionAccess
public void setSessionAccess(boolean sessionAccess) -
getSessionAccess
public boolean getSessionAccess()- Specified by:
getSessionAccessin interfaceorg.codice.ddf.security.policy.context.ContextPolicyManager
-
setPolicyFilePath
-
setSecurityLogger
public void setSecurityLogger(ddf.security.audit.SecurityLogger securityLogger) -
configure
public void configure()Called by blueprint once all properties have been initialized. This isn't called by configuration manager - it calls the specified update-method (in this case setPolicies).
-