added smokeTests for argon2 parameters
This commit is contained in:
parent
1e231013b0
commit
fcaf315549
1 changed files with 24 additions and 0 deletions
|
@ -29,6 +29,9 @@ public class ConfigurationPropertiesSmokeTests implements
|
|||
private static final String PROPERTY_LANGUAGE_SELECTABLE = "languages.selectableLocales";
|
||||
private static final String PROPERTY_LANGUAGE_FORCE = "languages.forceLocale";
|
||||
private static final String PROPERTY_LANGUAGE_FILTER = "RDFService.languageFilter";
|
||||
private static final String PROPERTY_ARGON2_TIME = "argon2.time";
|
||||
private static final String PROPERTY_ARGON2_MEMORY = "argon2.memory";
|
||||
private static final String PROPERTY_ARGON2_PARALLELISM = "argon2.parallelism";
|
||||
|
||||
@Override
|
||||
public void contextInitialized(ServletContextEvent sce) {
|
||||
|
@ -38,6 +41,7 @@ public class ConfigurationPropertiesSmokeTests implements
|
|||
|
||||
checkDefaultNamespace(ctx, props, ss);
|
||||
checkLanguages(props, ss);
|
||||
checkEncryptionParameters(props, ss);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -122,6 +126,26 @@ public class ConfigurationPropertiesSmokeTests implements
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fail if there are no config properties for the Argon2 encryption.
|
||||
*/
|
||||
private void checkEncryptionParameters(ConfigurationProperties props,
|
||||
StartupStatus ss) {
|
||||
failIfNotPresent(props, ss, PROPERTY_ARGON2_TIME);
|
||||
failIfNotPresent(props, ss, PROPERTY_ARGON2_MEMORY);
|
||||
failIfNotPresent(props, ss, PROPERTY_ARGON2_PARALLELISM);
|
||||
}
|
||||
|
||||
private void failIfNotPresent(ConfigurationProperties props,
|
||||
StartupStatus ss, String name) {
|
||||
String value = props.getProperty(name);
|
||||
if (value == null || value.isEmpty()) {
|
||||
ss.fatal(this, "runtime.properties does not contain a value for '"
|
||||
+ name + "'");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void contextDestroyed(ServletContextEvent sce) {
|
||||
// nothing to do at shutdown
|
||||
|
|
Loading…
Add table
Reference in a new issue