public class SecretReference extends Object
Constructor and Description |
---|
SecretReference(String reference,
Cluster cluster) |
Modifier and Type | Method and Description |
---|---|
static String |
generateStub(String configType,
Long configVersion,
String propertyName) |
String |
getValue() |
Long |
getVersion() |
static boolean |
isSecret(String value) |
static Map<String,String> |
maskPasswordInPropertyMap(Map<String,String> propertyMap)
Helper function to mask a string of properties that may contain a property with a password.
|
static String |
maskPasswordInPropertyMap(String propertyMap)
Helper function to mask a string of property bags that may contain a property with a password.
|
static void |
replacePasswordsWithReferences(Map<PropertyInfo.PropertyType,Set<String>> propertiesTypes,
Map<String,String> propertiesMap,
String configType,
Long configVersion)
Replace real passwords with secret references
|
static void |
replacePasswordsWithReferencesForCustomProperties(Map<String,Map<String,String>> configAttributes,
Map<String,String> propertiesMap,
String configType,
Long configVersion)
Replace real passwords with secret references
|
static void |
replaceReferencesWithPasswords(Map<String,String> targetMap,
Cluster cluster)
Replace secret references with appropriate real passwords.
|
void |
setConfigType(String configType) |
public void setConfigType(String configType)
public Long getVersion()
public String getValue()
public static boolean isSecret(String value)
public static String generateStub(String configType, Long configVersion, String propertyName)
public static String maskPasswordInPropertyMap(String propertyMap)
propertyMap
- Property map to mask by replacing any passwords with the text "SECRET"public static Map<String,String> maskPasswordInPropertyMap(Map<String,String> propertyMap)
propertyMap
- Property map to mask by replacing any passwords with the text "SECRET"propertyMap
is null.public static void replaceReferencesWithPasswords(Map<String,String> targetMap, Cluster cluster) throws org.apache.ambari.server.AmbariException
targetMap
- map in which replacement will be performedcluster
- current clusterorg.apache.ambari.server.AmbariException
public static void replacePasswordsWithReferences(Map<PropertyInfo.PropertyType,Set<String>> propertiesTypes, Map<String,String> propertiesMap, String configType, Long configVersion)
propertiesTypes
- map with properties typespropertiesMap
- map with properties in which replacement will be performedconfigType
- configuration typeconfigVersion
- configuration versionpublic static void replacePasswordsWithReferencesForCustomProperties(Map<String,Map<String,String>> configAttributes, Map<String,String> propertiesMap, String configType, Long configVersion)
configAttributes
- map with config attributes containing properties types as part of their contentpropertiesMap
- map with properties in which replacement will be performedconfigType
- configuration typeconfigVersion
- configuration versionCopyright © 2022 Apache Software Foundation. All rights reserved.