Edits history of script submission #23860 for ' Workspace variable expiration handler template (windmill)'

  • bun
    One script reply has been approved by the moderators
    Ap­pro­ved
    // Workspace variable expiration handler template
    // Called ahead of the date the value of a variable in this workspace expires, at each
    // reminder if the workspace sets one, and again whenever that date is moved to a new one.
    //
    // The value itself is never passed in: job arguments and results are stored in
    // cleartext and shown in Runs. Read it with the Windmill client if the rotation
    // needs it, but never return or log it.
    
    export async function main(
      variable_path: string, // The path of the variable whose value is expiring
      description: string, // The variable's description
      value_valid_until: string, // The datetime at which the value expires
      is_secret: boolean // Whether the variable is a secret
    ) {
      console.log(`${variable_path} expires at ${value_valid_until}`);
    
      // Rotate the value here, then write the next expiry date back onto the
      // variable. That is what re-arms this handler for the following rotation.
    }
    

    Submitted by hugo989 3 hours ago