mirror of
https://github.com/openfaas/faas.git
synced 2025-06-21 12:16:30 +00:00
Add support to specify secrets in services
**What** - During function creation, accept an array of strings defining swarm secrets that are required for the service - Update docs - Add new guide on using the secrets capability - Add new sample function to highlight using environment variables - Update `ApiKeyProtected` sample function to utilize the new secrets capabilities **Why** - This allows secrets to remain encrypted at rest instead of being unencrypted in environment variables and yaml files. Fixes #285 Signed-off-by: Lucas Roesler <lucas.roesler@gmail.com>
This commit is contained in:
committed by
Alex Ellis
parent
cc103ada94
commit
0fef825fb4
@ -1,6 +1,6 @@
|
||||
### Api-Key-Protected sample
|
||||
|
||||
To use this sample provide an env variable for the container/service in `secret_api_key`.
|
||||
To use this sample provide a secret for the container/service in `secret_api_key` using [Docker Swarm Secret](https://docs.docker.com/engine/swarm/secrets/#defining-and-using-secrets-in-compose-files).
|
||||
|
||||
Then when calling via the gateway pass the additional header "X-Api-Key", if it matches the `secret_api_key` value then the function will give access, otherwise access denied.
|
||||
|
||||
|
Reference in New Issue
Block a user