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:
DenyAllAttributeReleasePolicy
,GroovyScriptAttributeReleasePolicy
,ReturnAllAttributeReleasePolicy
,ReturnAllowedAttributeReleasePolicy
,ReturnEncryptedAttributeReleasePolicy
,ReturnMappedAttributeReleasePolicy
,ReturnRestfulAttributeReleasePolicy
,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 java.util.Map<java.lang.String,java.util.List<java.lang.Object>>
getAttributes(org.apereo.cas.authentication.principal.Principal principal, org.apereo.cas.authentication.principal.Service selectedService, org.apereo.cas.services.RegisteredService registeredService)
abstract java.util.Map<java.lang.String,java.util.List<java.lang.Object>>
getAttributesInternal(org.apereo.cas.authentication.principal.Principal principal, java.util.Map<java.lang.String,java.util.List<java.lang.Object>> attributes, org.apereo.cas.services.RegisteredService service, org.apereo.cas.authentication.principal.Service selectedService)
Gets the attributes internally from the implementation.java.util.Map<java.lang.String,java.util.List<java.lang.Object>>
getConsentableAttributes(org.apereo.cas.authentication.principal.Principal p, org.apereo.cas.authentication.principal.Service selectedService, org.apereo.cas.services.RegisteredService service)
protected java.util.Map<java.lang.String,java.util.List<java.lang.Object>>
getReleasedByDefaultAttributes(org.apereo.cas.authentication.principal.Principal p, 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 java.util.List<java.lang.String>
getRequestedDefinitions()
This method should be overridden by release policies that are able to request definitions by listing them as being released in the policy.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.authentication.principal.Principal principal, java.util.Map<java.lang.String,java.util.List<java.lang.Object>> principalAttributes, org.apereo.cas.services.RegisteredService registeredService, org.apereo.cas.authentication.principal.Service selectedService)
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.-
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.authentication.principal.Principal principal, org.apereo.cas.authentication.principal.Service selectedService, org.apereo.cas.services.RegisteredService registeredService)
- 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.authentication.principal.Principal p, org.apereo.cas.authentication.principal.Service selectedService, org.apereo.cas.services.RegisteredService service)
- Specified by:
getConsentableAttributes
in interfaceorg.apereo.cas.services.RegisteredServiceAttributeReleasePolicy
-
resolveAttributesFromAttributeDefinitionStore
protected java.util.Map<java.lang.String,java.util.List<java.lang.Object>> resolveAttributesFromAttributeDefinitionStore(org.apereo.cas.authentication.principal.Principal principal, java.util.Map<java.lang.String,java.util.List<java.lang.Object>> principalAttributes, org.apereo.cas.services.RegisteredService registeredService, org.apereo.cas.authentication.principal.Service selectedService)
-
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 p, 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:
p
- the principalattributes
- the attributes- Returns:
- the released by default attributes
-
getRequestedDefinitions
protected java.util.List<java.lang.String> getRequestedDefinitions()
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.- Returns:
- - List of requested definitions to be released.
-
getAttributesInternal
public abstract java.util.Map<java.lang.String,java.util.List<java.lang.Object>> getAttributesInternal(org.apereo.cas.authentication.principal.Principal principal, java.util.Map<java.lang.String,java.util.List<java.lang.Object>> attributes, org.apereo.cas.services.RegisteredService service, org.apereo.cas.authentication.principal.Service selectedService)
Gets the attributes internally from the implementation.- Parameters:
principal
- the principalattributes
- the principal attributesservice
- the serviceselectedService
- the selected service- Returns:
- the attributes allowed for release
-
-