Class ConfluenceApplicationConfig
java.lang.Object
com.atlassian.config.internal.ApplicationConfig
com.atlassian.confluence.impl.setup.ConfluenceApplicationConfig
- All Implemented Interfaces:
com.atlassian.config.ApplicationConfiguration
public class ConfluenceApplicationConfig
extends com.atlassian.config.internal.ApplicationConfig
Confluence wrapper for ApplicationConfiguration
which allows to mutate
SetupContext setupComplete state as false only during setup process.
Secures all properties named in propertiesToSecure using the SecretService instead of saving them in plaintext.- Since:
- 9.0.0
-
Field Summary
FieldsFields inherited from class com.atlassian.config.internal.ApplicationConfig
configurationPersister, DEFAULT_APPLICATION_HOME, DEFAULT_CONFIG_FILE_NAME, NULL_BOOLEAN_VALUE, NULL_INTEGER_VALUE -
Constructor Summary
ConstructorsConstructorDescriptionConfluenceApplicationConfig(com.atlassian.secrets.api.SecretService secretService) -
Method Summary
Modifier and TypeMethodDescriptionstatic voidenableSecureProperties(com.atlassian.config.ApplicationConfiguration applicationConfiguration) A method to enable the secret servicevoidload()Overload of the load method which loads properties from theSecretServiceif a property value is equal toConfluenceSecretService.SECRET_PLACEHOLDER.voidsave()Overload of theApplicationConfiguration.save()method which saves properties in theSecretServiceand replaces them with theConfluenceSecretService.SECRET_PLACEHOLDER.voidsetSetupComplete(boolean setupComplete) Methods inherited from class com.atlassian.config.internal.ApplicationConfig
configFileExists, getApplicationHome, getApplicationVersion, getBooleanProperty, getBuildNumber, getConfigurationFileName, getCurrentSetupStep, getIntegerProperty, getMajorVersion, getMinorVersion, getProperties, getPropertiesWithPrefix, getProperty, getSetupType, isApplicationHomeValid, isSetupComplete, removeProperty, reset, setApplicationHome, setBuildNumber, setConfigurationFileName, setConfigurationPersister, setCurrentSetupStep, setInitialProperties, setMajorVersion, setMinorVersion, setProperty, setProperty, setProperty, setSetupType
-
Field Details
-
SECURED_PROPERTIES
- See Also:
-
SECURED_PROPERTIES_ENABLED
- See Also:
-
OPEN_SEARCH_PASSWORD
- See Also:
-
-
Constructor Details
-
ConfluenceApplicationConfig
public ConfluenceApplicationConfig(com.atlassian.secrets.api.SecretService secretService)
-
-
Method Details
-
load
public void load() throws com.atlassian.config.ConfigurationExceptionOverload of the load method which loads properties from theSecretServiceif a property value is equal toConfluenceSecretService.SECRET_PLACEHOLDER. Reading secured properties can be disabled through the use of the system-wide flagSecretService.SECRET_SERVICE_STATE_SYSTEM_PROP.- Specified by:
loadin interfacecom.atlassian.config.ApplicationConfiguration- Overrides:
loadin classcom.atlassian.config.internal.ApplicationConfig- Throws:
com.atlassian.config.ConfigurationException- Since:
- 9.0.0
-
save
public void save() throws com.atlassian.config.ConfigurationExceptionOverload of theApplicationConfiguration.save()method which saves properties in theSecretServiceand replaces them with theConfluenceSecretService.SECRET_PLACEHOLDER. Securing properties can be disabled through the use of the system-wide flagSecretService.SECRET_SERVICE_STATE_SYSTEM_PROPor by removing theSECURED_PROPERTIESproperty.- Specified by:
savein interfacecom.atlassian.config.ApplicationConfiguration- Overrides:
savein classcom.atlassian.config.internal.ApplicationConfig- Throws:
com.atlassian.config.ConfigurationException- Since:
- 9.0.0
-
setSetupComplete
public void setSetupComplete(boolean setupComplete) - Specified by:
setSetupCompletein interfacecom.atlassian.config.ApplicationConfiguration- Overrides:
setSetupCompletein classcom.atlassian.config.internal.ApplicationConfig
-
enableSecureProperties
public static void enableSecureProperties(com.atlassian.config.ApplicationConfiguration applicationConfiguration) A method to enable the secret service- Parameters:
applicationConfiguration- represents the application config for shared or local home- Since:
- 9.1.0
-