diff --git a/ca/client.go b/ca/client.go index cfeddba0..aa1e38dd 100644 --- a/ca/client.go +++ b/ca/client.go @@ -29,7 +29,7 @@ import ( "github.com/smallstep/certificates/authority/provisioner" "github.com/smallstep/certificates/ca/identity" "github.com/smallstep/certificates/errs" - "go.step.sm/cli-utils/config" + "go.step.sm/cli-utils/step" "go.step.sm/crypto/jose" "go.step.sm/crypto/keyutil" "go.step.sm/crypto/pemutil" @@ -1295,7 +1295,7 @@ func createCertificateRequest(commonName string, sans []string, key crypto.Priva // getRootCAPath returns the path where the root CA is stored based on the // STEPPATH environment variable. func getRootCAPath() string { - return filepath.Join(config.StepPath(), "certs", "root_ca.crt") + return filepath.Join(step.Path(), "certs", "root_ca.crt") } func readJSON(r io.ReadCloser, v interface{}) error { diff --git a/cmd/step-ca/main.go b/cmd/step-ca/main.go index 01d800d8..f40ddf5f 100644 --- a/cmd/step-ca/main.go +++ b/cmd/step-ca/main.go @@ -21,7 +21,7 @@ import ( "github.com/urfave/cli" "go.step.sm/cli-utils/command" "go.step.sm/cli-utils/command/version" - "go.step.sm/cli-utils/config" + "go.step.sm/cli-utils/step" "go.step.sm/cli-utils/ui" "go.step.sm/cli-utils/usage" @@ -49,7 +49,7 @@ var ( ) func init() { - config.Set("Smallstep CA", Version, BuildTime) + step.Set("Smallstep CA", Version, BuildTime) authority.GlobalVersion.Version = Version rand.Seed(time.Now().UnixNano()) } @@ -115,7 +115,7 @@ func main() { app := cli.NewApp() app.Name = "step-ca" app.HelpName = "step-ca" - app.Version = config.Version() + app.Version = step.Version() app.Usage = "an online certificate authority for secure automated certificate management" app.UsageText = `**step-ca** [**--password-file**=] [**--ssh-host-password-file**=] [**--ssh-user-password-file**=] diff --git a/pki/pki.go b/pki/pki.go index 61e20b6b..5f2afedd 100644 --- a/pki/pki.go +++ b/pki/pki.go @@ -29,9 +29,9 @@ import ( "github.com/smallstep/certificates/kms" kmsapi "github.com/smallstep/certificates/kms/apiv1" "github.com/smallstep/nosql" - "go.step.sm/cli-utils/config" "go.step.sm/cli-utils/errs" "go.step.sm/cli-utils/fileutil" + "go.step.sm/cli-utils/step" "go.step.sm/cli-utils/ui" "go.step.sm/crypto/jose" "go.step.sm/crypto/pemutil" @@ -89,42 +89,42 @@ const ( // GetDBPath returns the path where the file-system persistence is stored // based on the STEPPATH environment variable. func GetDBPath() string { - return filepath.Join(config.StepPath(), dbPath) + return filepath.Join(step.Path(), dbPath) } // GetConfigPath returns the directory where the configuration files are stored // based on the STEPPATH environment variable. func GetConfigPath() string { - return filepath.Join(config.StepPath(), configPath) + return filepath.Join(step.Path(), configPath) } // GetPublicPath returns the directory where the public keys are stored based on // the STEPPATH environment variable. func GetPublicPath() string { - return filepath.Join(config.StepPath(), publicPath) + return filepath.Join(step.Path(), publicPath) } // GetSecretsPath returns the directory where the private keys are stored based // on the STEPPATH environment variable. func GetSecretsPath() string { - return filepath.Join(config.StepPath(), privatePath) + return filepath.Join(step.Path(), privatePath) } // GetRootCAPath returns the path where the root CA is stored based on the // STEPPATH environment variable. func GetRootCAPath() string { - return filepath.Join(config.StepPath(), publicPath, "root_ca.crt") + return filepath.Join(step.Path(), publicPath, "root_ca.crt") } // GetOTTKeyPath returns the path where the one-time token key is stored based // on the STEPPATH environment variable. func GetOTTKeyPath() string { - return filepath.Join(config.StepPath(), privatePath, "ott_key") + return filepath.Join(step.Path(), privatePath, "ott_key") } // GetTemplatesPath returns the path where the templates are stored. func GetTemplatesPath() string { - return filepath.Join(config.StepPath(), templatesPath) + return filepath.Join(step.Path(), templatesPath) } // GetProvisioners returns the map of provisioners on the given CA. diff --git a/pki/templates.go b/pki/templates.go index 3506a96d..0ccbed8b 100644 --- a/pki/templates.go +++ b/pki/templates.go @@ -6,9 +6,9 @@ import ( "github.com/pkg/errors" "github.com/smallstep/certificates/templates" - "go.step.sm/cli-utils/config" "go.step.sm/cli-utils/errs" "go.step.sm/cli-utils/fileutil" + "go.step.sm/cli-utils/step" ) // getTemplates returns all the templates enabled @@ -44,7 +44,7 @@ func generateTemplates(t *templates.Templates) error { if !ok { return errors.Errorf("template %s does not exists", t.Name) } - if err := fileutil.WriteFile(config.StepAbs(t.TemplatePath), []byte(data), 0644); err != nil { + if err := fileutil.WriteFile(step.Abs(t.TemplatePath), []byte(data), 0644); err != nil { return err } } @@ -53,7 +53,7 @@ func generateTemplates(t *templates.Templates) error { if !ok { return errors.Errorf("template %s does not exists", t.Name) } - if err := fileutil.WriteFile(config.StepAbs(t.TemplatePath), []byte(data), 0644); err != nil { + if err := fileutil.WriteFile(step.Abs(t.TemplatePath), []byte(data), 0644); err != nil { return err } }