apache / apache/openwhisk-wskdeploy
Allow project credential entry to be an environment variable
- Dominant language
- Go
- Stars
- 75
- Forks
- 73
- PR merge metrics
- No merged PRs in 30d
Description
When creating a manifest with project information to use with `wskdeploy sync`, it requires credentials to be specified in the `credential` entry. If I specify an environment variable, I get an error on deployment, whereas if I enter the credential in clear it works. In order to avoid credentials being leaked into files, this field should accept an environment variable that can be set externally.
## Steps to reproduce
1. Create a manifest that starts:
```yaml
project:
apiHost: your API host
credential: $OW_CREDENTIAL
```
2. Set the `OW_CREDENTIAL` environment variable to the correct value
3. `wskdeploy sync`: fails with the following error message:
```
Error: Deployment did not complete sucessfully. Run `wskdeploy undeploy` to remove partially deployed assets.
Error: servicedeployer.go [1627]: [ERROR_WHISK_CLIENT_ERROR]: Error code: 145: The connection failed, or timed out. (HTTP status code 401): HTTP Response Status: 401 Unauthorized HTTP Response Body: {"error":"The supplied authentication is invalid","code":"c9d3da79290088b0f68ffe7fe92d3a98"}
```
If the `credential` entry has the credential value in clear text, it works fine.
## Expected behaviour
It should be possible to set the value of `credential` to an environment variable that is set externally to avoid that value being stored in clear in a file that is under source control.
## Version
This was tried on `wskdeploy` `latest`, downloaded on 10th May.
Contributor guide
Assessment
This issue has not been assessed yet.