fagfunksjoner.dapla package

Subpackages

Module contents

Module for specific functionality on the platform Dapla, as opposed to prodsone.

fagfunksjoner.dapla.gsm module

get_secret_version(project_id, shortname, version_id='latest')

Access the payload for a given secret version.

The user’s google credentials are used to authorize that the user has permission to access the secret_id.

Parameters:
  • project_id (str) – ID of the Google Cloud project where the secret is stored.

  • shortname (str) – Name (not full path) of the secret in Secret Manager.

  • version_id (str) – The version of the secret to access. Defaults to ‘latest’.

Return type:

str

Returns:

The payload of the secret version as a UTF-8 decoded string.