0

Workspace variable expiration handler template

by
Published today
Script windmill Verified

The script

Submitted by hugo989 Bun
Verified 2 hours ago
1
// Workspace variable expiration handler template
2
// Called ahead of the date the value of a variable in this workspace expires, at each
3
// reminder if the workspace sets one, and again whenever that date is moved to a new one.
4
//
5
// The value itself is never passed in: job arguments and results are stored in
6
// cleartext and shown in Runs. Read it with the Windmill client if the rotation
7
// needs it, but never return or log it.
8

9
export async function main(
10
  variable_path: string, // The path of the variable whose value is expiring
11
  description: string, // The variable's description
12
  value_valid_until: string, // The datetime at which the value expires
13
  is_secret: boolean // Whether the variable is a secret
14
) {
15
  console.log(`${variable_path} expires at ${value_valid_until}`);
16

17
  // Rotate the value here, then write the next expiry date back onto the
18
  // variable. That is what re-arms this handler for the following rotation.
19
}
20