Class TokenHandler.Builder

java.lang.Object
io.helidon.security.util.TokenHandler.Builder
All Implemented Interfaces:
Builder<TokenHandler.Builder,TokenHandler>, Supplier<TokenHandler>
Enclosing class:
TokenHandler

public static final class TokenHandler.Builder extends Object implements Builder<TokenHandler.Builder,TokenHandler>
Fluent API builder to create TokenHandler.
  • Method Details

    • tokenHeader

      public TokenHandler.Builder tokenHeader(String header)
      Set the name of header to look into to extract the token.
      Parameters:
      header - header name (such as Authorization), case insensitive
      Returns:
      updated builder instance
    • tokenPrefix

      public TokenHandler.Builder tokenPrefix(String prefix)
      Set the prefix of header value to extract the token.
      Parameters:
      prefix - prefix of header value to strip from it, case insensitive
      Returns:
      updated builder instance
    • tokenPattern

      public TokenHandler.Builder tokenPattern(Pattern pattern)
      Set the token pattern (Regular expression) to extract the token.
      Parameters:
      pattern - pattern to use to extract the token, first group will be used
      Returns:
      updated builder instance
    • build

      public TokenHandler build()
      Build a new instance from this builder.
      Specified by:
      build in interface Builder<TokenHandler.Builder,TokenHandler>
      Returns:
      instance built based on this builder
    • config

      public TokenHandler.Builder config(Config config)
      Update builder from config.
      Parameters:
      config - Configuration to update from
      Returns:
      update builder instance
    • tokenFormat

      public TokenHandler.Builder tokenFormat(String format)
      Token format for creating outbound tokens.
      Parameters:
      format - Format according to String.format(String, Object...), token will be a single string parameter
      Returns:
      updated builder instance