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

net.nemerosa.ontrack.model.support.Configuration.kt Maven / Gradle / Ivy

There is a newer version: 4.4.5
Show newest version
package net.nemerosa.ontrack.model.support

import com.fasterxml.jackson.annotation.JsonIgnore

interface Configuration> {

    /**
     * Name of this configuration
     */
    val name: String

    /**
     * Gets the descriptor for this configuration
     */
    @get:JsonIgnore
    val descriptor: ConfigurationDescriptor

    /**
     * Utility method that erases any sensitive data from this configuration
     * and returns new one.
     */
    fun obfuscate(): T

    /**
     * Given an [old configuration][oldConfig], injects its credentials into the current
     * configuration if they are not defined and returns it.
     *
     * @param oldConfig Old version of this configuration
     * @return New version of this configuration where credentials have been replaced by the old ones
     * if the new ones are not provided.
     *
     * Returns `this` is there is nothing to inject.
     */
    fun injectCredentials(oldConfig: T): T

    /**
     * Prepares a configuration for encryption.
     *
     * Returns `this` is there is nothing to encrypt.
     */
    fun encrypt(crypting: (plain: String?) -> String?): T

    /**
     * Prepares a configuration for decryption.
     *
     * Returns `this` is there is nothing to decrypt.
     */
    fun decrypt(decrypting: (encrypted: String?) -> String?): T

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy