Skip to content

Commit 40d0596

Browse files
committed
Use smallstep/cli-utils instead of smallstep/cli
1 parent fb18e5a commit 40d0596

File tree

15 files changed

+58
-479
lines changed

15 files changed

+58
-479
lines changed

ca/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727
"github.com/smallstep/certificates/authority/provisioner"
2828
"github.com/smallstep/certificates/ca/identity"
2929
"github.com/smallstep/certificates/errs"
30-
"github.com/smallstep/cli/config"
30+
"go.step.sm/cli-utils/config"
3131
"go.step.sm/crypto/keyutil"
3232
"go.step.sm/crypto/pemutil"
3333
"go.step.sm/crypto/x509util"

ca/identity/identity.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616

1717
"github.com/pkg/errors"
1818
"github.com/smallstep/certificates/api"
19-
"github.com/smallstep/cli/config"
19+
"go.step.sm/cli-utils/config"
2020
"go.step.sm/crypto/pemutil"
2121
)
2222

ca/provisioner.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import (
77

88
"github.com/pkg/errors"
99
"github.com/smallstep/certificates/authority/provisioner"
10-
"github.com/smallstep/cli/token"
11-
"github.com/smallstep/cli/token/provision"
10+
"go.step.sm/cli-utils/token"
11+
"go.step.sm/cli-utils/token/provision"
1212
"go.step.sm/crypto/jose"
1313
"go.step.sm/crypto/randutil"
1414
)

cmd/step-awskms-init/main.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import (
1616

1717
"github.com/smallstep/certificates/kms/apiv1"
1818
"github.com/smallstep/certificates/kms/awskms"
19-
"github.com/smallstep/cli/ui"
20-
"github.com/smallstep/cli/utils"
19+
"go.step.sm/cli-utils/fileutil"
20+
"go.step.sm/cli-utils/ui"
2121
"go.step.sm/crypto/pemutil"
2222
"golang.org/x/crypto/ssh"
2323
)
@@ -113,7 +113,7 @@ func createX509(c *awskms.KMS) error {
113113
return err
114114
}
115115

116-
if err = utils.WriteFile("root_ca.crt", pem.EncodeToMemory(&pem.Block{
116+
if err = fileutil.WriteFile("root_ca.crt", pem.EncodeToMemory(&pem.Block{
117117
Type: "CERTIFICATE",
118118
Bytes: b,
119119
}), 0600); err != nil {
@@ -156,7 +156,7 @@ func createX509(c *awskms.KMS) error {
156156
return err
157157
}
158158

159-
if err = utils.WriteFile("intermediate_ca.crt", pem.EncodeToMemory(&pem.Block{
159+
if err = fileutil.WriteFile("intermediate_ca.crt", pem.EncodeToMemory(&pem.Block{
160160
Type: "CERTIFICATE",
161161
Bytes: b,
162162
}), 0600); err != nil {
@@ -186,7 +186,7 @@ func createSSH(c *awskms.KMS) error {
186186
return err
187187
}
188188

189-
if err = utils.WriteFile("ssh_user_ca_key.pub", ssh.MarshalAuthorizedKey(key), 0600); err != nil {
189+
if err = fileutil.WriteFile("ssh_user_ca_key.pub", ssh.MarshalAuthorizedKey(key), 0600); err != nil {
190190
return err
191191
}
192192

@@ -207,7 +207,7 @@ func createSSH(c *awskms.KMS) error {
207207
return err
208208
}
209209

210-
if err = utils.WriteFile("ssh_host_ca_key.pub", ssh.MarshalAuthorizedKey(key), 0600); err != nil {
210+
if err = fileutil.WriteFile("ssh_host_ca_key.pub", ssh.MarshalAuthorizedKey(key), 0600); err != nil {
211211
return err
212212
}
213213

cmd/step-ca/main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ import (
1818

1919
"github.com/smallstep/certificates/authority"
2020
"github.com/smallstep/certificates/commands"
21-
"github.com/smallstep/cli/command"
22-
"github.com/smallstep/cli/command/version"
23-
"github.com/smallstep/cli/config"
24-
"github.com/smallstep/cli/usage"
2521
"github.com/urfave/cli"
22+
"go.step.sm/cli-utils/command"
23+
"go.step.sm/cli-utils/command/version"
24+
"go.step.sm/cli-utils/config"
25+
"go.step.sm/cli-utils/usage"
2626

2727
// Enabled kms interfaces.
2828
_ "github.com/smallstep/certificates/kms/awskms"

cmd/step-cloudkms-init/main.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ import (
1717

1818
"github.com/smallstep/certificates/kms/apiv1"
1919
"github.com/smallstep/certificates/kms/cloudkms"
20-
"github.com/smallstep/cli/ui"
21-
"github.com/smallstep/cli/utils"
20+
"go.step.sm/cli-utils/fileutil"
21+
"go.step.sm/cli-utils/ui"
2222
"go.step.sm/crypto/pemutil"
2323
"golang.org/x/crypto/ssh"
2424
)
@@ -146,7 +146,7 @@ func createPKI(c *cloudkms.CloudKMS, project, location, keyRing string, protecti
146146
return err
147147
}
148148

149-
if err = utils.WriteFile("root_ca.crt", pem.EncodeToMemory(&pem.Block{
149+
if err = fileutil.WriteFile("root_ca.crt", pem.EncodeToMemory(&pem.Block{
150150
Type: "CERTIFICATE",
151151
Bytes: b,
152152
}), 0600); err != nil {
@@ -190,7 +190,7 @@ func createPKI(c *cloudkms.CloudKMS, project, location, keyRing string, protecti
190190
return err
191191
}
192192

193-
if err = utils.WriteFile("intermediate_ca.crt", pem.EncodeToMemory(&pem.Block{
193+
if err = fileutil.WriteFile("intermediate_ca.crt", pem.EncodeToMemory(&pem.Block{
194194
Type: "CERTIFICATE",
195195
Bytes: b,
196196
}), 0600); err != nil {
@@ -223,7 +223,7 @@ func createSSH(c *cloudkms.CloudKMS, project, location, keyRing string, protecti
223223
return err
224224
}
225225

226-
if err = utils.WriteFile("ssh_user_ca_key.pub", ssh.MarshalAuthorizedKey(key), 0600); err != nil {
226+
if err = fileutil.WriteFile("ssh_user_ca_key.pub", ssh.MarshalAuthorizedKey(key), 0600); err != nil {
227227
return err
228228
}
229229

@@ -245,7 +245,7 @@ func createSSH(c *cloudkms.CloudKMS, project, location, keyRing string, protecti
245245
return err
246246
}
247247

248-
if err = utils.WriteFile("ssh_host_ca_key.pub", ssh.MarshalAuthorizedKey(key), 0600); err != nil {
248+
if err = fileutil.WriteFile("ssh_host_ca_key.pub", ssh.MarshalAuthorizedKey(key), 0600); err != nil {
249249
return err
250250
}
251251

cmd/step-yubikey-init/main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ import (
2020
"github.com/pkg/errors"
2121
"github.com/smallstep/certificates/kms"
2222
"github.com/smallstep/certificates/kms/apiv1"
23-
"github.com/smallstep/cli/ui"
24-
"github.com/smallstep/cli/utils"
23+
"go.step.sm/cli-utils/fileutil"
24+
"go.step.sm/cli-utils/ui"
2525
"go.step.sm/crypto/pemutil"
2626

2727
// Enable yubikey.
@@ -229,7 +229,7 @@ func createPKI(k kms.KeyManager, c Config) error {
229229
}
230230
}
231231

232-
if err = utils.WriteFile("root_ca.crt", pem.EncodeToMemory(&pem.Block{
232+
if err = fileutil.WriteFile("root_ca.crt", pem.EncodeToMemory(&pem.Block{
233233
Type: "CERTIFICATE",
234234
Bytes: b,
235235
}), 0600); err != nil {
@@ -306,7 +306,7 @@ func createPKI(k kms.KeyManager, c Config) error {
306306
}
307307
}
308308

309-
if err = utils.WriteFile("intermediate_ca.crt", pem.EncodeToMemory(&pem.Block{
309+
if err = fileutil.WriteFile("intermediate_ca.crt", pem.EncodeToMemory(&pem.Block{
310310
Type: "CERTIFICATE",
311311
Bytes: b,
312312
}), 0600); err != nil {

commands/app.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import (
1313
"github.com/pkg/errors"
1414
"github.com/smallstep/certificates/authority"
1515
"github.com/smallstep/certificates/ca"
16-
"github.com/smallstep/cli/errs"
1716
"github.com/urfave/cli"
17+
"go.step.sm/cli-utils/errs"
1818
)
1919

2020
// AppCommand is the action used as the top action.

commands/onboard.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ import (
1212
"github.com/smallstep/certificates/authority"
1313
"github.com/smallstep/certificates/ca"
1414
"github.com/smallstep/certificates/pki"
15-
"github.com/smallstep/cli/command"
16-
"github.com/smallstep/cli/errs"
17-
"github.com/smallstep/cli/ui"
18-
"github.com/smallstep/cli/utils"
1915
"github.com/urfave/cli"
16+
"go.step.sm/cli-utils/command"
17+
"go.step.sm/cli-utils/errs"
18+
"go.step.sm/cli-utils/fileutil"
19+
"go.step.sm/cli-utils/ui"
2020
"go.step.sm/crypto/randutil"
2121
)
2222

@@ -199,7 +199,7 @@ func onboardPKI(config onboardingConfiguration) (*authority.Config, string, erro
199199
if err != nil {
200200
return nil, "", errors.Wrapf(err, "error marshaling %s", p.GetCAConfigPath())
201201
}
202-
if err = utils.WriteFile(p.GetCAConfigPath(), b, 0666); err != nil {
202+
if err = fileutil.WriteFile(p.GetCAConfigPath(), b, 0666); err != nil {
203203
return nil, "", errs.FileError(err, p.GetCAConfigPath())
204204
}
205205

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@ require (
1010
github.com/go-piv/piv-go v1.6.0
1111
github.com/google/uuid v1.1.2
1212
github.com/googleapis/gax-go/v2 v2.0.5
13+
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
1314
github.com/newrelic/go-agent v2.15.0+incompatible
1415
github.com/pkg/errors v0.9.1
1516
github.com/rs/xid v1.2.1
1617
github.com/sirupsen/logrus v1.4.2
1718
github.com/smallstep/assert v0.0.0-20200723003110-82e2b9b3b262
18-
github.com/smallstep/cli v0.15.3
1919
github.com/smallstep/nosql v0.3.0
2020
github.com/urfave/cli v1.22.2
21+
go.step.sm/cli-utils v0.0.0-20201029200626-a2850dda4607
2122
go.step.sm/crypto v0.6.1
2223
golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de
2324
golang.org/x/net v0.0.0-20200822124328-c89045814202
@@ -30,7 +31,6 @@ require (
3031
// google.golang.org/genproto/googleapis/cloud/security/privateca/v1alpha1 v0.0.0
3132
)
3233

33-
// replace github.com/smallstep/cli => ../cli
3434
// replace github.com/smallstep/nosql => ../nosql
3535
// replace go.step.sm/crypto => ../crypto
3636

0 commit comments

Comments
 (0)