Python - secret()
Creates a reference to a secret in the secrets manager.
from nitric.resources import secretfrom nitric.application import Nitriclatest = secret("database.password").allow('access')Nitric.run()
Parameters
- Name
name
- Required
- Required
- Type
- string
- Description
The unique name of this secret within the secrets manager.
Access
All Nitric resources provide access permissions you can use to specify the level of access your service needs to the resource. See here for details about infrastructure security.
Available permissions:
putting
This permission allows your code to set a new latest value for a secret.
accessing
This permission allows your code to retrieve secret values.
Examples
Create a reference to a secret
from nitric.resources import secretfrom nitric.application import Nitriclatest = secret("database.password").allow('put')Nitric.run()
See Also
Last updated on Oct 15, 2024