All Downloads are FREE. Search and download functionalities are using the official Maven repository.

liquibase.configuration.ConfigurationValueObfuscator Maven / Gradle / Ivy

The newest version!
package liquibase.configuration;

import liquibase.database.jvm.JdbcConnection;

/**
 * Used by {@link ConfigurationDefinition#getCurrentValueObfuscated()} to obfuscate the current value.
 */
public interface ConfigurationValueObfuscator {

    /**
     * Standard obfuscator. Returns the constant "*****".
     */
    ConfigurationValueObfuscator STANDARD = value -> value == null ? null : "*****";

    /**
     * Obfuscates credentials from the URL
     */
    ConfigurationValueObfuscator URL_OBFUSCATOR = value -> value == null ? null : JdbcConnection.sanitizeUrl(value);

    /**
     * Not really an obfuscator -- simply returns the passed value directly.
     * Used for times the code wants to explicitly say "I have no obfuscator"
     */
    ConfigurationValueObfuscator NONE = value -> value;

    /**
     * Return an "obfuscated" version of the given value, suitable for logging or storing in non-secure environments.
     */
    DataType obfuscate(DataType value);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy