mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-11-15 03:31:15 +03:00
Merge branch 'release/5.2.4'
This commit is contained in:
commit
39bdab50ca
9 changed files with 37 additions and 16 deletions
|
@ -72,7 +72,7 @@ public static void main(String[] args) throws Exception {
|
||||||
{
|
{
|
||||||
LauncherTrustManager.CheckClassResult result = certificateManager.checkClass(LaunchServer.class);
|
LauncherTrustManager.CheckClassResult result = certificateManager.checkClass(LaunchServer.class);
|
||||||
if (result.type == LauncherTrustManager.CheckClassResultType.SUCCESS) {
|
if (result.type == LauncherTrustManager.CheckClassResultType.SUCCESS) {
|
||||||
logger.info("LaunchServer signed by {}", result.endCertificate.getSubjectDN().getName());
|
logger.info("LaunchServer signed by {}", result.endCertificate.getSubjectX500Principal().getName());
|
||||||
} else if (result.type == LauncherTrustManager.CheckClassResultType.NOT_SIGNED) {
|
} else if (result.type == LauncherTrustManager.CheckClassResultType.NOT_SIGNED) {
|
||||||
// None
|
// None
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -306,7 +306,8 @@ public void invoke(String... args) throws Exception {
|
||||||
} else {
|
} else {
|
||||||
password = new AuthPlainPassword(plainPassword);
|
password = new AuthPlainPassword(plainPassword);
|
||||||
}
|
}
|
||||||
instance.registration(username, email, password, map);
|
User user = instance.registration(username, email, password, map);
|
||||||
|
logger.info("User '{}' registered", user.toString());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,11 +47,11 @@ public void invoke(String... args) {
|
||||||
private void printCheckStatusInfo(LauncherTrustManager.CheckClassResult checkStatus) {
|
private void printCheckStatusInfo(LauncherTrustManager.CheckClassResult checkStatus) {
|
||||||
if (checkStatus != null && checkStatus.endCertificate != null) {
|
if (checkStatus != null && checkStatus.endCertificate != null) {
|
||||||
X509Certificate cert = checkStatus.endCertificate;
|
X509Certificate cert = checkStatus.endCertificate;
|
||||||
logger.info("[MODULE CERT] Module signer: {}", cert.getSubjectDN().getName());
|
logger.info("[MODULE CERT] Module signer: {}", cert.getSubjectX500Principal().getName());
|
||||||
}
|
}
|
||||||
if (checkStatus != null && checkStatus.rootCertificate != null) {
|
if (checkStatus != null && checkStatus.rootCertificate != null) {
|
||||||
X509Certificate cert = checkStatus.rootCertificate;
|
X509Certificate cert = checkStatus.rootCertificate;
|
||||||
logger.info("[MODULE CERT] Module signer CA: {}", cert.getSubjectDN().getName());
|
logger.info("[MODULE CERT] Module signer CA: {}", cert.getSubjectX500Principal().getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,9 @@
|
||||||
import io.jsonwebtoken.Jwts;
|
import io.jsonwebtoken.Jwts;
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import pro.gravit.launcher.profiles.ClientProfile;
|
||||||
import pro.gravit.launchserver.LaunchServer;
|
import pro.gravit.launchserver.LaunchServer;
|
||||||
|
import pro.gravit.launchserver.auth.AuthProviderPair;
|
||||||
import pro.gravit.launchserver.command.Command;
|
import pro.gravit.launchserver.command.Command;
|
||||||
import pro.gravit.utils.command.SubCommand;
|
import pro.gravit.utils.command.SubCommand;
|
||||||
|
|
||||||
|
@ -20,11 +22,26 @@ public void invoke(String... args) throws Exception {
|
||||||
logger.info("Token: {}", claims.getBody());
|
logger.info("Token: {}", claims.getBody());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.childCommands.put("server", new SubCommand("[serverName] (authId)", "generate new server token") {
|
this.childCommands.put("server", new SubCommand("[profileName] (authId)", "generate new server token") {
|
||||||
@Override
|
@Override
|
||||||
public void invoke(String... args) throws Exception {
|
public void invoke(String... args) throws Exception {
|
||||||
String token = server.authManager.newCheckServerToken(args[0], args.length > 1 ? args[1] : server.config.getAuthProviderPair().name);
|
AuthProviderPair pair = args.length > 1 ? server.config.getAuthProviderPair(args[1]) : server.config.getAuthProviderPair();
|
||||||
logger.info("Token: {}", token);
|
ClientProfile profile = null;
|
||||||
|
for(ClientProfile p : server.getProfiles()) {
|
||||||
|
if(p.getTitle().equals(args[0])) {
|
||||||
|
profile = p;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(profile == null) {
|
||||||
|
logger.warn("Profile {} not found", args[0]);
|
||||||
|
}
|
||||||
|
if(pair == null) {
|
||||||
|
logger.error("AuthId {} not found", args[1]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String token = server.authManager.newCheckServerToken(args[0], pair.name);
|
||||||
|
logger.info("Server token {} authId {}: {}", args[0], pair.name, token);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,11 +31,13 @@ public void execute(ChannelHandlerContext ctx, Client pClient) {
|
||||||
try {
|
try {
|
||||||
server.authHookManager.checkServerHook.hook(this, pClient);
|
server.authHookManager.checkServerHook.hook(this, pClient);
|
||||||
AuthManager.CheckServerReport report = server.authManager.checkServer(pClient, username, serverID);
|
AuthManager.CheckServerReport report = server.authManager.checkServer(pClient, username, serverID);
|
||||||
if (report != null) {
|
if(report == null) {
|
||||||
result.playerProfile = report.playerProfile;
|
sendError("User not verified");
|
||||||
result.uuid = report.uuid;
|
return;
|
||||||
logger.debug("checkServer: {} uuid: {} serverID: {}", result.playerProfile == null ? null : result.playerProfile.username, result.uuid, serverID);
|
|
||||||
}
|
}
|
||||||
|
result.playerProfile = report.playerProfile;
|
||||||
|
result.uuid = report.uuid;
|
||||||
|
logger.debug("checkServer: {} uuid: {} serverID: {}", result.playerProfile == null ? null : result.playerProfile.username, result.uuid, serverID);
|
||||||
} catch (AuthException | HookException e) {
|
} catch (AuthException | HookException e) {
|
||||||
sendError(e.getMessage());
|
sendError(e.getMessage());
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -6,7 +6,7 @@ public final class Version implements Comparable<Version> {
|
||||||
|
|
||||||
public static final int MAJOR = 5;
|
public static final int MAJOR = 5;
|
||||||
public static final int MINOR = 2;
|
public static final int MINOR = 2;
|
||||||
public static final int PATCH = 3;
|
public static final int PATCH = 4;
|
||||||
public static final int BUILD = 1;
|
public static final int BUILD = 1;
|
||||||
public static final Version.Type RELEASE = Type.STABLE;
|
public static final Version.Type RELEASE = Type.STABLE;
|
||||||
public final int major;
|
public final int major;
|
||||||
|
|
|
@ -93,6 +93,7 @@ public ProfilesRequestEvent getProfiles() throws Exception {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("ConfusingArgumentToVarargsMethod")
|
||||||
public void run(String... args) throws Throwable {
|
public void run(String... args) throws Throwable {
|
||||||
initGson();
|
initGson();
|
||||||
AuthRequest.registerProviders();
|
AuthRequest.registerProviders();
|
||||||
|
@ -173,9 +174,9 @@ public void run(String... args) throws Throwable {
|
||||||
System.arraycopy(args, 1, real_args, 0, args.length - 1);
|
System.arraycopy(args, 1, real_args, 0, args.length - 1);
|
||||||
} else real_args = args;
|
} else real_args = args;
|
||||||
|
|
||||||
mainMethod.invoke((Object) real_args);
|
mainMethod.invokeWithArguments(real_args);
|
||||||
} else {
|
} else {
|
||||||
mainMethod.invoke((Object) config.args.toArray(new String[0]));
|
mainMethod.invokeWithArguments(config.args.toArray(new String[0]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
id 'org.openjfx.javafxplugin' version '0.0.10' apply false
|
id 'org.openjfx.javafxplugin' version '0.0.10' apply false
|
||||||
}
|
}
|
||||||
group = 'pro.gravit.launcher'
|
group = 'pro.gravit.launcher'
|
||||||
version = '5.2.3'
|
version = '5.2.4'
|
||||||
|
|
||||||
apply from: 'props.gradle'
|
apply from: 'props.gradle'
|
||||||
|
|
||||||
|
|
2
modules
2
modules
|
@ -1 +1 @@
|
||||||
Subproject commit bfcab2ff667d9a53fdee2a9d2fd8d5246eb619b2
|
Subproject commit fd75e8dfa26a3103f03e4e6e6e3eb1c6e6a4ba1a
|
Loading…
Reference in a new issue