Skip to content

Commit

Permalink
Use github.com/smallstep/cli-utils and reorder imports
Browse files Browse the repository at this point in the history
  • Loading branch information
hslatman committed Sep 30, 2024
1 parent bec3072 commit de85fd0
Show file tree
Hide file tree
Showing 134 changed files with 659 additions and 441 deletions.
6 changes: 3 additions & 3 deletions command/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ should exist within its own package if possible. For example, `version` and
Any package used by a command but does not contain explicit business logic
directly related to the command should exist in the top-level of this
repository. For example, the `github.com/smallstep/cli/flags` and
`go.step.sm/cli-utils/errs` package are used by many different commands and
`github.com/smallstep/cli-utils/errs` package are used by many different commands and
contain functionality for defining flags and creating/manipulating errors.

### Adding a Command
Expand Down Expand Up @@ -70,8 +70,8 @@ There are three packages which contain functionality to make writing commands ea

- `github.com/smallstep/cli/flags`
- `github.com/smallstep/cli/prompts`
- `go.step.sm/cli-utils/errs`
- `go.step.sm/cli-utils/usage`
- `github.com/smallstep/cli-utils/errs`
- `github.com/smallstep/cli-utils/usage`

The usage package is used to extend the default documentation provided by
`urfave/cli` by enabling us to document arguments, whether they are optional or
Expand Down
6 changes: 4 additions & 2 deletions command/api/api.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package api

import (
"github.com/smallstep/cli/command/api/token"
"github.com/urfave/cli"
"go.step.sm/cli-utils/command"

"github.com/smallstep/cli-utils/command"

"github.com/smallstep/cli/command/api/token"
)

func init() {
Expand Down
5 changes: 3 additions & 2 deletions command/api/token/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ import (

"github.com/google/uuid"
"github.com/urfave/cli"
"go.step.sm/cli-utils/errs"
"go.step.sm/cli-utils/ui"

"github.com/smallstep/cli-utils/errs"
"github.com/smallstep/cli-utils/ui"
)

func createCommand() cli.Command {
Expand Down
6 changes: 4 additions & 2 deletions command/base64/base64.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ import (
"strings"

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

"github.com/smallstep/cli-utils/command"

"github.com/smallstep/cli/utils"
)

func init() {
Expand Down
6 changes: 4 additions & 2 deletions command/beta/beta.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package beta

import (
"github.com/smallstep/cli/command/ca"
"github.com/urfave/cli"
"go.step.sm/cli-utils/command"

"github.com/smallstep/cli-utils/command"

"github.com/smallstep/cli/command/ca"
)

// init creates and registers the ca command
Expand Down
4 changes: 2 additions & 2 deletions command/ca/acme/eab/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"github.com/pkg/errors"
"github.com/urfave/cli"

"go.step.sm/cli-utils/errs"

adminAPI "github.com/smallstep/certificates/authority/admin/api"
"github.com/smallstep/cli-utils/errs"

"github.com/smallstep/cli/flags"
"github.com/smallstep/cli/utils/cautils"
)
Expand Down
3 changes: 2 additions & 1 deletion command/ca/acme/eab/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ import (

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

"github.com/smallstep/certificates/ca"
"github.com/smallstep/cli-utils/errs"

"github.com/smallstep/cli/flags"
"github.com/smallstep/cli/utils/cautils"
)
Expand Down
2 changes: 1 addition & 1 deletion command/ca/acme/eab/remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/pkg/errors"
"github.com/urfave/cli"

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

"github.com/smallstep/cli/flags"
"github.com/smallstep/cli/utils/cautils"
Expand Down
8 changes: 5 additions & 3 deletions command/ca/admin/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ import (
"os"
"text/tabwriter"

"github.com/urfave/cli"

adminAPI "github.com/smallstep/certificates/authority/admin/api"
"github.com/smallstep/cli-utils/errs"
"go.step.sm/linkedca"

"github.com/smallstep/cli/flags"
"github.com/smallstep/cli/utils/cautils"
"github.com/urfave/cli"
"go.step.sm/cli-utils/errs"
"go.step.sm/linkedca"
)

func addCommand() cli.Command {
Expand Down
6 changes: 3 additions & 3 deletions command/ca/admin/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import (
"errors"
"fmt"

"github.com/smallstep/certificates/ca"
"github.com/urfave/cli"

"go.step.sm/cli-utils/errs"
"go.step.sm/cli-utils/ui"
"github.com/smallstep/certificates/ca"
"github.com/smallstep/cli-utils/errs"
"github.com/smallstep/cli-utils/ui"
"go.step.sm/linkedca"
)

Expand Down
8 changes: 5 additions & 3 deletions command/ca/admin/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ import (
"os"
"text/tabwriter"

"github.com/smallstep/cli/flags"
"github.com/smallstep/cli/utils/cautils"
"github.com/urfave/cli"
"go.step.sm/cli-utils/errs"

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

"github.com/smallstep/cli/flags"
"github.com/smallstep/cli/utils/cautils"
)

func listCommand() cli.Command {
Expand Down
6 changes: 4 additions & 2 deletions command/ca/admin/remove.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package admin

import (
"github.com/urfave/cli"

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

"github.com/smallstep/cli/flags"
"github.com/smallstep/cli/utils/cautils"
"github.com/urfave/cli"
"go.step.sm/cli-utils/errs"
)

func removeCommand() cli.Command {
Expand Down
8 changes: 5 additions & 3 deletions command/ca/admin/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ import (
"os"
"text/tabwriter"

"github.com/urfave/cli"

adminAPI "github.com/smallstep/certificates/authority/admin/api"
"github.com/smallstep/cli-utils/errs"
"go.step.sm/linkedca"

"github.com/smallstep/cli/flags"
"github.com/smallstep/cli/utils/cautils"
"github.com/urfave/cli"
"go.step.sm/cli-utils/errs"
"go.step.sm/linkedca"
)

func updateCommand() cli.Command {
Expand Down
8 changes: 5 additions & 3 deletions command/ca/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ package ca
import (
"strings"

"github.com/urfave/cli"

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

"github.com/smallstep/cli/flags"
"github.com/smallstep/cli/utils/cautils"
"github.com/urfave/cli"
"go.step.sm/cli-utils/command"
"go.step.sm/cli-utils/errs"
)

func bootstrapCommand() cli.Command {
Expand Down
6 changes: 4 additions & 2 deletions command/ca/ca.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package ca

import (
"github.com/urfave/cli"

"github.com/smallstep/cli-utils/command"

"github.com/smallstep/cli/command/ca/acme"
"github.com/smallstep/cli/command/ca/admin"
"github.com/smallstep/cli/command/ca/policy"
"github.com/smallstep/cli/command/ca/provisioner"
"github.com/urfave/cli"
"go.step.sm/cli-utils/command"
)

// init creates and registers the ca command
Expand Down
14 changes: 8 additions & 6 deletions command/ca/certificate.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@ import (
"strings"

"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/step"
"github.com/smallstep/cli-utils/ui"
"go.step.sm/crypto/pemutil"

"github.com/smallstep/cli/flags"
"github.com/smallstep/cli/token"
"github.com/smallstep/cli/utils/cautils"
"github.com/urfave/cli"
"go.step.sm/cli-utils/command"
"go.step.sm/cli-utils/errs"
"go.step.sm/cli-utils/step"
"go.step.sm/cli-utils/ui"
"go.step.sm/crypto/pemutil"
)

func certificateCommand() cli.Command {
Expand Down
12 changes: 7 additions & 5 deletions command/ca/federation.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,18 @@ import (
"os"

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

"github.com/smallstep/certificates/api"
"github.com/smallstep/certificates/ca"
"github.com/smallstep/certificates/pki"
"github.com/smallstep/cli-utils/command"
"github.com/smallstep/cli-utils/errs"
"github.com/smallstep/cli-utils/ui"
"go.step.sm/crypto/pemutil"

"github.com/smallstep/cli/flags"
"github.com/smallstep/cli/utils"
"github.com/urfave/cli"
"go.step.sm/cli-utils/command"
"go.step.sm/cli-utils/errs"
"go.step.sm/cli-utils/ui"
"go.step.sm/crypto/pemutil"
)

type flowType int
Expand Down
6 changes: 4 additions & 2 deletions command/ca/health.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ import (
"fmt"
"os"

"github.com/urfave/cli"

"github.com/smallstep/certificates/ca"
"github.com/smallstep/certificates/pki"
"github.com/smallstep/cli-utils/errs"

"github.com/smallstep/cli/flags"
"github.com/urfave/cli"
"go.step.sm/cli-utils/errs"
)

func healthCommand() cli.Command {
Expand Down
19 changes: 9 additions & 10 deletions command/ca/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,20 @@ import (

"github.com/manifoldco/promptui"
"github.com/pkg/errors"
"github.com/smallstep/certificates/cas/apiv1"
"github.com/smallstep/certificates/pki"
"github.com/smallstep/cli/flags"
"github.com/smallstep/cli/utils"
"github.com/smallstep/cli/utils/cautils"
"github.com/urfave/cli"

"go.step.sm/cli-utils/errs"
"go.step.sm/cli-utils/step"
"go.step.sm/cli-utils/ui"
"github.com/smallstep/certificates/cas/apiv1"
"github.com/smallstep/certificates/pki"
"github.com/smallstep/cli-utils/errs"
"github.com/smallstep/cli-utils/step"
"github.com/smallstep/cli-utils/ui"
"go.step.sm/crypto/kms"
_ "go.step.sm/crypto/kms/azurekms" // enable azurekms
"go.step.sm/crypto/pemutil"

// Enable azurekms
_ "go.step.sm/crypto/kms/azurekms"
"github.com/smallstep/cli/flags"
"github.com/smallstep/cli/utils"
"github.com/smallstep/cli/utils/cautils"
)

func initCommand() cli.Command {
Expand Down
3 changes: 2 additions & 1 deletion command/ca/policy/actions/cn.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import (
"fmt"

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

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

"github.com/smallstep/cli/command/ca/policy/policycontext"
"github.com/smallstep/cli/flags"
Expand Down
3 changes: 2 additions & 1 deletion command/ca/policy/actions/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import (
"fmt"

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

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

"github.com/smallstep/cli/command/ca/policy/policycontext"
"github.com/smallstep/cli/flags"
Expand Down
3 changes: 2 additions & 1 deletion command/ca/policy/actions/emails.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import (
"fmt"

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

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

"github.com/smallstep/cli/command/ca/policy/policycontext"
"github.com/smallstep/cli/flags"
Expand Down
3 changes: 2 additions & 1 deletion command/ca/policy/actions/ips.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import (
"fmt"

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

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

"github.com/smallstep/cli/command/ca/policy/policycontext"
"github.com/smallstep/cli/flags"
Expand Down
4 changes: 2 additions & 2 deletions command/ca/policy/actions/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
"github.com/urfave/cli"
"google.golang.org/protobuf/encoding/protojson"

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

"github.com/smallstep/certificates/ca"
"github.com/smallstep/cli/command/ca/policy/policycontext"
"github.com/smallstep/cli/internal/command"
)
Expand Down
3 changes: 2 additions & 1 deletion command/ca/policy/actions/principals.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import (
"fmt"

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

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

"github.com/smallstep/cli/command/ca/policy/policycontext"
"github.com/smallstep/cli/flags"
Expand Down
6 changes: 4 additions & 2 deletions command/ca/policy/actions/remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ import (
"errors"
"fmt"

"github.com/urfave/cli"

"github.com/smallstep/certificates/ca"
"github.com/smallstep/cli-utils/errs"

"github.com/smallstep/cli/command/ca/policy/policycontext"
"github.com/smallstep/cli/flags"
"github.com/smallstep/cli/internal/command"
"github.com/smallstep/cli/utils/cautils"
"github.com/urfave/cli"
"go.step.sm/cli-utils/errs"
)

// RemoveCommand returns the policy remove subcommand.
Expand Down
Loading

0 comments on commit de85fd0

Please sign in to comment.