Skip to main content
Secret.getInfo (JavaScript) / Secret.get_info (Python) returns one secret’s metadata and throws SecretNotFoundError (JavaScript) / SecretNotFoundException (Python) when it doesn’t exist. Secret.exists answers the same question with a boolean instead of an error, which is the quickest way to check that a name you reference in a network rule is really stored. Secret.list returns a paginator over the project’s secrets. No read surface returns a secret value.
Like every method that takes a single secret, getInfo and exists accept either the name or the sec_... identifier. metadata is yours to use for organizing secrets, for example by environment or owner. It’s not secret material, so don’t store another credential in it. Create defaults it to an empty map. Update preserves it when omitted and replaces the whole map when supplied, so passing an empty map clears it.