v0.16
Features
This release brings two important features:
Secret encryption/decryption in function arguments
In order not to pass secrets in plain text in function arguments,
bigfunctions provides a mechanism to encrypt a secret on the documentation page of a function (for example here).
Only the given function will be able to decrypt it for the given users.
For this to work you need to:
- Generate a key pair for encryption / decryption by running
bigfun config generate-key-pair-for-secrets
.- The public key (used for encryption on the website) will be stored in your
config.yaml
and used when you generate your website. - The private key (used for decryption by the function) will be printed on the console
- The public key (used for encryption on the website) will be stored in your
- Store the private key in a secret named
bigfunctions_private_key
in the Google Secret Manager{ target="_blank" } of the project where you deploy the function. - Give to the service account of the function
Secret Accessor
role to the private key.
The deployed function will automatically download the private key and decrypt any encrypted secret in arguments tagged as secrets (and check secrets were encrypted for this function and for the user who calls it).
This documentation is available in FAQ of Framework page
Persistent cache
It is now possible to use a persistent cache (backed by firestore in datastore mode) in any function.
Usage is as simple as:
cache.get(key)
cache.set(key, value)
You can see an example in exchange_rate
function code