net.nemerosa.ontrack.model.support.Configuration.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ontrack-model Show documentation
Show all versions of ontrack-model Show documentation
Ontrack module: ontrack-model
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