[FIX] Удаление whitelist профиля

This commit is contained in:
Gravit 2020-03-22 03:48:48 +07:00
parent 0ddf04b6aa
commit 58a208a3f5
No known key found for this signature in database
GPG key ID: 061981E1E85D3216
5 changed files with 0 additions and 34 deletions

View file

@ -74,7 +74,6 @@ public AuthProviderPair getAuthProviderPair() {
public ExeConf launch4j;
public NettyConfig netty;
public String whitelistRejectString;
public LauncherConf launcher;
public CertificateConf certificate;
public JarSignerConf sign;
@ -282,7 +281,6 @@ public static LaunchServerConfig getDefault(LaunchServer.LaunchServerEnv env) {
newConfig.auth.put("std", a);
newConfig.protectHandler = new StdProtectHandler();
newConfig.binaryName = "Launcher";
newConfig.whitelistRejectString = "Вас нет в белом списке";
newConfig.netty = new NettyConfig();
newConfig.netty.fileServerEnabled = true;

View file

@ -82,15 +82,6 @@ public void execute(ChannelHandlerContext ctx, Client clientData) throws Excepti
AuthProvider.authError(String.format("Illegal result: '%s'", aresult.username));
return;
}
Collection<ClientProfile> profiles = server.getProfiles();
for (ClientProfile p : profiles) {
if (p.getTitle().equals(client)) {
if (!p.isWhitelistContains(login)) {
throw new AuthException(server.config.whitelistRejectString);
}
clientData.profile = p;
}
}
//if (clientData.profile == null) {
// throw new AuthException("You profile not found");
//}

View file

@ -31,10 +31,6 @@ public void execute(ChannelHandlerContext ctx, Client client) {
Collection<ClientProfile> profiles = server.getProfiles();
for (ClientProfile p : profiles) {
if (p.getTitle().equals(this.client)) {
if (!p.isWhitelistContains(client.username)) {
sendError(server.config.whitelistRejectString);
return;
}
client.profile = p;
sendResult(new SetProfileRequestEvent(p));
return;

View file

@ -24,15 +24,6 @@ public void execute(ChannelHandlerContext ctx, Client client) {
sendError("Access denied");
return;
}
if (!client.permissions.canAdmin) {
for (ClientProfile p : server.getProfiles()) {
if (!client.profile.getTitle().equals(p.getTitle())) continue;
if (!p.isWhitelistContains(client.username)) {
sendError("You don't download this folder");
return;
}
}
}
HashedDir dir = server.updatesDirMap.get(dirName);
if (dir == null) {
sendError(String.format("Directory %s not found", dirName));

View file

@ -120,8 +120,6 @@ public enum ClassLoaderConfig
private final Set<OptionalFile> updateOptional = new HashSet<>();
@LauncherNetworkAPI
private boolean updateFastCheck;
@LauncherNetworkAPI
private boolean useWhitelist;
// Client launcher
@LauncherNetworkAPI
private String mainClass;
@ -132,8 +130,6 @@ public enum ClassLoaderConfig
@LauncherNetworkAPI
private final List<String> clientArgs = new ArrayList<>();
@LauncherNetworkAPI
private final List<String> whitelist = new ArrayList<>();
@LauncherNetworkAPI
public SecurityManagerConfig securityManagerConfig = SecurityManagerConfig.CLIENT;
@LauncherNetworkAPI
public ClassLoaderConfig classLoaderConfig = ClassLoaderConfig.LAUNCHER;
@ -383,12 +379,6 @@ public boolean isUpdateFastCheck() {
}
public boolean isWhitelistContains(String username) {
if (!useWhitelist) return true;
return whitelist.stream().anyMatch(profileCaseSensitive ? e -> e.equals(username) : e -> e.equalsIgnoreCase(username));
}
public void setTitle(String title) {
this.title = title;
}