Module io.helidon.security
Package io.helidon.security
Class SecurityRequestBuilder<T extends SecurityRequestBuilder<T>>
- java.lang.Object
-
- io.helidon.security.SecurityRequestBuilder<T>
-
- Type Parameters:
T
- Type of the builder, used to enable extensibility of this builder
- Direct Known Subclasses:
OutboundSecurityClientBuilder
,SecurityClientBuilder
public class SecurityRequestBuilder<T extends SecurityRequestBuilder<T>> extends Object
Fluent API to build a security request.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SecurityRequest
buildRequest()
Build the security request.T
explicitProvider(String providerName)
Use an explicit provider.T
object(Object resource)
Put object to this request.T
object(String key, Object object)
Bind object to a specific name.T
object(String key, Supplier<Object> object)
Bind object supplier to a specific name.T
object(Supplier<Object> resource)
Put object supplier to this request.T
optional(boolean optional)
Set that security is optional.T
tracingSpan(SpanContext spanContext)
Tracing span to support Open tracing.
-
-
-
Method Detail
-
object
public T object(Object resource)
Put object to this request. Creates a default mapping to name "object".- Parameters:
resource
- resource instance to be available to security provider- Returns:
- updated builder instance
-
object
public T object(Supplier<Object> resource)
Put object supplier to this request. Creates a default mapping to name "object".- Parameters:
resource
- supplier of resource instance to be available to security provider- Returns:
- updated builder instance
-
object
public T object(String key, Object object)
Bind object to a specific name. Example: a security policy for move operation expects source object bound to "object" and target object bound to "target" you could achieve this by callingobject(sourceInstance)
to bind the "object" part of the statement andobject("target", targetInstance)
to bind the "target" part of the statement- Parameters:
key
- key to bind this object underobject
- resource instance- Returns:
- updated builder instance
-
object
public T object(String key, Supplier<Object> object)
Bind object supplier to a specific name. Example: a security policy for move operation expects source object bound to "object" and target object bound to "target" you could achieve this by callingobject(sourceInstance)
to bind the "object" part of the statement andobject("target", targetInstance)
to bind the "target" part of the statement- Parameters:
key
- key to bind this object underobject
- supplier of resource instance- Returns:
- updated builder instance
-
tracingSpan
public T tracingSpan(SpanContext spanContext)
Tracing span to support Open tracing. Provider developer can add additional spans as children of this span to trace their progress.- Parameters:
spanContext
- span of current security request (e.g. authentication, authorization or outbound, or any parent if these are not traced)- Returns:
- updated builder instance
- See Also:
GlobalTracer.get()
,Tracer.buildSpan(String)
-
explicitProvider
public T explicitProvider(String providerName)
Use an explicit provider.- Parameters:
providerName
- Name of a configuredSecurityProvider
- Returns:
- updated request builder instance
-
optional
public T optional(boolean optional)
Set that security is optional. Required is default.- Parameters:
optional
- set to true to make this security request optional- Returns:
- this instance
-
buildRequest
public SecurityRequest buildRequest()
Build the security request. Not using name "build" on purpose, so overriding classes can build their expected type.- Returns:
- Security request built from this builder.
-
-