Class SecurityRequestBuilder<T extends 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 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 calling object(sourceInstance) to bind the "object" part of the statement and object("target", targetInstance) to bind the "target" part of the statement
        Parameters:
        key - key to bind this object under
        object - 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 calling object(sourceInstance) to bind the "object" part of the statement and object("target", targetInstance) to bind the "target" part of the statement
        Parameters:
        key - key to bind this object under
        object - 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 configured SecurityProvider
        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.