Python - secret.version.access()
Retrieves the value from a version of a secret.
from nitric.resources import secretfrom nitric.application import Nitric# Get latest secret versionlatest = secret("database.password").allow("access").latest()# Access the latest secret versionvalue = await latest_version.access()Nitric.run()
Examples
Access the latest version of a secret
from nitric.resources import secretfrom nitric.application import Nitriclatest = secret("database.password").allow("access").latest()value = await latest.access()Nitric.run()
Access a specific version of a secret
from nitric.resources import secretfrom nitric.application import Nitrickey_ref = secret('apiKey').allow('access')key_value = await key_ref.version('the-version-id').access()Nitric.run()
Last updated on Nov 14, 2024