Skip to content

Commit

Permalink
Bump version to 3.1.5, add explicit Jackson serializer configuration …
Browse files Browse the repository at this point in the history
…for ZonedDateTime fields in case anyone wants to serialize the object directly with a Jackson ObjectMapper.
  • Loading branch information
robotdan committed Oct 30, 2019
1 parent e694e68 commit 97060b4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.savant
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
savantVersion = "1.0.0"
jacksonVersion = "2.10.0"

project(group: "io.fusionauth", name: "fusionauth-jwt", version: "3.1.4", licenses: ["ApacheV2_0"]) {
project(group: "io.fusionauth", name: "fusionauth-jwt", version: "3.1.5", licenses: ["ApacheV2_0"]) {

workflow {
standard()
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>io.fusionauth</groupId>
<artifactId>fusionauth-jwt</artifactId>
<version>3.1.4</version>
<version>3.1.5</version>
<packaging>jar</packaging>

<name>FusionAuth JWT</name>
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/io/fusionauth/jwt/domain/JWT.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.fusionauth.jwt.JWTDecoder;
import io.fusionauth.jwt.JWTEncoder;
import io.fusionauth.jwt.json.Mapper;
import io.fusionauth.jwt.json.ZonedDateTimeSerializer;

import java.math.BigDecimal;
import java.math.BigInteger;
Expand Down Expand Up @@ -63,6 +65,7 @@ public class JWT {
* processing. The expiration time is expected to provided in UNIX time, or the number of seconds since Epoch.
*/
@JsonProperty("exp")
@JsonSerialize(using = ZonedDateTimeSerializer.class)
public ZonedDateTime expiration;

/**
Expand All @@ -72,6 +75,7 @@ public class JWT {
* UNIX time, or the number of seconds since Epoch.
*/
@JsonProperty("iat")
@JsonSerialize(using = ZonedDateTimeSerializer.class)
public ZonedDateTime issuedAt;

/**
Expand All @@ -90,6 +94,7 @@ public class JWT {
* expected to provided in UNIX time, or the number of seconds since Epoch.
*/
@JsonProperty("nbf")
@JsonSerialize(using = ZonedDateTimeSerializer.class)
public ZonedDateTime notBefore;

/**
Expand Down

0 comments on commit 97060b4

Please sign in to comment.