java.lang.Object
io.helidon.security.SecurityEnvironment
- All Implemented Interfaces:
- AbacSupport
Security environment is a set of attributes that are stable for an interaction (usually a request in our case).
 Environment can be re-used for multiple security request (e.g authentication, authorization).
 Access to environment is either through methods (for known attributes) or through
 generic 
AbacSupport.abacAttribute(String) methods for any property configured by integration component.
 The following properties are available (known):
- time: decision time of the current request (e.g. when checking that this is within business hours
- uri: target URI that was requested
- path: path that was requested
- method: method of the request
- transport: transport of the request (e.g. http)
- headers: transport headers of the request (map)
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic final classA fluent API builder forSecurityEnvironment.Nested classes/interfaces inherited from interface io.helidon.security.util.AbacSupportAbacSupport.BasicAttributes
- 
Method SummaryModifier and TypeMethodDescriptionA collection of all property names in this container.abacAttributeRaw(String key) Return the actual property value or null if not present.static SecurityEnvironment.Builderbuilder()Creates a fluent API builder to build new instances of this class with current time.static SecurityEnvironment.Builderbuilder(SecurityTime serverTime) Creates a fluent API builder to build new instances of this class.static SecurityEnvironmentcreate()Create a new instance of security environment with all default values.derive()Derive a new environment builder based on this environment.headers()Transport headers that can be used to process the message.method()Verb to execute on the resource.path()Path to the resource.Query parameters obtained from the request.Get the URI of the resource requested.time()Time on the server this environment was created for current request.Return type of transport (such as http, https, jms etc.).Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.helidon.security.util.AbacSupportabacAttribute
- 
Method Details- 
builderCreates a fluent API builder to build new instances of this class.- Parameters:
- serverTime- Time to use to obtain current time
- Returns:
- a builder instance
 
- 
builderCreates a fluent API builder to build new instances of this class with current time.- Returns:
- a builder instance
 
- 
createCreate a new instance of security environment with all default values.- Returns:
- environment instance
 
- 
abacAttributeRawDescription copied from interface:AbacSupportReturn the actual property value or null if not present. This is the only method that needs to be implemented.- Specified by:
- abacAttributeRawin interface- AbacSupport
- Parameters:
- key- key (name) of the property
- Returns:
- value of the property or null
 
- 
abacAttributeNamesDescription copied from interface:AbacSupportA collection of all property names in this container.- Specified by:
- abacAttributeNamesin interface- AbacSupport
- Returns:
- collection of keys
 
- 
timeTime on the server this environment was created for current request. This should be treated as the "decisive" time of the request for security evaluation.This can be configured - e.g. there can be a time-shift (moving time by a specific amount of seconds to the past or to the future), or an explicit value (e.g. setting the time to 14:00 e.g. for testing purposes). - Returns:
- server time that should be used to make security decisions
- See Also:
 
- 
targetUriGet the URI of the resource requested. For inbound request, this contains the requested URI by remote client (or as close to the original one as we can get), for outbound requests, this contains the actual URI as configured by client to be called on remote server. If we use service registry (such as Eureka), we must have access to the actual endpoint (as signatures may require signing of URI with the real host and port). Either this method MUST return a resolved URI, or we MUST have access to registry and enforce an endpoint (when resolved).- Returns:
- URI being called or URI to be called
 
- 
pathPath to the resource. For jax-rs, this is relative URI.- Returns:
- Path to the resource
 
- 
methodVerb to execute on the resource. For http, this is HTTP method (PUT, GET, DELETE, POST....)- Returns:
- Verb executing on the resource, default is GET
 
- 
transportReturn type of transport (such as http, https, jms etc.). Transport should be case insensitive, yet I recommend using all lower case. For the purpose of this method, http and https are two separate transports!- Returns:
- transport used for this request. Defaults to http.
 
- 
deriveDerive a new environment builder based on this environment.- Returns:
- builder to build a new environment overriding only needed values with a new timestamp
 
- 
headersTransport headers that can be used to process the message. The headers stand here as a generalization - they cover all metadata sent with each request that is not described elsewhere. For HTTP, this would cover: all HTTP headers (done automatically by integration components), on-demand query parameters (must be explicitly configured and supported by integration component), on-demand form parameters (must be explicitly configured and supported by integration component). For JMS, this would cover: all JMS headers (in string form - byte[] should be base64 encoded). Other protocols must choose a reasonable way to transfer a request/response message into headers and entity.- Returns:
- Header map. If transport protocol does not support headers, map will be empty
 
- 
queryParamsQuery parameters obtained from the request. If transport protocol does not support query parameters, instance will be empty.- Returns:
- query parameter instance, If transport protocol does not support query parameters, instance will be empty.
 
 
-