From ddb4ca7a74a0d6f683f17b964bc8b6c87642fa91 Mon Sep 17 00:00:00 2001 From: Mariano Cano Date: Fri, 12 Jun 2020 14:55:35 -0700 Subject: [PATCH] Move load of kms to main package. With this change packages that import the authority won't load by default all the supported kms with all its dependencies. Fixes #228 --- cmd/step-ca/main.go | 8 ++++++++ cmd/step-yubikey-init/main.go | 3 +++ kms/kms.go | 7 +------ 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/cmd/step-ca/main.go b/cmd/step-ca/main.go index 0486cd5f..2151d80f 100644 --- a/cmd/step-ca/main.go +++ b/cmd/step-ca/main.go @@ -23,6 +23,14 @@ import ( "github.com/smallstep/cli/config" "github.com/smallstep/cli/usage" "github.com/urfave/cli" + + // Enabled kms interfaces. + _ "github.com/smallstep/certificates/kms/awskms" + _ "github.com/smallstep/certificates/kms/cloudkms" + _ "github.com/smallstep/certificates/kms/softkms" + + // Experimental kms interfaces. + _ "github.com/smallstep/certificates/kms/yubikey" ) // commit and buildTime are filled in during build by the Makefile diff --git a/cmd/step-yubikey-init/main.go b/cmd/step-yubikey-init/main.go index dc486f4d..5a75a9ac 100644 --- a/cmd/step-yubikey-init/main.go +++ b/cmd/step-yubikey-init/main.go @@ -22,6 +22,9 @@ import ( "github.com/smallstep/cli/crypto/pemutil" "github.com/smallstep/cli/ui" "github.com/smallstep/cli/utils" + + // Enable yubikey. + _ "github.com/smallstep/certificates/kms/yubikey" ) type Config struct { diff --git a/kms/kms.go b/kms/kms.go index 1a37135b..3eddca93 100644 --- a/kms/kms.go +++ b/kms/kms.go @@ -7,13 +7,8 @@ import ( "github.com/pkg/errors" "github.com/smallstep/certificates/kms/apiv1" - // Enabled kms interfaces. - _ "github.com/smallstep/certificates/kms/awskms" - _ "github.com/smallstep/certificates/kms/cloudkms" + // Enable default implementation _ "github.com/smallstep/certificates/kms/softkms" - - // Experimental kms interfaces. - _ "github.com/smallstep/certificates/kms/yubikey" ) // KeyManager is the interface implemented by all the KMS.