- java.lang.Object
-
- io.helidon.security.jwt.Jwt.ExpirationValidator
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Jwt.ExpirationValidator
create()
New instance with default values (allowed time skew 5 seconds, optional).static Jwt.ExpirationValidator
create(boolean mandatory)
New instance with default values (allowed time skew 5 seconds).static Jwt.ExpirationValidator
create(Instant now, int allowedTimeSkew, TemporalUnit allowedTimeSkewUnit, boolean mandatory)
New instance with explicit values.void
validate(Jwt token, Errors.Collector collector)
Validate the object against this class's configuration.
-
-
-
Method Detail
-
create
public static Jwt.ExpirationValidator create()
New instance with default values (allowed time skew 5 seconds, optional).- Returns:
- expiration time validator with defaults
-
create
public static Jwt.ExpirationValidator create(boolean mandatory)
New instance with default values (allowed time skew 5 seconds).- Parameters:
mandatory
- if this value is mandatory or not- Returns:
- expiration time validator with defaults
-
create
public static Jwt.ExpirationValidator create(Instant now, int allowedTimeSkew, TemporalUnit allowedTimeSkewUnit, boolean mandatory)
New instance with explicit values.- Parameters:
now
- time to validate against (to be able to validate past tokens)allowedTimeSkew
- allowed time skew amount (such as 5)allowedTimeSkewUnit
- allowed time skew unit (such asChronoUnit.SECONDS
mandatory
- true for mandatory, false for optional- Returns:
- expiration time validator
-
validate
public void validate(Jwt token, Errors.Collector collector)
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
-
-