- java.lang.Object
-
- io.helidon.security.jwt.Jwt.IssueTimeValidator
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Jwt.IssueTimeValidator
create()
New instance with default values (allowed time skew 5 seconds, optional).static Jwt.IssueTimeValidator
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.IssueTimeValidator create()
New instance with default values (allowed time skew 5 seconds, optional).- Returns:
- issue time validator with defaults
-
create
public static Jwt.IssueTimeValidator 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:
- configured issue 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
-
-