This commit replaces occurences of http method strings with the
corresponding consts from the http package.
*Note* UPDATE is not strictly speaking a valid method and as such isn't
part of the http package (should be a PUT or PATCH?)
Signed-off-by: John McCabe <john@johnmccabe.net>
Adds a pair of configuration options for performance tuning. The
gateway can now invoke functions directly and can bypass the
provider. See updated table in README.md for configuration values.
BaseURLResolver is added with unit tests that decouples resolving
upstream URL from the reverse proxy client code.
- SingleHostBaseURLResolver resolves a single upstream host
- FunctionAsHostBaseURLResolver resolves host based upon conventions
within the URL of the request to a function for direct access
Tested with Kubernetes (faas-netes) and faas-swarm through UI, CLI
calling system endpoints and functions directly.
Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
Signed-off-by: Vivek Singh <vivekkmr45@yahoo.in>
applied go fmt on config_test file
Signed-off-by: Vivek Singh <vivekkmr45@yahoo.in>
removes extra line in config_test
Signed-off-by: Vivek Singh <vivekkmr45@yahoo.in>
**What**
- Add a description for the secret key to the api swagger spec.
- Remove optional examples from the secret management guide.
- Update the ApiKeyProtected README to point at the new guide.
- Refactor the `makeSpec` function to accept the already assembled secrets
array because this should be easier to unit test.
Signed-off-by: Lucas Roesler <lucas.roesler@gmail.com>
**What**
- Add the ability to specify secrets as a csv
- Vendor the docker/cli/opts
- Update the guide for secrets to use the `faas-cli`
**Why**
- Allowing the csv specification of secrets gives users more control about how
those secrets are mounted into the container. This is good for things like
key rotation and for developers that are building on top of OpenFaaS.
Signed-off-by: Lucas Roesler <lucas.roesler@gmail.com>
**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>