public class StandardSensitivePropertyProviderFactory extends Object implements SensitivePropertyProviderFactory
| Modifier and Type | Field and Description |
|---|---|
private Supplier<BootstrapProperties> |
bootstrapPropertiesSupplier |
private Map<String,Pattern> |
customPropertyContextMap |
private Optional<String> |
keyHex |
private static org.slf4j.Logger |
logger |
private static List<Class<? extends SensitivePropertyProvider>> |
PROVIDER_CLASSES |
private Map<Class<? extends SensitivePropertyProvider>,SensitivePropertyProvider> |
providers |
| Modifier | Constructor and Description |
|---|---|
|
StandardSensitivePropertyProviderFactory()
Factory default constructor to support java.util.ServiceLoader
|
private |
StandardSensitivePropertyProviderFactory(String keyHex,
Supplier<BootstrapProperties> bootstrapPropertiesSupplier) |
| Modifier and Type | Method and Description |
|---|---|
private BootstrapProperties |
getBootstrapProperties() |
private <T> Properties |
getClientProperties(ClientProvider<T> clientProvider) |
private String |
getKeyHex() |
ProtectedPropertyContext |
getPropertyContext(String groupIdentifier,
String propertyName) |
private SensitivePropertyProvider |
getProvider(Class<? extends SensitivePropertyProvider> providerClass) |
SensitivePropertyProvider |
getProvider(ProtectionScheme protectionScheme)
Get Provider where Protection Scheme path starts with a prefix mapped to the Provider Class
|
Collection<SensitivePropertyProvider> |
getSupportedProviders()
Get Supported Sensitive Property Providers instantiates providers as needed and checks supported status
|
private void |
populateCustomPropertyContextMap() |
void |
setKeyHex(String hexadecimalKey) |
static SensitivePropertyProviderFactory |
withDefaults()
Creates a StandardSensitivePropertyProviderFactory using the default bootstrap.conf location and
the keyHex extracted from this bootstrap.conf.
|
static SensitivePropertyProviderFactory |
withKey(String keyHex)
Creates a StandardSensitivePropertyProviderFactory using only the provided secret key hex.
|
static SensitivePropertyProviderFactory |
withKeyAndBootstrapSupplier(String keyHex,
Supplier<BootstrapProperties> bootstrapPropertiesSupplier)
Creates a new StandardSensitivePropertyProviderFactory using a separate keyHex and provided bootstrap.conf.
|
private static final org.slf4j.Logger logger
private static final List<Class<? extends SensitivePropertyProvider>> PROVIDER_CLASSES
private final Supplier<BootstrapProperties> bootstrapPropertiesSupplier
private final Map<Class<? extends SensitivePropertyProvider>,SensitivePropertyProvider> providers
public StandardSensitivePropertyProviderFactory()
private StandardSensitivePropertyProviderFactory(String keyHex, Supplier<BootstrapProperties> bootstrapPropertiesSupplier)
public void setKeyHex(String hexadecimalKey)
public static SensitivePropertyProviderFactory withDefaults()
public static SensitivePropertyProviderFactory withKey(String keyHex)
keyHex - The secret key hex for encrypting propertiespublic static SensitivePropertyProviderFactory withKeyAndBootstrapSupplier(String keyHex, Supplier<BootstrapProperties> bootstrapPropertiesSupplier)
keyHex - The secret key hex for encrypting propertiesbootstrapPropertiesSupplier - A supplier for the BootstrapProperties that represent bootstrap.conf.
If the supplier returns null, the default bootstrap.conf will be used instead.public SensitivePropertyProvider getProvider(ProtectionScheme protectionScheme) throws SensitivePropertyProtectionException
getProvider in interface SensitivePropertyProviderFactoryprotectionScheme - Protection Scheme requestedSensitivePropertyProtectionException - Thrown when provider path not found for requested schemepublic Collection<SensitivePropertyProvider> getSupportedProviders()
getSupportedProviders in interface SensitivePropertyProviderFactorypublic ProtectedPropertyContext getPropertyContext(String groupIdentifier, String propertyName)
getPropertyContext in interface SensitivePropertyProviderFactoryprivate void populateCustomPropertyContextMap()
private String getKeyHex()
private BootstrapProperties getBootstrapProperties()
private <T> Properties getClientProperties(ClientProvider<T> clientProvider)
private SensitivePropertyProvider getProvider(Class<? extends SensitivePropertyProvider> providerClass) throws SensitivePropertyProtectionException
Copyright © 2022 Apache NiFi Project. All rights reserved.