-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(pollux): [ATL-2733] Allow for dates in seconds for exp, iss and …
…iat (#249)
- Loading branch information
1 parent
784ef50
commit 01af7c8
Showing
4 changed files
with
31 additions
and
8 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
pollux/lib/vc-jwt/src/main/scala/io/iohk/atala/pollux/vc/jwt/InstantDecoderEncoder.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package io.iohk.atala.pollux.vc.jwt | ||
|
||
import io.circe.{Decoder, Encoder, HCursor} | ||
|
||
import java.time.Instant | ||
|
||
object InstantDecoderEncoder { | ||
implicit val instantToEpochSecondsEncoder: Encoder[Instant] = | ||
(instant: Instant) => Encoder.encodeLong(instant.getEpochSecond) | ||
|
||
implicit val epochSecondsToInstantDecoder: Decoder[Instant] = | ||
(c: HCursor) => Decoder.decodeLong.map(s => Instant.ofEpochSecond(s)).apply(c) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters