Rebrand user-visible CLI text; add legacy fallbacks for keyring, cache dir and version prefix

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
shadowdaoandClaude Sonnet 5.5 committed 2026-10-12 10:20:06 -07:00
1 parent 4cb3bda43a
commit ab4ed3c9e5
184 files changed
+934 -851

No files matched your search

@@ -28,29 +28,29 @@ func (c *Command) Synopsis() string {
func (c *Command) Help() string {
return base.WrapForHelpText([]string{
"Usage: boundary authenticate [sub command] [options] [args]",
"Usage: threshold authenticate [sub command] [options] [args]",
"",
" This command authenticates the Boundary commandline client using a specified auth method. Examples:",
" This command authenticates the Threshold commandline client using a specified auth method. Examples:",
"",
" Authenticate with the primary auth method in the global scope:",
"",
" $ boundary authenticate",
" $ threshold authenticate",
"",
" Authenticate using the primary auth method in a specific scope",
"",
" $ boundary authenticate password -scope-id o_1234567890",
" $ threshold authenticate password -scope-id o_1234567890",
"",
" Authenticate with a password auth method using a specific auth method ID:",
"",
" $ boundary authenticate password -auth-method-id ampw_1234567890",
" $ threshold authenticate password -auth-method-id ampw_1234567890",
"",
" Authenticate with an OIDC auth method using a specific auth method ID:",
"",
" $ boundary authenticate oidc -auth-method-id amoidc_1234567890",
" $ threshold authenticate oidc -auth-method-id amoidc_1234567890",
"",
" Authenticate with an LDAP auth method:",
"",
" $ boundary authenticate ldap -auth-method-id amldap_1234567890",
" $ threshold authenticate ldap -auth-method-id amldap_1234567890",
"",
" Please see the auth method subcommand help for detailed usage information.",
}) + c.Flags().Help()
@@ -62,7 +62,7 @@ func (c *Command) Flags() *base.FlagSets {
f.StringVar(&base.StringVar{
Name: "scope-id",
EnvVar: "BOUNDARY_SCOPE_ID",
EnvVar: "THRESHOLD_SCOPE_ID",
Target: &c.FlagScopeId,
Usage: "The scope to use for the operation",
})
@@ -95,7 +95,7 @@ func (c *Command) Run(args []string) int {
aClient := authmethods.NewClient(client)
pri, err := getPrimaryAuthMethodId(c.Context, aClient, scope.Global.String(), "")
if err != nil {
c.PrintCliError(errors.New("Error looking up primary auth method ID for the global scope. Try setting a primary auth method for the global scope, or use an auth method subcommand (see 'boundary authenticate -h' for available sub command usage)."))
c.PrintCliError(errors.New("Error looking up primary auth method ID for the global scope. Try setting a primary auth method for the global scope, or use an auth method subcommand (see 'threshold authenticate -h' for available sub command usage)."))
return base.CommandUserError
}
+4 -4
View File
@@ -71,7 +71,7 @@ func saveAndOrPrintToken(c *base.Command, result *authmethods.AuthenticateResult
default:
krConfig := nkeyring.Config{
LibSecretCollectionName: "login",
PassPrefix: "HashiCorp_Boundary",
PassPrefix: base.PassPrefix,
AllowedBackends: []nkeyring.BackendType{nkeyring.BackendType(keyringType)},
}
@@ -100,7 +100,7 @@ func saveAndOrPrintToken(c *base.Command, result *authmethods.AuthenticateResult
switch {
case gotErr:
c.UI.Warn(fmt.Sprintf("The token was not successfully saved to a system keyring. The token is:\n\n%s\n\nIt must be manually passed in via the BOUNDARY_TOKEN env var or -token flag. Storing the token can also be disabled via -keyring-type=none.", token.Token))
c.UI.Warn(fmt.Sprintf("The token was not successfully saved to a system keyring. The token is:\n\n%s\n\nIt must be manually passed in via the THRESHOLD_TOKEN env var or -token flag. Storing the token can also be disabled via -keyring-type=none.", token.Token))
case c.FlagKeyringType == "none":
c.UI.Warn("\nStoring the token in a keyring was disabled. The token is:")
c.UI.Output(token.Token)
@@ -124,11 +124,11 @@ func getPrimaryAuthMethodId(ctx context.Context, client *authmethods.Client, sco
for _, m := range authMethodListResult.GetItems() {
if m.IsPrimary {
if !strings.HasPrefix(m.Id, amType) {
return "", fmt.Errorf("Error looking up primary auth method in scope '%s': got '%s' but the command requires an auth method prefix of '%s'. Make sure the sub command you're using matches the primary auth method type in the scope being used. For example, if using the password sub command the primary auth method must have a prefix of 'ampw'.\n\nSee 'boundary authenticate -h' for available sub command usage.", scopeId, m.Id, amType)
return "", fmt.Errorf("Error looking up primary auth method in scope '%s': got '%s' but the command requires an auth method prefix of '%s'. Make sure the sub command you're using matches the primary auth method type in the scope being used. For example, if using the password sub command the primary auth method must have a prefix of 'ampw'.\n\nSee 'threshold authenticate -h' for available sub command usage.", scopeId, m.Id, amType)
}
return m.Id, nil
}
}
return "", fmt.Errorf("Primary auth method not found for scope ID: '%s'. Please set a primary auth method on this scope or pass one explicitly using an authenticate sub command (see 'boundary authenticate -h') along with the -auth-method-id flag.", scopeId)
return "", fmt.Errorf("Primary auth method not found for scope ID: '%s'. Please set a primary auth method on this scope or pass one explicitly using an authenticate sub command (see 'threshold authenticate -h') along with the -auth-method-id flag.", scopeId)
}
+6 -6
View File
@@ -35,16 +35,16 @@ type LdapCommand struct {
}
func (c *LdapCommand) Synopsis() string {
return wordwrap.WrapString("Invoke the ldap auth method to authenticate with Boundary", base.TermWidth)
return wordwrap.WrapString("Invoke the ldap auth method to authenticate with Threshold", base.TermWidth)
}
func (c *LdapCommand) Help() string {
return base.WrapForHelpText([]string{
"Usage: boundary authenticate ldap [options] [args]",
"Usage: threshold authenticate ldap [options] [args]",
"",
" Invoke the ldap auth method to authenticate the Boundary CLI. Example:",
" Invoke the ldap auth method to authenticate the Threshold CLI. Example:",
"",
` $ boundary authenticate ldap -auth-method-id amldap_1234567890 -login-name foo`,
` $ threshold authenticate ldap -auth-method-id amldap_1234567890 -login-name foo`,
"",
"",
}) + c.Flags().Help()
@@ -70,7 +70,7 @@ func (c *LdapCommand) Flags() *base.FlagSets {
f.StringVar(&base.StringVar{
Name: "auth-method-id",
EnvVar: "BOUNDARY_AUTH_METHOD_ID",
EnvVar: "THRESHOLD_AUTH_METHOD_ID",
Target: &c.FlagAuthMethodId,
Usage: "The auth-method resource to use for the operation.",
})
@@ -78,7 +78,7 @@ func (c *LdapCommand) Flags() *base.FlagSets {
if !c.parsedOpts.WithSkipScopeIdFlag {
f.StringVar(&base.StringVar{
Name: "scope-id",
EnvVar: "BOUNDARY_SCOPE_ID",
EnvVar: "THRESHOLD_SCOPE_ID",
Target: &c.FlagScopeId,
Usage: "The scope ID to use for the operation.",
})
+6 -6
View File
@@ -33,16 +33,16 @@ type OidcCommand struct {
}
func (c *OidcCommand) Synopsis() string {
return wordwrap.WrapString("Invoke the OIDC auth method to authenticate with Boundary", base.TermWidth)
return wordwrap.WrapString("Invoke the OIDC auth method to authenticate with Threshold", base.TermWidth)
}
func (c *OidcCommand) Help() string {
return base.WrapForHelpText([]string{
"Usage: boundary authenticate oidc [options] [args]",
"Usage: threshold authenticate oidc [options] [args]",
"",
" Invoke the OIDC auth method to authenticate the Boundary CLI. Example:",
" Invoke the OIDC auth method to authenticate the Threshold CLI. Example:",
"",
` $ boundary authenticate oidc -auth-method-id amoidc_1234567890`,
` $ threshold authenticate oidc -auth-method-id amoidc_1234567890`,
"",
"",
}) + c.Flags().Help()
@@ -54,7 +54,7 @@ func (c *OidcCommand) Flags() *base.FlagSets {
f.StringVar(&base.StringVar{
Name: "auth-method-id",
EnvVar: "BOUNDARY_AUTH_METHOD_ID",
EnvVar: "THRESHOLD_AUTH_METHOD_ID",
Target: &c.FlagAuthMethodId,
Usage: "The auth-method resource to use for the operation",
})
@@ -62,7 +62,7 @@ func (c *OidcCommand) Flags() *base.FlagSets {
if !c.parsedOpts.WithSkipScopeIdFlag {
f.StringVar(&base.StringVar{
Name: "scope-id",
EnvVar: "BOUNDARY_SCOPE_ID",
EnvVar: "THRESHOLD_SCOPE_ID",
Target: &c.FlagScopeId,
Usage: "The scope ID to use for the operation.",
})
@@ -26,8 +26,8 @@ var (
)
var (
envPassword = "BOUNDARY_AUTHENTICATE_PASSWORD_PASSWORD"
envLoginName = "BOUNDARY_AUTHENTICATE_PASSWORD_LOGIN_NAME"
envPassword = "THRESHOLD_AUTHENTICATE_PASSWORD_PASSWORD"
envLoginName = "THRESHOLD_AUTHENTICATE_PASSWORD_LOGIN_NAME"
)
type PasswordCommand struct {
@@ -40,16 +40,16 @@ type PasswordCommand struct {
}
func (c *PasswordCommand) Synopsis() string {
return wordwrap.WrapString("Invoke the password auth method to authenticate with Boundary", base.TermWidth)
return wordwrap.WrapString("Invoke the password auth method to authenticate with Threshold", base.TermWidth)
}
func (c *PasswordCommand) Help() string {
return base.WrapForHelpText([]string{
"Usage: boundary authenticate password [options] [args]",
"Usage: threshold authenticate password [options] [args]",
"",
" Invoke the password auth method to authenticate the Boundary CLI. Example:",
" Invoke the password auth method to authenticate the Threshold CLI. Example:",
"",
` $ boundary authenticate password -auth-method-id ampw_1234567890 -login-name foo`,
` $ threshold authenticate password -auth-method-id ampw_1234567890 -login-name foo`,
"",
"",
}) + c.Flags().Help()
@@ -75,7 +75,7 @@ func (c *PasswordCommand) Flags() *base.FlagSets {
f.StringVar(&base.StringVar{
Name: "auth-method-id",
EnvVar: "BOUNDARY_AUTH_METHOD_ID",
EnvVar: "THRESHOLD_AUTH_METHOD_ID",
Target: &c.FlagAuthMethodId,
Usage: "The auth-method resource to use for the operation.",
})
@@ -83,7 +83,7 @@ func (c *PasswordCommand) Flags() *base.FlagSets {
if !c.parsedOpts.WithSkipScopeIdFlag {
f.StringVar(&base.StringVar{
Name: "scope-id",
EnvVar: "BOUNDARY_SCOPE_ID",
EnvVar: "THRESHOLD_SCOPE_ID",
Target: &c.FlagScopeId,
Usage: "The scope ID to use for the operation.",
})