Skip to content

Commit

Permalink
downgrade java-jwt dependency to 3.10.2 (#902)
Browse files Browse the repository at this point in the history
Keeping java-jwt dependency version at 3.10.2 to solve #900
  • Loading branch information
mantas-sidlauskas authored May 22, 2024
1 parent b0738bb commit 1cfbe26
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ dependencies {
compile group: 'com.cronutils', name: 'cron-utils', version: '9.2.0'
compile group: 'io.micrometer', name: 'micrometer-core', version: '1.10.2'
compile group: 'javax.annotation', name: 'javax.annotation-api', version: '1.3.2'
compile group: 'com.auth0', name: 'java-jwt', version:'4.4.0'
compile group: 'com.auth0', name: 'java-jwt', version:'3.10.2'
compile group: 'com.google.protobuf', name: 'protobuf-java', version: '3.21.9'
compile group: 'com.google.api.grpc', name: 'proto-google-common-protos', version: '2.10.0'
compile group: 'com.google.protobuf', name: 'protobuf-java-util', version: '3.21.9'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.nio.charset.StandardCharsets;
import java.security.interfaces.RSAPrivateKey;
import java.security.interfaces.RSAPublicKey;
import java.sql.Date;
import java.time.Instant;

public class AdminJwtAuthorizationProvider implements IAuthorizationProvider {
Expand All @@ -42,8 +43,8 @@ public byte[] getAuthToken() {
int JWT_TTL_SECONDS = 60 * 10;
jwtBuilder.withClaim("admin", true);
jwtBuilder.withClaim("ttl", JWT_TTL_SECONDS);
jwtBuilder.withIssuedAt(now);
jwtBuilder.withExpiresAt(now.plusSeconds(JWT_TTL_SECONDS));
jwtBuilder.withIssuedAt(Date.from(now));
jwtBuilder.withExpiresAt(Date.from(now.plusSeconds(JWT_TTL_SECONDS)));
return jwtBuilder
.sign(Algorithm.RSA256(this.rsaPublicKey, this.rsaPrivateKey))
.getBytes(StandardCharsets.UTF_8);
Expand Down

0 comments on commit 1cfbe26

Please sign in to comment.