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

net.nemerosa.ontrack.extension.bitbucket.cloud.configuration.BitbucketCloudConfiguration.kt Maven / Gradle / Ivy

There is a newer version: 4.4.5
Show newest version
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 ?: ""
    )

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy