mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-09-29 15:07:45 +02:00
Move salt column configuration to the other column configs
This commit is contained in:
parent
c4b02d74b7
commit
68b896cfc3
@ -1,5 +1,5 @@
|
|||||||
<!-- AUTO-GENERATED FILE! Do not edit this directly -->
|
<!-- AUTO-GENERATED FILE! Do not edit this directly -->
|
||||||
<!-- File auto-generated on Sun Apr 22 11:00:10 CEST 2018. See docs/config/config.tpl.md -->
|
<!-- File auto-generated on Mon May 21 09:08:25 CEST 2018. See docs/config/config.tpl.md -->
|
||||||
|
|
||||||
## AuthMe Configuration
|
## AuthMe Configuration
|
||||||
The first time you run AuthMe it will create a config.yml file in the plugins/AuthMe folder,
|
The first time you run AuthMe it will create a config.yml file in the plugins/AuthMe folder,
|
||||||
@ -37,6 +37,8 @@ DataSource:
|
|||||||
mySQLRealName: 'realname'
|
mySQLRealName: 'realname'
|
||||||
# Column for storing players passwords
|
# Column for storing players passwords
|
||||||
mySQLColumnPassword: 'password'
|
mySQLColumnPassword: 'password'
|
||||||
|
# Column for storing players passwords salts
|
||||||
|
mySQLColumnSalt: ''
|
||||||
# Column for storing players emails
|
# Column for storing players emails
|
||||||
mySQLColumnEmail: 'email'
|
mySQLColumnEmail: 'email'
|
||||||
# Column for storing if a player is logged in or not
|
# Column for storing if a player is logged in or not
|
||||||
@ -71,8 +73,6 @@ DataSource:
|
|||||||
# You should set this at least 30 seconds less than mysql server wait_timeout
|
# You should set this at least 30 seconds less than mysql server wait_timeout
|
||||||
maxLifetime: 1800
|
maxLifetime: 1800
|
||||||
ExternalBoardOptions:
|
ExternalBoardOptions:
|
||||||
# Column for storing players passwords salts
|
|
||||||
mySQLColumnSalt: ''
|
|
||||||
# Column for storing players groups
|
# Column for storing players groups
|
||||||
mySQLColumnGroup: ''
|
mySQLColumnGroup: ''
|
||||||
# -1 means disabled. If you want that only activated players
|
# -1 means disabled. If you want that only activated players
|
||||||
@ -562,4 +562,4 @@ To change settings on a running server, save your changes to config.yml and use
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
This page was automatically generated on the [AuthMe/AuthMeReloaded repository](https://github.com/AuthMe/AuthMeReloaded/tree/master/docs/) on Sun Apr 22 11:00:10 CEST 2018
|
This page was automatically generated on the [AuthMe/AuthMeReloaded repository](https://github.com/AuthMe/AuthMeReloaded/tree/master/docs/) on Mon May 21 09:08:25 CEST 2018
|
||||||
|
@ -10,6 +10,7 @@ import fr.xephi.authme.output.LogLevel;
|
|||||||
import fr.xephi.authme.process.register.RegisterSecondaryArgument;
|
import fr.xephi.authme.process.register.RegisterSecondaryArgument;
|
||||||
import fr.xephi.authme.process.register.RegistrationType;
|
import fr.xephi.authme.process.register.RegistrationType;
|
||||||
import fr.xephi.authme.security.HashAlgorithm;
|
import fr.xephi.authme.security.HashAlgorithm;
|
||||||
|
import fr.xephi.authme.settings.properties.DatabaseSettings;
|
||||||
import fr.xephi.authme.settings.properties.PluginSettings;
|
import fr.xephi.authme.settings.properties.PluginSettings;
|
||||||
import fr.xephi.authme.settings.properties.RegistrationSettings;
|
import fr.xephi.authme.settings.properties.RegistrationSettings;
|
||||||
import fr.xephi.authme.settings.properties.SecuritySettings;
|
import fr.xephi.authme.settings.properties.SecuritySettings;
|
||||||
@ -74,6 +75,7 @@ public class SettingsMigrationService extends PlainMigrationService {
|
|||||||
| convertToRegistrationType(resource)
|
| convertToRegistrationType(resource)
|
||||||
| mergeAndMovePermissionGroupSettings(resource)
|
| mergeAndMovePermissionGroupSettings(resource)
|
||||||
| moveDeprecatedHashAlgorithmIntoLegacySection(resource)
|
| moveDeprecatedHashAlgorithmIntoLegacySection(resource)
|
||||||
|
| moveSaltColumnConfigWithOtherColumnConfigs(resource)
|
||||||
|| hasDeprecatedProperties(resource);
|
|| hasDeprecatedProperties(resource);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -313,6 +315,18 @@ public class SettingsMigrationService extends PlainMigrationService {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Moves the property for the password salt column name to the same path as all other column name properties.
|
||||||
|
*
|
||||||
|
* @param resource The property resource
|
||||||
|
* @return True if the configuration has changed, false otherwise
|
||||||
|
*/
|
||||||
|
private static boolean moveSaltColumnConfigWithOtherColumnConfigs(PropertyResource resource) {
|
||||||
|
Property<String> oldProperty = newProperty("ExternalBoardOptions.mySQLColumnSalt",
|
||||||
|
DatabaseSettings.MYSQL_COL_SALT.getDefaultValue());
|
||||||
|
return moveProperty(oldProperty, DatabaseSettings.MYSQL_COL_SALT, resource);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the old config to run a command when alt accounts are detected and sets them to this instance
|
* Retrieves the old config to run a command when alt accounts are detected and sets them to this instance
|
||||||
* for further processing.
|
* for further processing.
|
||||||
|
@ -65,7 +65,7 @@ public final class DatabaseSettings implements SettingsHolder {
|
|||||||
|
|
||||||
@Comment("Column for storing players passwords salts")
|
@Comment("Column for storing players passwords salts")
|
||||||
public static final Property<String> MYSQL_COL_SALT =
|
public static final Property<String> MYSQL_COL_SALT =
|
||||||
newProperty("ExternalBoardOptions.mySQLColumnSalt", "");
|
newProperty("DataSource.mySQLColumnSalt", "");
|
||||||
|
|
||||||
@Comment("Column for storing players emails")
|
@Comment("Column for storing players emails")
|
||||||
public static final Property<String> MYSQL_COL_EMAIL =
|
public static final Property<String> MYSQL_COL_EMAIL =
|
||||||
|
@ -24,6 +24,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static fr.xephi.authme.TestHelper.getJarFile;
|
import static fr.xephi.authme.TestHelper.getJarFile;
|
||||||
|
import static fr.xephi.authme.settings.properties.DatabaseSettings.MYSQL_COL_SALT;
|
||||||
import static fr.xephi.authme.settings.properties.PluginSettings.ENABLE_PERMISSION_CHECK;
|
import static fr.xephi.authme.settings.properties.PluginSettings.ENABLE_PERMISSION_CHECK;
|
||||||
import static fr.xephi.authme.settings.properties.PluginSettings.LOG_LEVEL;
|
import static fr.xephi.authme.settings.properties.PluginSettings.LOG_LEVEL;
|
||||||
import static fr.xephi.authme.settings.properties.PluginSettings.REGISTERED_GROUP;
|
import static fr.xephi.authme.settings.properties.PluginSettings.REGISTERED_GROUP;
|
||||||
@ -128,6 +129,7 @@ public class SettingsMigrationServiceTest {
|
|||||||
assertThat(settings.getProperty(UNREGISTERED_GROUP), equalTo(""));
|
assertThat(settings.getProperty(UNREGISTERED_GROUP), equalTo(""));
|
||||||
assertThat(settings.getProperty(PASSWORD_HASH), equalTo(HashAlgorithm.SHA256));
|
assertThat(settings.getProperty(PASSWORD_HASH), equalTo(HashAlgorithm.SHA256));
|
||||||
assertThat(settings.getProperty(LEGACY_HASHES), contains(HashAlgorithm.PBKDF2, HashAlgorithm.WORDPRESS, HashAlgorithm.SHA512));
|
assertThat(settings.getProperty(LEGACY_HASHES), contains(HashAlgorithm.PBKDF2, HashAlgorithm.WORDPRESS, HashAlgorithm.SHA512));
|
||||||
|
assertThat(settings.getProperty(MYSQL_COL_SALT), equalTo("salt_col_name"));
|
||||||
|
|
||||||
// Check migration of old setting to email.html
|
// Check migration of old setting to email.html
|
||||||
assertThat(Files.readLines(new File(dataFolder, "email.html"), StandardCharsets.UTF_8),
|
assertThat(Files.readLines(new File(dataFolder, "email.html"), StandardCharsets.UTF_8),
|
||||||
|
@ -275,7 +275,7 @@ settings:
|
|||||||
applyBlindEffect: false
|
applyBlindEffect: false
|
||||||
ExternalBoardOptions:
|
ExternalBoardOptions:
|
||||||
# MySQL column for the salt , needed for some forum/cms support
|
# MySQL column for the salt , needed for some forum/cms support
|
||||||
mySQLColumnSalt: ''
|
mySQLColumnSalt: 'salt_col_name'
|
||||||
# MySQL column for the group, needed for some forum/cms support
|
# MySQL column for the group, needed for some forum/cms support
|
||||||
mySQLColumnGroup: ''
|
mySQLColumnGroup: ''
|
||||||
# -1 mean disabled. If u want that only
|
# -1 mean disabled. If u want that only
|
||||||
|
Loading…
Reference in New Issue
Block a user