mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-22 16:41:46 +03:00
[ANY] Update JWT library (#706)
Co-authored-by: d3coder <admin@xakeps.dk>
This commit is contained in:
parent
7759ea9182
commit
3926f3e5bf
6 changed files with 7 additions and 7 deletions
|
@ -132,7 +132,7 @@ public static class HardwareInfoTokenVerifier implements RestoreResponse.Extende
|
||||||
private final JwtParser parser;
|
private final JwtParser parser;
|
||||||
|
|
||||||
public HardwareInfoTokenVerifier(LaunchServer server) {
|
public HardwareInfoTokenVerifier(LaunchServer server) {
|
||||||
this.parser = Jwts.parserBuilder()
|
this.parser = Jwts.parser()
|
||||||
.requireIssuer("LaunchServer")
|
.requireIssuer("LaunchServer")
|
||||||
.setSigningKey(server.keyAgreementManager.ecdsaPublicKey)
|
.setSigningKey(server.keyAgreementManager.ecdsaPublicKey)
|
||||||
.build();
|
.build();
|
||||||
|
@ -164,7 +164,7 @@ public static class PublicKeyTokenVerifier implements RestoreResponse.ExtendedTo
|
||||||
private final JwtParser parser;
|
private final JwtParser parser;
|
||||||
|
|
||||||
public PublicKeyTokenVerifier(LaunchServer server) {
|
public PublicKeyTokenVerifier(LaunchServer server) {
|
||||||
this.parser = Jwts.parserBuilder()
|
this.parser = Jwts.parser()
|
||||||
.requireIssuer("LaunchServer")
|
.requireIssuer("LaunchServer")
|
||||||
.setSigningKey(server.keyAgreementManager.ecdsaPublicKey)
|
.setSigningKey(server.keyAgreementManager.ecdsaPublicKey)
|
||||||
.build();
|
.build();
|
||||||
|
|
|
@ -18,7 +18,7 @@ public TokenCommand(LaunchServer server) {
|
||||||
@Override
|
@Override
|
||||||
public void invoke(String... args) throws Exception {
|
public void invoke(String... args) throws Exception {
|
||||||
verifyArgs(args, 1);
|
verifyArgs(args, 1);
|
||||||
var parser = Jwts.parserBuilder().setSigningKey(server.keyAgreementManager.ecdsaPublicKey).build();
|
var parser = Jwts.parser().setSigningKey(server.keyAgreementManager.ecdsaPublicKey).build();
|
||||||
var claims = parser.parseClaimsJws(args[0]);
|
var claims = parser.parseClaimsJws(args[0]);
|
||||||
logger.info("Token: {}", claims.getBody());
|
logger.info("Token: {}", claims.getBody());
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ public static String makeAccessJwtTokenFromString(User user, LocalDateTime expir
|
||||||
}
|
}
|
||||||
|
|
||||||
public static JwtTokenInfo getJwtInfoFromAccessToken(String token, ECPublicKey publicKey) {
|
public static JwtTokenInfo getJwtInfoFromAccessToken(String token, ECPublicKey publicKey) {
|
||||||
var parser = Jwts.parserBuilder()
|
var parser = Jwts.parser()
|
||||||
.requireIssuer("LaunchServer")
|
.requireIssuer("LaunchServer")
|
||||||
.setClock(() -> new Date(Clock.systemUTC().millis()))
|
.setClock(() -> new Date(Clock.systemUTC().millis()))
|
||||||
.setSigningKey(publicKey)
|
.setSigningKey(publicKey)
|
||||||
|
|
|
@ -38,7 +38,7 @@ public class AuthManager {
|
||||||
|
|
||||||
public AuthManager(LaunchServer server) {
|
public AuthManager(LaunchServer server) {
|
||||||
this.server = server;
|
this.server = server;
|
||||||
this.checkServerTokenParser = Jwts.parserBuilder()
|
this.checkServerTokenParser = Jwts.parser()
|
||||||
.requireIssuer("LaunchServer")
|
.requireIssuer("LaunchServer")
|
||||||
.require("tokenType", "checkServer")
|
.require("tokenType", "checkServer")
|
||||||
.setSigningKey(server.keyAgreementManager.ecdsaPublicKey)
|
.setSigningKey(server.keyAgreementManager.ecdsaPublicKey)
|
||||||
|
|
|
@ -89,7 +89,7 @@ public static class LauncherTokenVerifier implements RestoreResponse.ExtendedTok
|
||||||
private final Logger logger = LogManager.getLogger();
|
private final Logger logger = LogManager.getLogger();
|
||||||
|
|
||||||
public LauncherTokenVerifier(LaunchServer server) {
|
public LauncherTokenVerifier(LaunchServer server) {
|
||||||
parser = Jwts.parserBuilder()
|
parser = Jwts.parser()
|
||||||
.setSigningKey(server.keyAgreementManager.ecdsaPublicKey)
|
.setSigningKey(server.keyAgreementManager.ecdsaPublicKey)
|
||||||
.requireIssuer("LaunchServer")
|
.requireIssuer("LaunchServer")
|
||||||
.build();
|
.build();
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
verGuavaC = '30.1.1-jre'
|
verGuavaC = '30.1.1-jre'
|
||||||
verJansi = '2.4.1'
|
verJansi = '2.4.1'
|
||||||
verJline = '3.25.0'
|
verJline = '3.25.0'
|
||||||
verJwt = '0.11.5'
|
verJwt = '0.12.5'
|
||||||
verBcprov = '1.70'
|
verBcprov = '1.70'
|
||||||
verGson = '2.10.1'
|
verGson = '2.10.1'
|
||||||
verBcpkix = '1.70'
|
verBcpkix = '1.70'
|
||||||
|
|
Loading…
Reference in a new issue