java.lang.Object
io.helidon.security.jwt.Jwt.IssueTimeValidator
- Enclosing class:
- Jwt
Validator of issue time claim.
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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 Details
-
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
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
-