mirror of
https://github.com/passbolt/go-passbolt-cli.git
synced 2025-07-13 05:09:09 +00:00
add shellescapse, update deps
This commit is contained in:
parent
bf4a0c8d4a
commit
f373792c06
10 changed files with 182 additions and 85 deletions
|
@ -4,6 +4,7 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/alessio/shellescape"
|
||||
"github.com/speatzle/go-passbolt-cli/util"
|
||||
"github.com/speatzle/go-passbolt/helper"
|
||||
"github.com/spf13/cobra"
|
||||
|
@ -47,10 +48,10 @@ func ResourceGet(cmd *cobra.Command, args []string) error {
|
|||
return fmt.Errorf("Getting Resource: %w", err)
|
||||
}
|
||||
fmt.Printf("FolderParentID: %v\n", folderParentID)
|
||||
fmt.Printf("Name: %v\n", name)
|
||||
fmt.Printf("Username: %v\n", username)
|
||||
fmt.Printf("URI: %v\n", uri)
|
||||
fmt.Printf("Password: %v\n", password)
|
||||
fmt.Printf("Description: %v\n", description)
|
||||
fmt.Printf("Name: %v\n", shellescape.StripUnsafe(name))
|
||||
fmt.Printf("Username: %v\n", shellescape.StripUnsafe(username))
|
||||
fmt.Printf("URI: %v\n", shellescape.StripUnsafe(uri))
|
||||
fmt.Printf("Password: %v\n", shellescape.StripUnsafe(password))
|
||||
fmt.Printf("Description: %v\n", shellescape.StripUnsafe(description))
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import (
|
|||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/alessio/shellescape"
|
||||
"github.com/speatzle/go-passbolt-cli/util"
|
||||
"github.com/speatzle/go-passbolt/api"
|
||||
"github.com/speatzle/go-passbolt/helper"
|
||||
|
@ -87,23 +88,23 @@ func ResourceList(cmd *cobra.Command, args []string) error {
|
|||
case "folderparentid":
|
||||
entry[i] = resource.FolderParentID
|
||||
case "name":
|
||||
entry[i] = resource.Name
|
||||
entry[i] = shellescape.StripUnsafe(resource.Name)
|
||||
case "username":
|
||||
entry[i] = resource.Username
|
||||
entry[i] = shellescape.StripUnsafe(resource.Username)
|
||||
case "uri":
|
||||
entry[i] = resource.URI
|
||||
entry[i] = shellescape.StripUnsafe(resource.URI)
|
||||
case "password":
|
||||
_, _, _, _, pass, _, err := helper.GetResource(ctx, client, resource.ID)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Get Resource %w", err)
|
||||
}
|
||||
entry[i] = pass
|
||||
entry[i] = shellescape.StripUnsafe(pass)
|
||||
case "description":
|
||||
_, _, _, _, _, desc, err := helper.GetResource(ctx, client, resource.ID)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Get Resource %w", err)
|
||||
}
|
||||
entry[i] = desc
|
||||
entry[i] = shellescape.StripUnsafe(desc)
|
||||
default:
|
||||
cmd.SilenceUsage = false
|
||||
return fmt.Errorf("Unknown Column: %v", columns[i])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue