alexellis/derek

Issue with HMAC secret when using a file

alexellis opened this issue · 1 comments

Issue identified by @MrTinD

Expected Behaviour

A secret for derek-secret-key (for HMAC) should be read from a file when needed i.e. docker secret create derek-secret-key ./derek-secret-key

Current Behaviour

When creating the HMAC secret via docker secret create derek-secret-key ./derek-secret-key we get an extra new-line in the data we read and that makes the validation of HMAC fail because in the GitHub UI we can only enter a single line of text.

File:

my-secret\n

GitHub:

my-secret

Possible Solution

  1. Work-around - use echo -n | docker secret create derek-secret-key - to suppress the new-line terminator in the file.

  2. Change code to always strip down any new-line characters when reading the HMAC secret.

Steps to Reproduce (for bugs)

  1. See above

Context

Caused frustration for user submitting patch, we need to make this better.

Your Environment

  • You're using the hosted Derek service

or

  • You host your own OpenFaaS cluster with Derek installed
  • Docker version docker version (e.g. Docker 17.0.05 ):
  Version:      18.05.0-ce
  • Are you using Docker Swarm or Kubernetes (FaaS-netes)?

We're using Docker Swarm but this may apply to Kubernetes too.

rgee0 commented

Derek close: addressed in #73