net.nemerosa.ontrack.extension.bitbucket.cloud.configuration.BitbucketCloudConfiguration.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ontrack-extension-bitbucket-cloud Show documentation
Show all versions of ontrack-extension-bitbucket-cloud Show documentation
Ontrack module: ontrack-extension-bitbucket-cloud
package net.nemerosa.ontrack.extension.bitbucket.cloud.configuration
import net.nemerosa.ontrack.model.support.ConfigurationDescriptor
import net.nemerosa.ontrack.model.support.UserPasswordConfiguration
/**
* Connection configuration to Bitbucket Cloud, at workspace level.
*
* @property name Name of this configuration
* @property workspace Slug of the Bitbucket Cloud workspace to connect to
* @property user Name of the user used to connect to Bitbucket Cloud
* @property password App password used to connect to Bitbucket Cloud
*/
// TODO #532 Workaround
open class BitbucketCloudConfiguration(
name: String,
val workspace: String,
user: String,
password: String?
) : UserPasswordConfiguration(name, user, password) {
override val descriptor: ConfigurationDescriptor get() = ConfigurationDescriptor(name, "$name ($workspace)")
override fun obfuscate() = BitbucketCloudConfiguration(
name = name,
workspace = workspace,
user = user ?: "",
password = ""
)
override fun withPassword(password: String?) = BitbucketCloudConfiguration(
name = name,
workspace = workspace,
user = user ?: "",
password = password ?: ""
)
}