Skip to content

Commit

Permalink
Use github.com/smallstep/cli-utils instead of go.step.sm/cli-utils
Browse files Browse the repository at this point in the history
  • Loading branch information
hslatman committed Oct 28, 2024
1 parent 88443dd commit b45b73f
Show file tree
Hide file tree
Showing 21 changed files with 99 additions and 73 deletions.
8 changes: 5 additions & 3 deletions authority/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ import (
"strings"

"github.com/pkg/errors"
"github.com/smallstep/certificates/authority/provisioner"
"go.step.sm/cli-utils/step"
"go.step.sm/linkedca"
"google.golang.org/protobuf/types/known/structpb"

"github.com/smallstep/cli-utils/step"
"go.step.sm/linkedca"

"github.com/smallstep/certificates/authority/provisioner"
)

// Export creates a linkedca configuration form the current ca.json and loaded
Expand Down
2 changes: 1 addition & 1 deletion authority/provisioner/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/pkg/errors"

"go.step.sm/cli-utils/step"
"github.com/smallstep/cli-utils/step"
"go.step.sm/crypto/jose"
"go.step.sm/crypto/x509util"

Expand Down
3 changes: 2 additions & 1 deletion authority/provisioner/ssh_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import (
"strings"

"github.com/pkg/errors"
"go.step.sm/cli-utils/step"

"github.com/smallstep/cli-utils/step"
"go.step.sm/crypto/sshutil"

"github.com/smallstep/certificates/authority/policy"
Expand Down
4 changes: 2 additions & 2 deletions authority/provisioners.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (

"github.com/pkg/errors"

"go.step.sm/cli-utils/step"
"go.step.sm/cli-utils/ui"
"github.com/smallstep/cli-utils/step"
"github.com/smallstep/cli-utils/ui"
"go.step.sm/crypto/jose"
"go.step.sm/linkedca"

Expand Down
4 changes: 2 additions & 2 deletions authority/provisioners_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import (
"testing"
"time"

"github.com/stretchr/testify/require"

"go.step.sm/crypto/jose"
"go.step.sm/crypto/keyutil"
"go.step.sm/linkedca"

"github.com/stretchr/testify/require"

"github.com/smallstep/assert"
"github.com/smallstep/certificates/api/render"
"github.com/smallstep/certificates/authority/admin"
Expand Down
4 changes: 2 additions & 2 deletions ca/adminClient.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (
"github.com/pkg/errors"
"google.golang.org/protobuf/encoding/protojson"

"go.step.sm/cli-utils/token"
"go.step.sm/cli-utils/token/provision"
"github.com/smallstep/cli-utils/token"
"github.com/smallstep/cli-utils/token/provision"
"go.step.sm/crypto/jose"
"go.step.sm/crypto/randutil"
"go.step.sm/linkedca"
Expand Down
8 changes: 5 additions & 3 deletions ca/ca.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ import (
"github.com/go-chi/chi/v5"
"github.com/go-chi/chi/v5/middleware"
"github.com/pkg/errors"

"github.com/smallstep/cli-utils/step"
"github.com/smallstep/nosql"
"go.step.sm/crypto/x509util"

"github.com/smallstep/certificates/acme"
acmeAPI "github.com/smallstep/certificates/acme/api"
acmeNoSQL "github.com/smallstep/certificates/acme/db/nosql"
Expand All @@ -35,9 +40,6 @@ import (
"github.com/smallstep/certificates/scep"
scepAPI "github.com/smallstep/certificates/scep/api"
"github.com/smallstep/certificates/server"
"github.com/smallstep/nosql"
"go.step.sm/cli-utils/step"
"go.step.sm/crypto/x509util"
)

type options struct {
Expand Down
20 changes: 11 additions & 9 deletions ca/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,23 @@ import (
"strings"

"github.com/pkg/errors"
"golang.org/x/net/http2"
"google.golang.org/protobuf/encoding/protojson"
"google.golang.org/protobuf/proto"

"github.com/smallstep/cli-utils/step"
"go.step.sm/crypto/jose"
"go.step.sm/crypto/keyutil"
"go.step.sm/crypto/pemutil"
"go.step.sm/crypto/randutil"
"go.step.sm/crypto/x509util"

"github.com/smallstep/certificates/api"
"github.com/smallstep/certificates/authority"
"github.com/smallstep/certificates/authority/provisioner"
"github.com/smallstep/certificates/ca/client"
"github.com/smallstep/certificates/ca/identity"
"github.com/smallstep/certificates/errs"
"go.step.sm/cli-utils/step"
"go.step.sm/crypto/jose"
"go.step.sm/crypto/keyutil"
"go.step.sm/crypto/pemutil"
"go.step.sm/crypto/randutil"
"go.step.sm/crypto/x509util"
"golang.org/x/net/http2"
"google.golang.org/protobuf/encoding/protojson"
"google.golang.org/protobuf/proto"
)

// DisableIdentity is a global variable to disable the identity.
Expand Down
6 changes: 4 additions & 2 deletions ca/identity/identity.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ import (
"time"

"github.com/pkg/errors"
"github.com/smallstep/certificates/api"
"go.step.sm/cli-utils/step"

"github.com/smallstep/cli-utils/step"
"go.step.sm/crypto/pemutil"

"github.com/smallstep/certificates/api"
)

// Type represents the different types of identity files.
Expand Down
8 changes: 5 additions & 3 deletions ca/provisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ import (
"time"

"github.com/pkg/errors"
"github.com/smallstep/certificates/authority/provisioner"
"go.step.sm/cli-utils/token"
"go.step.sm/cli-utils/token/provision"

"github.com/smallstep/cli-utils/token"
"github.com/smallstep/cli-utils/token/provision"
"go.step.sm/crypto/jose"
"go.step.sm/crypto/randutil"

"github.com/smallstep/certificates/authority/provisioner"
)

const tokenLifetime = 5 * time.Minute
Expand Down
8 changes: 5 additions & 3 deletions cas/stepcas/jwk_issuer.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ import (
"time"

"github.com/pkg/errors"

"github.com/smallstep/cli-utils/ui"
"go.step.sm/crypto/jose"
"go.step.sm/crypto/randutil"

"github.com/smallstep/certificates/authority/provisioner"
"github.com/smallstep/certificates/ca"
"github.com/smallstep/certificates/cas/apiv1"
"go.step.sm/cli-utils/ui"
"go.step.sm/crypto/jose"
"go.step.sm/crypto/randutil"
)

type jwkIssuer struct {
Expand Down
13 changes: 7 additions & 6 deletions cmd/step-ca/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ import (
//nolint:gosec // profile server, if enabled runs on a different port
_ "net/http/pprof"

"github.com/urfave/cli"

"github.com/smallstep/certificates/authority"
"github.com/smallstep/certificates/commands"
"github.com/urfave/cli"
"go.step.sm/cli-utils/command"
"go.step.sm/cli-utils/command/version"
"go.step.sm/cli-utils/step"
"go.step.sm/cli-utils/ui"
"go.step.sm/cli-utils/usage"
"github.com/smallstep/cli-utils/command"
"github.com/smallstep/cli-utils/command/version"
"github.com/smallstep/cli-utils/step"
"github.com/smallstep/cli-utils/ui"
"github.com/smallstep/cli-utils/usage"
"go.step.sm/crypto/pemutil"

// Enabled kms interfaces.
Expand Down
8 changes: 5 additions & 3 deletions commands/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,17 @@ import (
"unicode"

"github.com/pkg/errors"
"github.com/urfave/cli"

"github.com/smallstep/cli-utils/errs"
"github.com/smallstep/cli-utils/step"

"github.com/smallstep/certificates/acme"
"github.com/smallstep/certificates/authority/config"
"github.com/smallstep/certificates/authority/provisioner"
"github.com/smallstep/certificates/ca"
"github.com/smallstep/certificates/db"
"github.com/smallstep/certificates/pki"
"github.com/urfave/cli"
"go.step.sm/cli-utils/errs"
"go.step.sm/cli-utils/step"
)

// AppCommand is the action used as the top action.
Expand Down
9 changes: 5 additions & 4 deletions commands/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ import (
"unicode"

"github.com/pkg/errors"
"github.com/smallstep/certificates/authority"
"github.com/smallstep/certificates/authority/config"
"github.com/urfave/cli"
"google.golang.org/protobuf/encoding/protojson"

"go.step.sm/cli-utils/command"
"go.step.sm/cli-utils/errs"
"github.com/smallstep/cli-utils/command"
"github.com/smallstep/cli-utils/errs"

"github.com/smallstep/certificates/authority"
"github.com/smallstep/certificates/authority/config"
)

func init() {
Expand Down
14 changes: 8 additions & 6 deletions commands/onboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,18 @@ import (
"os"

"github.com/pkg/errors"
"github.com/urfave/cli"

"github.com/smallstep/cli-utils/command"
"github.com/smallstep/cli-utils/errs"
"github.com/smallstep/cli-utils/fileutil"
"github.com/smallstep/cli-utils/ui"
"go.step.sm/crypto/randutil"

"github.com/smallstep/certificates/authority/config"
"github.com/smallstep/certificates/ca"
"github.com/smallstep/certificates/cas/apiv1"
"github.com/smallstep/certificates/pki"
"github.com/urfave/cli"
"go.step.sm/cli-utils/command"
"go.step.sm/cli-utils/errs"
"go.step.sm/cli-utils/fileutil"
"go.step.sm/cli-utils/ui"
"go.step.sm/crypto/randutil"
)

// defaultOnboardingURL is the production onboarding url, to use a development
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ require (
github.com/sirupsen/logrus v1.9.3
github.com/slackhq/nebula v1.9.4
github.com/smallstep/assert v0.0.0-20200723003110-82e2b9b3b262
github.com/smallstep/cli-utils v0.10.0
github.com/smallstep/go-attestation v0.4.4-0.20240109183208-413678f90935
github.com/smallstep/nosql v0.7.0
github.com/smallstep/pkcs7 v0.0.0-20240911091500-b1cae6277023
github.com/smallstep/scep v0.0.0-20240926084937-8cf1ca453101
github.com/stretchr/testify v1.9.0
github.com/urfave/cli v1.22.16
go.step.sm/cli-utils v0.9.0
go.step.sm/crypto v0.54.0
go.step.sm/linkedca v0.22.1
golang.org/x/crypto v0.28.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,8 @@ github.com/slackhq/nebula v1.9.4 h1:p06JxtXT/OBMWt2OQkY7F0phOBb42X93YWNsS1yqC9o=
github.com/slackhq/nebula v1.9.4/go.mod h1:1+4q4wd3dDAjO8rKCttSb9JIVbklQhuJiBp5I0lbIsQ=
github.com/smallstep/assert v0.0.0-20200723003110-82e2b9b3b262 h1:unQFBIznI+VYD1/1fApl1A+9VcBk+9dcqGfnePY87LY=
github.com/smallstep/assert v0.0.0-20200723003110-82e2b9b3b262/go.mod h1:MyOHs9Po2fbM1LHej6sBUT8ozbxmMOFG+E+rx/GSGuc=
github.com/smallstep/cli-utils v0.10.0 h1:CfXNvHtIN5pAzGvGP0NEUZoGFcj5epNEB6RSpSfduek=
github.com/smallstep/cli-utils v0.10.0/go.mod h1:jIeNa5ctrVg89lU5TaQKYd6o1eFxi9mtZu1sXSxpEBg=
github.com/smallstep/go-attestation v0.4.4-0.20240109183208-413678f90935 h1:kjYvkvS/Wdy0PVRDUAA0gGJIVSEZYhiAJtfwYgOYoGA=
github.com/smallstep/go-attestation v0.4.4-0.20240109183208-413678f90935/go.mod h1:vNAduivU014fubg6ewygkAvQC0IQVXqdc8vaGl/0er4=
github.com/smallstep/nosql v0.7.0 h1:YiWC9ZAHcrLCrayfaF+QJUv16I2bZ7KdLC3RpJcnAnE=
Expand Down Expand Up @@ -434,8 +436,6 @@ go.opentelemetry.io/otel/sdk v1.29.0 h1:vkqKjk7gwhS8VaWb0POZKmIEDimRCMsopNYnriHy
go.opentelemetry.io/otel/sdk v1.29.0/go.mod h1:pM8Dx5WKnvxLCb+8lG1PRNIDxu9g9b9g59Qr7hfAAok=
go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4=
go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ=
go.step.sm/cli-utils v0.9.0 h1:55jYcsQbnArNqepZyAwcato6Zy2MoZDRkWW+jF+aPfQ=
go.step.sm/cli-utils v0.9.0/go.mod h1:Y/CRoWl1FVR9j+7PnAewufAwKmBOTzR6l9+7EYGAnp8=
go.step.sm/crypto v0.54.0 h1:V8p+12Ld0NRA/RBMYoKXA0dWmVKZSdCwP56IwzweT9g=
go.step.sm/crypto v0.54.0/go.mod h1:vQJyTngfZDW+UyZdFzOMCY/txWDAmcwViEUC7Gn4YfU=
go.step.sm/linkedca v0.22.1 h1:GvprpH9P4Sv9U+eZ3bxDgRSSpW14cFDYpe1kS6yWLkw=
Expand Down
24 changes: 13 additions & 11 deletions pki/pki.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@ import (
"time"

"github.com/pkg/errors"
"golang.org/x/crypto/ssh"

"github.com/smallstep/cli-utils/errs"
"github.com/smallstep/cli-utils/fileutil"
"github.com/smallstep/cli-utils/step"
"github.com/smallstep/cli-utils/ui"
"github.com/smallstep/nosql"
"go.step.sm/crypto/jose"
"go.step.sm/crypto/kms"
kmsapi "go.step.sm/crypto/kms/apiv1"
"go.step.sm/crypto/pemutil"
"go.step.sm/linkedca"

"github.com/smallstep/certificates/authority"
"github.com/smallstep/certificates/authority/admin"
admindb "github.com/smallstep/certificates/authority/admin/db/nosql"
Expand All @@ -26,17 +39,6 @@ import (
"github.com/smallstep/certificates/cas"
"github.com/smallstep/certificates/cas/apiv1"
"github.com/smallstep/certificates/db"
"github.com/smallstep/nosql"
"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/kms"
kmsapi "go.step.sm/crypto/kms/apiv1"
"go.step.sm/crypto/pemutil"
"go.step.sm/linkedca"
"golang.org/x/crypto/ssh"
)

// DeploymentType defines witch type of deployment a user is initializing
Expand Down
10 changes: 6 additions & 4 deletions pki/pki_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,18 @@ import (
"path/filepath"
"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/smallstep/cli-utils/step"
"github.com/smallstep/nosql"

"github.com/smallstep/certificates/authority/admin"
admindb "github.com/smallstep/certificates/authority/admin/db/nosql"
authconfig "github.com/smallstep/certificates/authority/config"
"github.com/smallstep/certificates/authority/provisioner"
"github.com/smallstep/certificates/cas/apiv1"
"github.com/smallstep/certificates/db"
"github.com/smallstep/nosql"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.step.sm/cli-utils/step"
)

func withDBDataSource(t *testing.T, dataSource string) func(c *authconfig.Config) error {
Expand Down
8 changes: 5 additions & 3 deletions pki/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ import (
"path/filepath"

"github.com/pkg/errors"

"github.com/smallstep/cli-utils/errs"
"github.com/smallstep/cli-utils/fileutil"
"github.com/smallstep/cli-utils/step"

"github.com/smallstep/certificates/templates"
"go.step.sm/cli-utils/errs"
"go.step.sm/cli-utils/fileutil"
"go.step.sm/cli-utils/step"
)

// getTemplates returns all the templates enabled
Expand Down
5 changes: 3 additions & 2 deletions templates/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ import (

"github.com/Masterminds/sprig/v3"
"github.com/pkg/errors"
"go.step.sm/cli-utils/fileutil"
"go.step.sm/cli-utils/step"

"github.com/smallstep/cli-utils/fileutil"
"github.com/smallstep/cli-utils/step"
)

// TemplateType defines how a template will be written in disk.
Expand Down

0 comments on commit b45b73f

Please sign in to comment.