Skip to content

Commit

Permalink
feat(cli): rot enhanced logging and refactor.
Browse files Browse the repository at this point in the history
Signed-off-by: sbailey <[email protected]>
  • Loading branch information
spbsoluble committed Mar 20, 2024
1 parent 5facdd6 commit c55d95d
Show file tree
Hide file tree
Showing 3 changed files with 1,523 additions and 475 deletions.
2 changes: 2 additions & 0 deletions cmd/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@ const (
DebugFuncEnter = "entered: %s"
DebugFuncExit = "exiting: %s"
DebugFuncCall = "calling: %s"
ErrMsgEmptyResponse = "empty response received from Keyfactor Command %s"
)

var ProviderTypeChoices = []string{
"azid",
}
var ValidAuthProviders = [2]string{"azure-id", "azid"}
var ErrKfcEmptyResponse = fmt.Errorf("empty response recieved from Keyfactor Command")

// Error messages
var (
Expand Down
20 changes: 16 additions & 4 deletions cmd/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,30 @@ import (
"encoding/json"
"errors"
"fmt"
"github.com/google/uuid"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
"io"
"net/http"
"os"
"path/filepath"
"strconv"
"time"

"github.com/google/uuid"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
)

func mergeErrsToString(errs *[]error) string {
var errStr string
if errs == nil || len(*errs) == 0 {
return ""
}
for _, err := range *errs {
errStr += fmt.Sprintf("%s\n", err)
}
return errStr
}

func boolToPointer(b bool) *bool {
return &b
}
Expand Down
Loading

0 comments on commit c55d95d

Please sign in to comment.