Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »

Credential Types allow you to specify what kind of credential will be used within FlexDeploy. Currently, the supported types are: Secret Text, SSH Key, and Certificate.

Secret Text

Secret Text credentials have an input for text that will be encrypted. These are commonly associated with passwords.

image-20241008-185254.png

Input Name

Description

Input Type

Required

Secret Text

Text that will be stored in encrypted format

Text

Yes

A secret text credential that is assigned to an encrypted property within FlexDeploy can be referenced by using the code of the property it was assigned to. Since there is only one input value, there are no suffixes that need to be appended unlike SSH Key or Certificate credentials.

SSH Key

SSH Key credentials support a private key file upload and an optional input for a passphrase. You will be able to download the public key based on the private key that is uploaded.

image-20241008-193015.png

Input Name

Description

Input Type

Required

SSH Key

SSH Key which will have its content stored in encrypted format.

File

Yes

Passphrase

Passphrase for accessing the SSH key (optional).

Text

No

Referencing SSH Key Values As Properties

An SSH Key credential that is assigned to an encrypted property within FlexDeploy can be referenced for property replacement or groovy variables. In order to reference the private key, then only the property code can be used. If you want to access the passphrase, then attach the suffix _PASSPHRASE (case sensitive) to the property code.

For example, we have an encrypted property on this workflow with the code ENDPOINT_SSH_KEY.

image-20241008-182404.png

We could have a step in our workflow to execute some sort of shell script that will make an SSH connection using the property configured on the project. Below is an example of referencing our property in a groovy script, but it would be similar for environment variables or property replacement within files. For accessing the private key then we would use the code ENDPOINT_SSH_KEY. For accessing the passphrase, then it would be ENDPOINT_SSH_KEY_PASSPHRASE. Note that if referencing the passphrase like this, it could fail if the actual value of the property during execution is not an SSH Key type credential.

image-20241008-182946.png

Trouble Shooting SSH Key Credentials

Certificate

Certificate credentials support a certificate file upload and an optional password.

image-20241008-192837.png

Input Name

Description

Input Type

Required

Certificate

Certificate which will have its content stored in encrypted format.

File

Yes

Password

Password for accessing the certificate (optional).

Text

No

Referencing Certificate Values As Properties

A Certificate credential that is assigned to an encrypted property within FlexDeploy can be referenced for property replacement or groovy variables. In order to reference the certificate, then only the property code can be used. If you want to access the password, then attach the suffix “_PASSWORD” (case sensitive) to the property code.

For example, we have an encrypted property on this workflow with the code WEB_CERTIFICATE.

image-20241008-184130.png

We could have a step in our workflow to execute an operation that will connect to an external system using the certificate of the property configured on the project. Below is an example of referencing our property in a groovy script, but it would be similar for environment variables or property replacement within files. For accessing the certificate then we would use the code WEB_CERTIFICATE. For accessing the password, then it would be WEB_CERTIFICATE_PASSWORD. Note that if referencing the password like this, it could fail if the actual value of the property during execution is not a Certificate type credential.

image-20241008-184505.png

FLEXDEPLOY Credential Value Functions

For any groovy script that has access to the FLEXDEPLOY variable, there are methods for accessing the plain text values of a given credential id or name.

Method

Description

FLEXDEPLOY.getCredentialSecretTextValueById(credentialId)

Returns the plain text value String of the given Credential id. The id must belong to a credential of type Secret Text.

FLEXDEPLOY.getCredentialSecretTextValueByName(credentialName)

Returns the plain text value String of the given Credential name. The name must belong to a credential of type Secret Text.

FLEXDEPLOY.getCredentialValueById(credentialId)

Returns an object containing the plain text values depending on the credential type of the provided id.

Secret Text -> CredentialSecretTextValuePojo

SSH Key → CredentialSshKeyValuePojo

Certificate → CredentialCertificateValuePojo

FLEXDEPLOY.getCredentialValueByName(credentialName)

Returns an object containing the plain text values depending on the credential type of the provided name.

Secret Text -> CredentialSecretTextValuePojo

SSH Key → CredentialSshKeyValuePojo

Certificate → CredentialCertificateValuePojo

CredentialSecretTextValuePojo

Method

Description

getSecretText()

Returns the secret text value of this credential.

CredentialSshKeyValuePojo

Method

Description

getSshKey()

Returns the private key value of this credential.

getSshKeyPassphrase()

Returns the passphrase value of this credential.

CredentialCertificateValuePojo

Method

Description

getCertificate()

Returns the certificate value of this credential.

getCertificatePassword()

Returns the password value of this credential.

  • No labels