Interface ProviderRequest
- All Superinterfaces:
AbacSupport
A request sent to security providers.
Contains all information that may be needed to authenticate or authorize a request:
- User's subject:
subject()- if user is authenticated - Service subject:
service()- if service is authenticated - Environment information:
env()- path, method etc. - Object:
getObject()- target resource, if provided by user - Security context:
securityContext()- current subjects and information about security context of this request - Endpoint configuration:
endpointConfig()- annotations, endpoint specific configuration, custom objects, custom attributes
-
Nested Class Summary
Nested classes/interfaces inherited from interface AbacSupport
AbacSupport.BasicAttributesModifier and TypeInterfaceDescriptionstatic classImplementsAbacSupportinterface and supports adding attributes. -
Method Summary
Modifier and TypeMethodDescriptionstatic ProviderRequestCreate a new provider request.Configuration of the invoked endpoint, such as annotations declared.env()Environment of current request, such as the URI invoked, time to use for security decisions etc.The object of this request.Get a value of a property from an object.Security context associated with current request.service()Current service subject, if already authenticated.subject()Current user subject, if already authenticated.Methods inherited from interface AbacSupport
abacAttribute, abacAttributeNames, abacAttributeRawModifier and TypeMethodDescriptionabacAttribute(String key) Get the property (optional) value.A collection of all property names in this container.abacAttributeRaw(String key) Return the actual property value or null if not present.
-
Method Details
-
create
static ProviderRequest create(SecurityContext context, Map<String, Supplier<Object>> boundAttributes) Create a new provider request. The following attributes will be bound by this method (even if already specified):env- {code subject}
- {code service}
- Parameters:
context- current security contextboundAttributes- suppliers of bound attributes- Returns:
- a new provider request
-
getValue
Get a value of a property from an object. If object implementsAbacSupportthe value is obtained throughAbacSupport.abacAttribute(String), if not, the value is obtained by reflection from a public field or a public getter method. The method name may be (for attribute called for example "audit"):- audit
- getAudit
- isAudit
- shouldAudit
- hasAudit
- Parameters:
object- object to get attribute fromkey- key of the attribute- Returns:
- value of the attribute if found
-
endpointConfig
EndpointConfig endpointConfig()Configuration of the invoked endpoint, such as annotations declared.- Returns:
- endpoint config
-
securityContext
SecurityContext securityContext()Security context associated with current request.- Returns:
- security context
-
subject
-
service
-
env
SecurityEnvironment env()Environment of current request, such as the URI invoked, time to use for security decisions etc.- Returns:
- security environment
-
getObject
-