Skip to main content

Secret

A secret is a scalar whose value cannot be printed or logged, it only really is useful when used with the Secret Service where secrets can be stored and then retrieved by scripts or workflows. Usually secrets are used to store passwords and database connection information etc.

Construction

You can construct a secret using one of the constructor functions:

// Create a new secret
sec = Secret("password!")

If you try to print a secret, you just see the following:

`********`

Properties

NameDescriptionType
idThe name of the secretScalar(String)
valueStringThe actual secret
enabledBooleanA boolean to enable or disable this secret, defaults to true
notBeforeStringAn optional date string indicating when this secret is valid from
expiresStringAn optional date string indicating when this secret is valid to

Example Usage

Update a secret

//#region Add a secret
test = Secret("this_is_a_test")
test.notBefore = "2024-06-01"
test.expires = "2024-12-31"
save test
//#endregion

Use a secret

//#region Using a secret
url = "https://web-api.tp.entsoe.eu/api?securityToken=" + ${secret:"ENTSOE_TOKEN"}
//#endregion

More information