Interface SecurityHandlerConfig

All Superinterfaces:
Prototype.Api, Prototype.Factory<SecurityHandler>
All Known Implementing Classes:
SecurityHandlerConfig.BuilderBase.SecurityHandlerConfigImpl

public interface SecurityHandlerConfig extends Prototype.Api
Configuration of a SecurityHandler.
See Also:
  • Method Details

    • builder

      Create a new fluent API builder to customize configuration.
      Returns:
      a new builder
    • builder

      Create a new fluent API builder from an existing instance.
      Parameters:
      instance - an existing instance used as a base for the builder
      Returns:
      a builder based on an instance
    • create

      static SecurityHandlerConfig create(Config config)
      Create a new instance from configuration.
      Parameters:
      config - used to configure the new instance
      Returns:
      a new instance configured from configuration
    • create

      static SecurityHandlerConfig create()
      Create a new instance with default values.
      Returns:
      a new instance
    • rolesAllowed

      Set<String> rolesAllowed()
      An array of allowed roles for this path - must have a security provider supporting roles (either authentication or authorization provider). This method enables authentication and authorization (you can disable them again by calling SecurityHandler.skipAuthorization() and authenticationOptional() if needed).
      Returns:
      if subject is any of these roles, allow access
    • authenticator

      Optional<String> authenticator()
      Use a named authenticator (as supported by security - if not defined, default authenticator is used). Will enable authentication.
      Returns:
      name of authenticator as configured in Security
    • authorizer

      Optional<String> authorizer()
      Use a named authorizer (as supported by security - if not defined, default authorizer is used, if none defined, all is permitted). Will enable authorization.
      Returns:
      name of authorizer as configured in Security
    • authenticate

      Optional<Boolean> authenticate()
      If called, request will go through authentication process - defaults to false (even if authorize is true).
      Returns:
      whether to authenticate or not
    • authenticationOptional

      Optional<Boolean> authenticationOptional()
      If called, authentication failure will not abort request and will continue as anonymous (defaults to false).
      Returns:
      whether authn is optional
    • audit

      Optional<Boolean> audit()
      Whether to audit this request - defaults to false, if enabled, request is audited with event type "request".
      Returns:
      whether to audit
    • authorize

      Optional<Boolean> authorize()
      Enable authorization for this route.
      Returns:
      whether to authorize
    • auditEventType

      Optional<String> auditEventType()
      Override for event-type, defaults to "request".
      Returns:
      audit event type to use
    • auditMessageFormat

      Optional<String> auditMessageFormat()
      Override for audit message format, defaults to "%3$s %1$s \"%2$s\" %5$s %6$s requested by %4$s".
      Returns:
      audit message format to use
    • queryParams

      Query parameter handler(s).
      Returns:
      query parameters
    • customObjects

      A store of custom objects, that can be used to customize specific security providers.
      Returns:
      custom objects
    • sockets

      List<String> sockets()
      List of sockets this configuration should be applied to. If empty, the configuration is applied to all configured sockets.
      Returns:
      list of sockets
    • config

      Optional<Config> config()
      Configuration associated with this security handler.
      Returns:
      the configuration (if provided)
    • combined

      boolean combined()
      Whether this is a combined handler. Internal use.
      Returns:
      if combined handler