java.lang.Object
io.helidon.security.jwt.Jwt.FieldValidator
- Enclosing class:
Jwt
@Deprecated(since="4.0.10",
forRemoval=true)
public static final class Jwt.FieldValidator
extends Object
implements Validator<Jwt>
Deprecated, for removal: This API element is subject to removal in a future version.
Validator of a string field obtained from a JWT.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Jwt.FieldValidator
Deprecated, for removal: This API element is subject to removal in a future version.A generic optional field validator based on a function to get the field.static Jwt.FieldValidator
create
(Function<Jwt, Optional<String>> fieldAccessor, String name, String expectedValue, boolean mandatory) Deprecated, for removal: This API element is subject to removal in a future version.A generic field validator based on a function to get the field.static Jwt.FieldValidator
createForHeader
(String fieldKey, String name, String expectedValue) Deprecated, for removal: This API element is subject to removal in a future version.An optional header field validator.static Jwt.FieldValidator
createForHeader
(String fieldKey, String name, String expectedValue, boolean mandatory) Deprecated, for removal: This API element is subject to removal in a future version.A header field validator.static Jwt.FieldValidator
createForPayload
(String fieldKey, String name, String expectedValue) Deprecated, for removal: This API element is subject to removal in a future version.An optional payload field validator.static Jwt.FieldValidator
createForPayload
(String fieldKey, String name, String expectedValue, boolean mandatory) Deprecated, for removal: This API element is subject to removal in a future version.A payload field validator.void
validate
(Jwt token, Errors.Collector collector) Deprecated, for removal: This API element is subject to removal in a future version.Validate the object against this class's configuration.
-
Method Details
-
create
public static Jwt.FieldValidator create(Function<Jwt, Optional<String>> fieldAccessor, String name, String expectedValue) Deprecated, for removal: This API element is subject to removal in a future version.A generic optional field validator based on a function to get the field.- Parameters:
fieldAccessor
- function to extract field from JWTname
- descriptive name of the fieldexpectedValue
- value to expect- Returns:
- validator instance
-
create
public static Jwt.FieldValidator create(Function<Jwt, Optional<String>> fieldAccessor, String name, String expectedValue, boolean mandatory) Deprecated, for removal: This API element is subject to removal in a future version.A generic field validator based on a function to get the field.- Parameters:
fieldAccessor
- function to extract field from JWTname
- descriptive name of the fieldexpectedValue
- value to expectmandatory
- true for mandatory, false for optional- Returns:
- validator instance
-
createForHeader
public static Jwt.FieldValidator createForHeader(String fieldKey, String name, String expectedValue) Deprecated, for removal: This API element is subject to removal in a future version.An optional header field validator.- Parameters:
fieldKey
- name of the header claimname
- descriptive name of the fieldexpectedValue
- value to expect- Returns:
- validator instance
-
createForHeader
public static Jwt.FieldValidator createForHeader(String fieldKey, String name, String expectedValue, boolean mandatory) Deprecated, for removal: This API element is subject to removal in a future version.A header field validator.- Parameters:
fieldKey
- name of the header claimname
- descriptive name of the fieldexpectedValue
- value to expectmandatory
- whether the field is mandatory or optional- Returns:
- validator instance
-
createForPayload
public static Jwt.FieldValidator createForPayload(String fieldKey, String name, String expectedValue) Deprecated, for removal: This API element is subject to removal in a future version.An optional payload field validator.- Parameters:
fieldKey
- name of the payload claimname
- descriptive name of the fieldexpectedValue
- value to expect- Returns:
- validator instance
-
createForPayload
public static Jwt.FieldValidator createForPayload(String fieldKey, String name, String expectedValue, boolean mandatory) Deprecated, for removal: This API element is subject to removal in a future version.A payload field validator.- Parameters:
fieldKey
- name of the payload claimname
- descriptive name of the fieldexpectedValue
- value to expectmandatory
- whether the field is mandatory or optional- Returns:
- validator instance
-
validate
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:Validator
Validate the object against this class's configuration.- Specified by:
validate
in interfaceValidator<Jwt>
- Parameters:
token
- object to validatecollector
- collector of error messages to add problems to. UseErrors.Collector.fatal(Object, String)
to mark the validation as a failure
-
JwtValidator.Builder.addFieldValidator(Consumer)
instead