Class StandardEncryptableServletEnvironment
- java.lang.Object
-
- org.springframework.core.env.AbstractEnvironment
-
- org.springframework.core.env.StandardEnvironment
-
- org.springframework.web.context.support.StandardServletEnvironment
-
- com.ulisesbocchio.jasyptspringboot.environment.StandardEncryptableServletEnvironment
-
- All Implemented Interfaces:
EncryptableEnvironment,org.springframework.core.env.ConfigurableEnvironment,org.springframework.core.env.ConfigurablePropertyResolver,org.springframework.core.env.Environment,org.springframework.core.env.PropertyResolver,org.springframework.web.context.ConfigurableWebEnvironment
public class StandardEncryptableServletEnvironment extends org.springframework.web.context.support.StandardServletEnvironment implements org.springframework.core.env.ConfigurableEnvironment, EncryptableEnvironment
A customConfigurableEnvironmentthat is useful for early access of encrypted properties on bootstrap. While not required in most scenarios could be useful when customizing Spring Boot's init behavior or integrating with certain capabilities that are configured very early, such as Logging configuration. For a concrete example, this method of enabling encryptable properties is the only one that works with Spring Properties replacement in logback-spring.xml files, using the springProperty tag
-
-
Field Summary
-
Fields inherited from class org.springframework.web.context.support.StandardServletEnvironment
JNDI_PROPERTY_SOURCE_NAME, SERVLET_CONFIG_PROPERTY_SOURCE_NAME, SERVLET_CONTEXT_PROPERTY_SOURCE_NAME
-
-
Constructor Summary
Constructors Constructor Description StandardEncryptableServletEnvironment()StandardEncryptableServletEnvironment(InterceptionMode interceptionMode, InterceptionMode propertySourcesInterceptionMode, List<Class<org.springframework.core.env.PropertySource<?>>> skipPropertySourceClasses, EncryptablePropertyResolver resolver, EncryptablePropertyFilter filter, org.jasypt.encryption.StringEncryptor encryptor, EncryptablePropertyDetector detector)Create a new Encryptable Environment.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.springframework.core.env.ConfigurablePropertyResolvercreatePropertyResolver(org.springframework.core.env.MutablePropertySources propertySources)protected voidcustomizePropertySources(org.springframework.core.env.MutablePropertySources propertySources)org.springframework.core.env.MutablePropertySourcesgetOriginalPropertySources()org.springframework.core.env.MutablePropertySourcesgetPropertySources()voidsetEncryptablePropertySources(org.springframework.core.env.MutablePropertySources propertySources)-
Methods inherited from class org.springframework.web.context.support.StandardServletEnvironment
initPropertySources
-
Methods inherited from class org.springframework.core.env.AbstractEnvironment
acceptsProfiles, acceptsProfiles, addActiveProfile, containsProperty, doGetActiveProfiles, doGetActiveProfilesProperty, doGetDefaultProfiles, doGetDefaultProfilesProperty, getActiveProfiles, getConversionService, getDefaultProfiles, getProperty, getProperty, getProperty, getProperty, getPropertyResolver, getRequiredProperty, getRequiredProperty, getReservedDefaultProfiles, getSystemEnvironment, getSystemProperties, isProfileActive, merge, resolvePlaceholders, resolveRequiredPlaceholders, setActiveProfiles, setConversionService, setDefaultProfiles, setIgnoreUnresolvableNestedPlaceholders, setPlaceholderPrefix, setPlaceholderSuffix, setRequiredProperties, setValueSeparator, suppressGetenvAccess, toString, validateProfile, validateRequiredProperties
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.springframework.core.env.ConfigurableEnvironment
addActiveProfile, getSystemEnvironment, getSystemProperties, merge, setActiveProfiles, setDefaultProfiles
-
Methods inherited from interface org.springframework.core.env.ConfigurablePropertyResolver
getConversionService, setConversionService, setIgnoreUnresolvableNestedPlaceholders, setPlaceholderPrefix, setPlaceholderSuffix, setRequiredProperties, setValueSeparator, validateRequiredProperties
-
-
-
-
Constructor Detail
-
StandardEncryptableServletEnvironment
public StandardEncryptableServletEnvironment()
-
StandardEncryptableServletEnvironment
public StandardEncryptableServletEnvironment(InterceptionMode interceptionMode, InterceptionMode propertySourcesInterceptionMode, List<Class<org.springframework.core.env.PropertySource<?>>> skipPropertySourceClasses, EncryptablePropertyResolver resolver, EncryptablePropertyFilter filter, org.jasypt.encryption.StringEncryptor encryptor, EncryptablePropertyDetector detector)
Create a new Encryptable Environment. All arguments are optional, provide null if default value is desired.- Parameters:
interceptionMode- The interception method to utilize, or null (Default isInterceptionMode.WRAPPER)propertySourcesInterceptionMode- The interception method to utilize for wrapping theMutablePropertySources, or null (Default isInterceptionMode.WRAPPER)skipPropertySourceClasses- A list ofPropertySourceclasses to skip from interception, or null (Default is empty)resolver- The property resolver to utilize, or null (Default isDefaultLazyPropertyResolverwhich will resolve to specified configuration)filter- The property filter to utilize, or null (Default isDefaultLazyPropertyFilterwhich will resolve to specified configuration)encryptor- The string encryptor to utilize, or null (Default isDefaultLazyEncryptorwhich will resolve to specified configuration)detector- The property detector to utilize, or null (Default isDefaultLazyPropertyDetectorwhich will resolve to specified configuration)
-
-
Method Detail
-
customizePropertySources
protected void customizePropertySources(org.springframework.core.env.MutablePropertySources propertySources)
- Overrides:
customizePropertySourcesin classorg.springframework.web.context.support.StandardServletEnvironment
-
getPropertySources
public org.springframework.core.env.MutablePropertySources getPropertySources()
- Specified by:
getPropertySourcesin interfaceorg.springframework.core.env.ConfigurableEnvironment- Overrides:
getPropertySourcesin classorg.springframework.core.env.AbstractEnvironment
-
getOriginalPropertySources
public org.springframework.core.env.MutablePropertySources getOriginalPropertySources()
- Specified by:
getOriginalPropertySourcesin interfaceEncryptableEnvironment
-
setEncryptablePropertySources
public void setEncryptablePropertySources(org.springframework.core.env.MutablePropertySources propertySources)
- Specified by:
setEncryptablePropertySourcesin interfaceEncryptableEnvironment
-
createPropertyResolver
protected org.springframework.core.env.ConfigurablePropertyResolver createPropertyResolver(org.springframework.core.env.MutablePropertySources propertySources)
- Overrides:
createPropertyResolverin classorg.springframework.core.env.AbstractEnvironment
-
-