Skip to content
This repository has been archived by the owner on Feb 9, 2020. It is now read-only.

Commit

Permalink
Make PKI provider's backend configuration explicitly required
Browse files Browse the repository at this point in the history
Previous implementation was blindly defaulting to `test`, which could
have become problematic, since CA committed to Github is used for signing
generated certificates.
  • Loading branch information
janartodesk committed Aug 28, 2019
1 parent 9eeb15d commit 3f41e89
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

"github.com/docker/docker/client"
"github.com/docker/go-plugins-helpers/secrets"
"github.com/pkg/errors"
"go.uber.org/zap"

"docker-secretprovider-pki/backend"
Expand All @@ -28,8 +29,10 @@ func main() {
switch os.Getenv("BACKEND") {
case "secrethub":
ca, err = backend.NewSecrethubBackend()
default:
case "test":
ca, err = backend.NewTestBackend()
default:
err = errors.New("backend not configured. Use `docker plugin set <plugin alias> BACKEND=<value>`")
}

if err != nil {
Expand Down

0 comments on commit 3f41e89

Please sign in to comment.