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:
Lucas Roesler
2017-10-13 14:01:30 +02:00
committed by Alex Ellis
parent cc103ada94
commit 0fef825fb4
10 changed files with 196 additions and 17 deletions

View File

@ -21,6 +21,9 @@ type CreateFunctionRequest struct {
// EnvVars provides overrides for functions.
EnvVars map[string]string `json:"envVars"`
// Secrets is a list of secrets required for the orchestration layer to provide
Secrets []string `json:"secrets"`
// RegistryAuth is the registry authentication (optional)
// in the same encoded format as Docker native credentials
// (see ~/.docker/config.json)