The name. The name. The name!

This commit is contained in:
Jeff Mitchell committed 2020-08-10 17:15:02 -04:00
1 parent 1c836c430b
commit 6661117d4c
321 files changed
+1295 -1300

No files matched your search

@@ -1,7 +1,7 @@
package authenticate
import (
"github.com/hashicorp/watchtower/internal/cmd/base"
"github.com/hashicorp/boundary/internal/cmd/base"
"github.com/mitchellh/cli"
"github.com/mitchellh/go-wordwrap"
)
@@ -13,18 +13,18 @@ type Command struct {
}
func (c *Command) Synopsis() string {
return wordwrap.WrapString("Authenticate the Watchtower commandline client", base.TermWidth)
return wordwrap.WrapString("Authenticate the Boundary commandline client", base.TermWidth)
}
func (c *Command) Help() string {
return base.WrapForHelpText([]string{
"Usage: watchtower authenticate [sub command] [options] [args]",
"Usage: boundary authenticate [sub command] [options] [args]",
"",
" This command authenticates the Watchtower commandline client using a specified auth method. Examples:",
" This command authenticates the Boundary commandline client using a specified auth method. Examples:",
"",
" Authenticate with password auth method:",
"",
" $ watchtower authenticate password -name foo -password bar",
" $ boundary authenticate password -name foo -password bar",
"",
" Please see the auth method subcommand help for detailed usage information.",
})
+11 -11
View File
@@ -8,9 +8,9 @@ import (
"strings"
"time"
"github.com/hashicorp/boundary/api/authmethods"
"github.com/hashicorp/boundary/internal/cmd/base"
"github.com/hashicorp/vault/sdk/helper/password"
"github.com/hashicorp/watchtower/api/authmethods"
"github.com/hashicorp/watchtower/internal/cmd/base"
"github.com/kr/pretty"
"github.com/mitchellh/cli"
"github.com/mitchellh/go-wordwrap"
@@ -21,9 +21,9 @@ import (
var _ cli.Command = (*PasswordCommand)(nil)
var _ cli.CommandAutocomplete = (*PasswordCommand)(nil)
var envPassword = "WATCHTOWER_AUTHENTICATE_PASSWORD"
var envName = "WATCHTOWER_AUTHENTICATE_NAME"
var envMethodId = "WATCHTOWER_AUTHENTICATE_METHOD_ID"
var envPassword = "BOUNDARY_AUTHENTICATE_PASSWORD"
var envName = "BOUNDARY_AUTHENTICATE_NAME"
var envMethodId = "BOUNDARY_AUTHENTICATE_METHOD_ID"
type PasswordCommand struct {
*base.Command
@@ -34,20 +34,20 @@ type PasswordCommand struct {
}
func (c *PasswordCommand) Synopsis() string {
return wordwrap.WrapString("Invoke the password auth method to authenticate with Watchtower", base.TermWidth)
return wordwrap.WrapString("Invoke the password auth method to authenticate with Boundary", base.TermWidth)
}
func (c *PasswordCommand) Help() string {
return base.WrapForHelpText([]string{
"Usage: watchtower authenticate password [options] [args]",
"Usage: boundary authenticate password [options] [args]",
"",
" Invoke the password auth method to authenticate the Watchtower CLI:",
" Invoke the password auth method to authenticate the Boundary CLI:",
"",
" $ watchtower authenticate password -name=foo -password=bar",
" $ boundary authenticate password -name=foo -password=bar",
"",
" If more than one instance of the password auth method exists, use the -method-id flag:",
"",
` $ watchtower authenticate password -method-id am_12345 -name foo -password "bar"`,
` $ boundary authenticate password -method-id am_12345 -name foo -password "bar"`,
}) + c.Flags().Help()
}
@@ -156,7 +156,7 @@ func (c *PasswordCommand) Run(args []string) int {
c.UI.Error(fmt.Sprintf("Error marshaling auth token to save to system credential store: %s", err))
return 1
}
if err := keyring.Set("HashiCorp Watchtower Auth Token", tokenName, base64.RawStdEncoding.EncodeToString(marshaled)); err != nil {
if err := keyring.Set("HashiCorp Boundary Auth Token", tokenName, base64.RawStdEncoding.EncodeToString(marshaled)); err != nil {
c.UI.Error(fmt.Sprintf("Error saving auth token to system credential store: %s", err))
return 1
}