Package org.apereo.cas.services
Class AbstractRegisteredServiceAttributeReleasePolicy
- java.lang.Object
-
- org.apereo.cas.services.AbstractRegisteredServiceAttributeReleasePolicy
-
- All Implemented Interfaces:
java.io.Serializable
,org.apereo.cas.services.RegisteredServiceAttributeReleasePolicy
,org.springframework.core.Ordered
- Direct Known Subclasses:
BaseMappedAttributeReleasePolicy
,DenyAllAttributeReleasePolicy
,GroovyScriptAttributeReleasePolicy
,PatternMatchingAttributeReleasePolicy
,ReturnAllAttributeReleasePolicy
,ReturnAllowedAttributeReleasePolicy
,ReturnEncryptedAttributeReleasePolicy
,ReturnStaticAttributeReleasePolicy
,ScriptedRegisteredServiceAttributeReleasePolicy
public abstract class AbstractRegisteredServiceAttributeReleasePolicy extends java.lang.Object implements org.apereo.cas.services.RegisteredServiceAttributeReleasePolicy
Abstract release policy for attributes, provides common shared settings such as loggers and attribute filter config. Subclasses are to provide the behavior for attribute retrieval.- Since:
- 4.1.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractRegisteredServiceAttributeReleasePolicy()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected java.util.List<java.lang.String>
determineRequestedAttributeDefinitions(org.apereo.cas.services.RegisteredServiceAttributeReleasePolicyContext context)
This method should be overridden by release policies that are able to request definitions by listing them as being released in the policy.java.util.Map<java.lang.String,java.util.List<java.lang.Object>>
getAttributes(org.apereo.cas.services.RegisteredServiceAttributeReleasePolicyContext context)
abstract java.util.Map<java.lang.String,java.util.List<java.lang.Object>>
getAttributesInternal(org.apereo.cas.services.RegisteredServiceAttributeReleasePolicyContext context, java.util.Map<java.lang.String,java.util.List<java.lang.Object>> attributes)
Gets the attributes internally from the implementation.java.util.Map<java.lang.String,java.util.List<java.lang.Object>>
getConsentableAttributes(org.apereo.cas.services.RegisteredServiceAttributeReleasePolicyContext context)
protected java.util.Map<java.lang.String,java.util.List<java.lang.Object>>
getReleasedByDefaultAttributes(org.apereo.cas.authentication.principal.Principal principal, java.util.Map<java.lang.String,java.util.List<java.lang.Object>> attributes)
Determines a default bundle of attributes that may be released to all services without the explicit mapping for each service.protected void
insertPrincipalIdAsAttributeIfNeeded(org.apereo.cas.authentication.principal.Principal principal, java.util.Map<java.lang.String,java.util.List<java.lang.Object>> attributesToRelease, org.apereo.cas.authentication.principal.Service service, org.apereo.cas.services.RegisteredService registeredService)
Release principal id as attribute if needed.void
postLoad()
Post load, after having loaded the bean via JPA, etc.protected java.util.Map<java.lang.String,java.util.List<java.lang.Object>>
resolveAttributesFromAttributeDefinitionStore(org.apereo.cas.services.RegisteredServiceAttributeReleasePolicyContext context, java.util.Map<java.lang.String,java.util.List<java.lang.Object>> principalAttributes)
Resolve attributes from attribute definition store and provide map.protected java.util.Map<java.lang.String,java.util.List<java.lang.Object>>
resolveAttributesFromPrincipalAttributeRepository(org.apereo.cas.authentication.principal.Principal principal, org.apereo.cas.services.RegisteredService registeredService)
Resolve attributes from principal attribute repository.protected java.util.Map<java.lang.String,java.util.List<java.lang.Object>>
returnFinalAttributesCollection(java.util.Map<java.lang.String,java.util.List<java.lang.Object>> attributesToRelease, org.apereo.cas.services.RegisteredService service)
Return the final attributes collection.protected boolean
supports(org.apereo.cas.services.RegisteredServiceAttributeReleasePolicyContext context)
Supports this policy request..-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apereo.cas.services.RegisteredServiceAttributeReleasePolicy
getConsentPolicy, getName, getOrder, getPrincipalAttributesRepository, isAuthorizedToReleaseAuthenticationAttributes, isAuthorizedToReleaseCredentialPassword, isAuthorizedToReleaseProxyGrantingTicket, setAttributeFilter
-
-
-
-
Method Detail
-
postLoad
public void postLoad()
Post load, after having loaded the bean via JPA, etc.
-
getAttributes
public java.util.Map<java.lang.String,java.util.List<java.lang.Object>> getAttributes(org.apereo.cas.services.RegisteredServiceAttributeReleasePolicyContext context)
- Specified by:
getAttributes
in interfaceorg.apereo.cas.services.RegisteredServiceAttributeReleasePolicy
-
getConsentableAttributes
public java.util.Map<java.lang.String,java.util.List<java.lang.Object>> getConsentableAttributes(org.apereo.cas.services.RegisteredServiceAttributeReleasePolicyContext context)
- Specified by:
getConsentableAttributes
in interfaceorg.apereo.cas.services.RegisteredServiceAttributeReleasePolicy
-
getAttributesInternal
public abstract java.util.Map<java.lang.String,java.util.List<java.lang.Object>> getAttributesInternal(org.apereo.cas.services.RegisteredServiceAttributeReleasePolicyContext context, java.util.Map<java.lang.String,java.util.List<java.lang.Object>> attributes)
Gets the attributes internally from the implementation.- Parameters:
context
- the contextattributes
- the principal attributes- Returns:
- the attributes allowed for release
-
supports
protected boolean supports(org.apereo.cas.services.RegisteredServiceAttributeReleasePolicyContext context)
Supports this policy request..- Parameters:
context
- the context- Returns:
- the boolean
-
resolveAttributesFromAttributeDefinitionStore
protected java.util.Map<java.lang.String,java.util.List<java.lang.Object>> resolveAttributesFromAttributeDefinitionStore(org.apereo.cas.services.RegisteredServiceAttributeReleasePolicyContext context, java.util.Map<java.lang.String,java.util.List<java.lang.Object>> principalAttributes)
Resolve attributes from attribute definition store and provide map.- Parameters:
context
- the contextprincipalAttributes
- the principal attributes- Returns:
- the map
-
resolveAttributesFromPrincipalAttributeRepository
protected java.util.Map<java.lang.String,java.util.List<java.lang.Object>> resolveAttributesFromPrincipalAttributeRepository(org.apereo.cas.authentication.principal.Principal principal, org.apereo.cas.services.RegisteredService registeredService)
Resolve attributes from principal attribute repository.- Parameters:
principal
- the principalregisteredService
- the registered service- Returns:
- the map
-
insertPrincipalIdAsAttributeIfNeeded
protected void insertPrincipalIdAsAttributeIfNeeded(org.apereo.cas.authentication.principal.Principal principal, java.util.Map<java.lang.String,java.util.List<java.lang.Object>> attributesToRelease, org.apereo.cas.authentication.principal.Service service, org.apereo.cas.services.RegisteredService registeredService)
Release principal id as attribute if needed.- Parameters:
principal
- the principalattributesToRelease
- the attributes to releaseservice
- the serviceregisteredService
- the registered service
-
returnFinalAttributesCollection
protected java.util.Map<java.lang.String,java.util.List<java.lang.Object>> returnFinalAttributesCollection(java.util.Map<java.lang.String,java.util.List<java.lang.Object>> attributesToRelease, org.apereo.cas.services.RegisteredService service)
Return the final attributes collection. Subclasses may override this minute to impose last minute rules.- Parameters:
attributesToRelease
- the attributes to releaseservice
- the service- Returns:
- the map
-
getReleasedByDefaultAttributes
protected java.util.Map<java.lang.String,java.util.List<java.lang.Object>> getReleasedByDefaultAttributes(org.apereo.cas.authentication.principal.Principal principal, java.util.Map<java.lang.String,java.util.List<java.lang.Object>> attributes)
Determines a default bundle of attributes that may be released to all services without the explicit mapping for each service.- Parameters:
principal
- the principalattributes
- the attributes- Returns:
- the released by default attributes
-
determineRequestedAttributeDefinitions
protected java.util.List<java.lang.String> determineRequestedAttributeDefinitions(org.apereo.cas.services.RegisteredServiceAttributeReleasePolicyContext context)
This method should be overridden by release policies that are able to request definitions by listing them as being released in the policy. This method should return the list of definitions keys that need to be resolved by the definition store so the can be resolved and released to the client.- Parameters:
context
- the context- Returns:
- - List of requested attribute definitions to be released.
-
-