Package io.helidon.security.util
Class TokenHandler.Builder
- java.lang.Object
-
- io.helidon.security.util.TokenHandler.Builder
-
- All Implemented Interfaces:
Builder<TokenHandler>
,Supplier<TokenHandler>
- Enclosing class:
- TokenHandler
public static final class TokenHandler.Builder extends Object implements Builder<TokenHandler>
Fluent API builder to createTokenHandler
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TokenHandler
build()
Build a new instance from this builder.TokenHandler.Builder
config(Config config)
Update builder from config.TokenHandler.Builder
tokenFormat(String format)
Token format for creating outbound tokens.TokenHandler.Builder
tokenHeader(String header)
Set the name of header to look into to extract the token.TokenHandler.Builder
tokenPattern(Pattern pattern)
Set the token pattern (Regular expression) to extract the token.TokenHandler.Builder
tokenPrefix(String prefix)
Set the prefix of header value to extract the token.
-
-
-
Method Detail
-
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 interfaceBuilder<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 toString.format(String, Object...)
, token will be a single string parameter- Returns:
- updated builder instance
-
-