Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicit jackson serializer for jwt token provider #7580

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ethereum/executionclient/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dependencies {
implementation 'io.jsonwebtoken:jjwt-api'

runtimeOnly 'io.jsonwebtoken:jjwt-impl'
runtimeOnly 'io.jsonwebtoken:jjwt-jackson'
implementation 'io.jsonwebtoken:jjwt-jackson'

testImplementation testFixtures(project(':infrastructure:async'))
testImplementation testFixtures(project(':infrastructure:time'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm;
import io.jsonwebtoken.jackson.io.JacksonSerializer;
import java.time.Instant;
import java.util.Date;
import java.util.Optional;
Expand All @@ -35,6 +36,7 @@ public Optional<Token> token(final UInt64 instantInMillis) {
Jwts.builder()
.setIssuedAt(Date.from(Instant.ofEpochMilli(instantInMillis.longValue())))
.signWith(jwtConfig.getKey(), SignatureAlgorithm.HS256)
.serializeToJsonWith(new JacksonSerializer<>())
.compact();
return Optional.of(new Token(jwtToken, expiry));
}
Expand Down
Loading