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 void
enableSecureProperties
(com.atlassian.config.ApplicationConfiguration applicationConfiguration) A method to enable the secret servicevoid
load()
Overload of the load method which loads properties from theSecretService
if a property value is equal toConfluenceSecretService.SECRET_PLACEHOLDER
.void
save()
Overload of theApplicationConfiguration.save()
method which saves properties in theSecretService
and replaces them with theConfluenceSecretService.SECRET_PLACEHOLDER
.void
setSetupComplete
(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 theSecretService
if 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:
load
in interfacecom.atlassian.config.ApplicationConfiguration
- Overrides:
load
in 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 theSecretService
and replaces them with theConfluenceSecretService.SECRET_PLACEHOLDER
. Securing properties can be disabled through the use of the system-wide flagSecretService.SECRET_SERVICE_STATE_SYSTEM_PROP
or by removing theSECURED_PROPERTIES
property.- Specified by:
save
in interfacecom.atlassian.config.ApplicationConfiguration
- Overrides:
save
in classcom.atlassian.config.internal.ApplicationConfig
- Throws:
com.atlassian.config.ConfigurationException
- Since:
- 9.0.0
-
setSetupComplete
public void setSetupComplete(boolean setupComplete) - Specified by:
setSetupComplete
in interfacecom.atlassian.config.ApplicationConfiguration
- Overrides:
setSetupComplete
in 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
-