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

+19 -15
View File
@@ -72,16 +72,20 @@ const (
// maxLineLength is the maximum width of any line.
maxLineLength int = 78
envToken = "BOUNDARY_TOKEN"
EnvTokenName = "BOUNDARY_TOKEN_NAME"
EnvKeyringType = "BOUNDARY_KEYRING_TYPE"
envRecoveryConfig = "BOUNDARY_RECOVERY_CONFIG"
envSkipCacheDaemon = "BOUNDARY_SKIP_CACHE_DAEMON"
envSkipClientAgent = "BOUNDARY_SKIP_CLIENT_AGENT"
EnvClientAgentPort = "BOUNDARY_CLIENT_AGENT_LISTENING_PORT"
EnvBoundaryClientAgentCliErrorOutput = "BOUNDARY_CLIENT_AGENT_CLI_ERROR_OUTPUT"
envToken = "THRESHOLD_TOKEN"
EnvTokenName = "THRESHOLD_TOKEN_NAME"
EnvKeyringType = "THRESHOLD_KEYRING_TYPE"
envRecoveryConfig = "THRESHOLD_RECOVERY_CONFIG"
envSkipCacheDaemon = "THRESHOLD_SKIP_CACHE_DAEMON"
envSkipClientAgent = "THRESHOLD_SKIP_CLIENT_AGENT"
EnvClientAgentPort = "THRESHOLD_CLIENT_AGENT_LISTENING_PORT"
EnvBoundaryClientAgentCliErrorOutput = "THRESHOLD_CLIENT_AGENT_CLI_ERROR_OUTPUT"
StoredTokenName = "HashiCorp Boundary Auth Token"
// StoredTokenName is the name of the credential entry written to
// wincred/keychain keyrings. LegacyStoredTokenName is the name used by
// upstream HashiCorp Boundary; it is only read (and deleted on logout).
StoredTokenName = "Threshold Auth Token"
LegacyStoredTokenName = "HashiCorp Boundary Auth Token"
)
// reRemoveWhitespace is a regular expression for stripping whitespace from
@@ -340,8 +344,8 @@ func (c *Command) Client(opt ...Option) (*api.Client, error) {
c.client.SetToken(token)
case api.Getenv(envToken) != "":
// Backwards compat: allow reading from existing BOUNDARY_TOKEN env var
c.UI.Warn(`Direct usage of BOUNDARY_TOKEN env var is deprecated; please use "-token env://<env var name>" format, e.g. "-token env://BOUNDARY_TOKEN" to specify an env var to use.`)
// Backwards compat: allow reading from existing THRESHOLD_TOKEN env var
c.UI.Warn(`Direct usage of THRESHOLD_TOKEN env var is deprecated; please use "-token env://<env var name>" format, e.g. "-token env://THRESHOLD_TOKEN" to specify an env var to use.`)
c.client.SetToken(api.Getenv(envToken))
case c.client.Token() == "" && strings.ToLower(c.FlagKeyringType) != "none":
@@ -393,7 +397,7 @@ func (c *Command) FlagSet(bit FlagSetBit) *FlagSets {
Target: &c.FlagAddr,
EnvVar: api.EnvBoundaryAddr,
Completion: complete.PredictAnything,
Usage: "Addr of the Boundary controller, as a complete URL (e.g. https://boundary.example.com:9200).",
Usage: "Addr of the Threshold controller, as a complete URL (e.g. https://threshold.example.com:9200).",
})
f.StringVar(&StringVar{
@@ -421,7 +425,7 @@ func (c *Command) FlagSet(bit FlagSetBit) *FlagSets {
EnvVar: api.EnvBoundaryClientCert,
Completion: complete.PredictFiles("*"),
Usage: "Path on the local disk to a single PEM-encoded CA " +
"certificate to use for TLS authentication to the Boundary Controller. If " +
"certificate to use for TLS authentication to the Threshold Controller. If " +
"this flag is specified, -client-key is also required.",
})
@@ -439,7 +443,7 @@ func (c *Command) FlagSet(bit FlagSetBit) *FlagSets {
Target: &c.flagTLSServerName,
EnvVar: api.EnvBoundaryTLSServerName,
Completion: complete.PredictAnything,
Usage: "Name to use as the SNI host when connecting to the Boundary " +
Usage: "Name to use as the SNI host when connecting to the Threshold " +
"server via TLS.",
})
@@ -449,7 +453,7 @@ func (c *Command) FlagSet(bit FlagSetBit) *FlagSets {
EnvVar: api.EnvBoundaryTLSInsecure,
Usage: "Disable verification of TLS certificates. Using this option " +
"is highly discouraged as it decreases the security of data " +
"transmissions to and from the Boundary server.",
"transmissions to and from the Threshold server.",
})
}
+3 -3
View File
@@ -5,7 +5,7 @@ package base
const (
// FlagNameAddr is the flag used in the base command to read in the
// address of the Boundary server.
// address of the Threshold server.
FlagNameAddr = "addr"
// FlagnameCACert is the flag used in the base command to read in the CA
// cert.
@@ -28,6 +28,6 @@ const (
)
const (
EnvBoundaryCLINoColor = `BOUNDARY_CLI_NO_COLOR`
EnvBoundaryCLIFormat = `BOUNDARY_CLI_FORMAT`
EnvBoundaryCLINoColor = `THRESHOLD_CLI_NO_COLOR`
EnvBoundaryCLIFormat = `THRESHOLD_CLI_FORMAT`
)
+2 -2
View File
@@ -350,7 +350,7 @@ func (b *Server) createInitialLdapAuthMethod(ctx context.Context, host string, p
scope.Global.String(),
ldap.WithUrls(ctx, u),
ldap.WithName(ctx, "Generated global scope initial ldap auth method"),
ldap.WithDescription(ctx, "Provides initial administrative and unprivileged authentication into Boundary"),
ldap.WithDescription(ctx, "Provides initial administrative and unprivileged authentication into Threshold"),
ldap.WithDiscoverDn(ctx),
ldap.WithUserDn(ctx, testdirectory.DefaultUserDN),
ldap.WithGroupDn(ctx, testdirectory.DefaultGroupDN),
@@ -602,7 +602,7 @@ func (b *Server) createInitialOidcAuthMethod(ctx context.Context) (*oidc.AuthMet
b.DevOidcSetup.clientId,
b.DevOidcSetup.clientSecret,
oidc.WithName("Generated global scope initial oidc auth method"),
oidc.WithDescription("Provides initial administrative and unprivileged authentication into Boundary"),
oidc.WithDescription("Provides initial administrative and unprivileged authentication into Threshold"),
oidc.WithIssuer(discoveryUrl),
oidc.WithApiUrl(b.DevOidcSetup.callbackUrl),
oidc.WithSigningAlgs(oidc.EdDSA),
+16 -16
View File
@@ -156,7 +156,7 @@ func (b *Server) CreateInitialPasswordAuthMethod(ctx context.Context) (*password
}
authMethod, err := password.NewAuthMethod(ctx, scope.Global.String(),
password.WithName("Generated global scope initial password auth method"),
password.WithDescription("Provides initial administrative and unprivileged authentication into Boundary"),
password.WithDescription("Provides initial administrative and unprivileged authentication into Threshold"),
)
if err != nil {
return nil, nil, fmt.Errorf("error creating new in memory auth method: %w", err)
@@ -355,7 +355,7 @@ func (b *Server) CreateInitialScopes(ctx context.Context, opt ...Option) (*iam.S
}
iamOpts := []iam.Option{
iam.WithName("Generated org scope"),
iam.WithDescription("Provides an initial org scope in Boundary"),
iam.WithDescription("Provides an initial org scope in Threshold"),
iam.WithRandomReader(b.SecureRandomReader),
iam.WithPublicId(b.DevOrgId),
}
@@ -381,7 +381,7 @@ func (b *Server) CreateInitialScopes(ctx context.Context, opt ...Option) (*iam.S
}
iamOpts = []iam.Option{
iam.WithName("Generated project scope"),
iam.WithDescription("Provides an initial project scope in Boundary"),
iam.WithDescription("Provides an initial project scope in Threshold"),
iam.WithRandomReader(b.SecureRandomReader),
iam.WithPublicId(b.DevProjectId),
}
@@ -430,7 +430,7 @@ func (b *Server) CreateInitialHostResources(ctx context.Context) (*static.HostCa
}
opts := []static.Option{
static.WithName("Generated host catalog"),
static.WithDescription("Provides an initial host catalog in Boundary"),
static.WithDescription("Provides an initial host catalog in Threshold"),
static.WithPublicId(b.DevHostCatalogId),
}
hc, err := static.NewHostCatalog(ctx, b.DevProjectId, opts...)
@@ -455,7 +455,7 @@ func (b *Server) CreateInitialHostResources(ctx context.Context) (*static.HostCa
}
opts = []static.Option{
static.WithName("Generated host"),
static.WithDescription("Provides an initial host in Boundary"),
static.WithDescription("Provides an initial host in Threshold"),
static.WithAddress(b.DevHostAddress),
static.WithPublicId(b.DevHostId),
}
@@ -478,7 +478,7 @@ func (b *Server) CreateInitialHostResources(ctx context.Context) (*static.HostCa
}
opts = []static.Option{
static.WithName("Generated host set"),
static.WithDescription("Provides an initial host set in Boundary"),
static.WithDescription("Provides an initial host set in Threshold"),
static.WithPublicId(b.DevHostSetId),
}
hs, err := static.NewHostSet(ctx, hc.PublicId, opts...)
@@ -515,8 +515,8 @@ func (b *Server) CreateInitialTargetWithAddress(ctx context.Context) (target.Tar
return nil, fmt.Errorf("failed to create target repository: %w", err)
}
// When this function is not called as part of boundary dev (eg: as part of
// boundary database init or tests), generate random target ids.
// When this function is not called as part of threshold dev (eg: as part of
// threshold database init or tests), generate random target ids.
if len(b.DevTargetId) == 0 {
b.DevTargetId, err = db.NewPublicId(ctx, globals.TcpTargetPrefix)
if err != nil {
@@ -531,7 +531,7 @@ func (b *Server) CreateInitialTargetWithAddress(ctx context.Context) (target.Tar
}
opts := []target.Option{
target.WithName("Generated target with a direct address"),
target.WithDescription("Provides an initial target using an address in Boundary"),
target.WithDescription("Provides an initial target using an address in Threshold"),
target.WithDefaultPort(uint32(b.DevTargetDefaultPort)),
target.WithSessionMaxSeconds(uint32(b.DevTargetSessionMaxSeconds)),
target.WithSessionConnectionLimit(int32(b.DevTargetSessionConnectionLimit)),
@@ -580,8 +580,8 @@ func (b *Server) CreateInitialTargetWithHostSources(ctx context.Context) (target
return nil, fmt.Errorf("failed to create target repository: %w", err)
}
// When this function is not called as part of boundary dev (eg: as part of
// boundary database init or tests), generate random target ids.
// When this function is not called as part of threshold dev (eg: as part of
// threshold database init or tests), generate random target ids.
if len(b.DevSecondaryTargetId) == 0 {
b.DevSecondaryTargetId, err = db.NewPublicId(ctx, globals.TcpTargetPrefix)
if err != nil {
@@ -594,7 +594,7 @@ func (b *Server) CreateInitialTargetWithHostSources(ctx context.Context) (target
opts := []target.Option{
target.WithName("Generated target using host sources"),
target.WithDescription("Provides a target using host sources in Boundary"),
target.WithDescription("Provides a target using host sources in Threshold"),
target.WithDefaultPort(uint32(b.DevTargetDefaultPort)),
target.WithSessionMaxSeconds(uint32(b.DevTargetSessionMaxSeconds)),
target.WithSessionConnectionLimit(int32(b.DevTargetSessionConnectionLimit)),
@@ -615,7 +615,7 @@ func (b *Server) CreateInitialTargetWithHostSources(ctx context.Context) (target
}
// Create targets that can be connected to using an alias. The three targets created are:
// - "postgres.boundary.dev": the Boundary dev postgres instance. Uses brokered credentials
// - "postgres.boundary.dev": the Threshold dev postgres instance. Uses brokered credentials
// - "www.hashicorp.com": a web target
// - "ssh.boundary.dev": A localhost ssh target
func (b *Server) CreateInitialTargetsWithAlias(ctx context.Context) error {
@@ -668,7 +668,7 @@ func (b *Server) CreateInitialTargetsWithAlias(ctx context.Context) error {
func (b *Server) createSshAliasTarget(ctx context.Context, targetRepo *target.Repository, aliasRepo *aliastar.Repository) error {
opts := []target.Option{
target.WithName("Generated localhost ssh target with an alias"),
target.WithDescription("Provides an initial localhost target to SSH to using an alias in Boundary"),
target.WithDescription("Provides an initial localhost target to SSH to using an alias in Threshold"),
target.WithDefaultPort(22),
target.WithSessionMaxSeconds(uint32(b.DevTargetSessionMaxSeconds)),
target.WithSessionConnectionLimit(int32(b.DevTargetSessionConnectionLimit)),
@@ -716,7 +716,7 @@ func (b *Server) createPostgresAliasTarget(ctx context.Context,
opts := []target.Option{
target.WithName("Generated local postgres target with alias"),
target.WithDescription(fmt.Sprintf("Provides a local postgres target using aliasing in Boundary. Connect using the flag `-dbname %s`", dbname)),
target.WithDescription(fmt.Sprintf("Provides a local postgres target using aliasing in Threshold. Connect using the flag `-dbname %s`", dbname)),
target.WithDefaultPort(uint32(port)),
target.WithAddress(host),
target.WithSessionMaxSeconds(uint32(b.DevTargetSessionMaxSeconds)),
@@ -779,7 +779,7 @@ func (b *Server) createWebTarget(ctx context.Context,
) error {
opts := []target.Option{
target.WithName("www.hashicorp.com"),
target.WithDescription("Provides an initial web target using an address in Boundary. Note: Only HTTPS is supported, as this target uses port 443. Alias names for web targets should match the URL for the target."),
target.WithDescription("Provides an initial web target using an address in Threshold. Note: Only HTTPS is supported, as this target uses port 443. Alias names for web targets should match the URL for the target."),
target.WithDefaultPort(443),
target.WithSessionMaxSeconds(5),
target.WithSessionConnectionLimit(int32(b.DevTargetSessionConnectionLimit)),
@@ -54,8 +54,8 @@ func startDbInDockerSupported(dialect string, opt ...Option) (cleanup func() err
switch dialect {
case "postgres", "pgx":
switch {
case api.Getenv("BOUNDARY_TESTING_PG_URL") != "":
url = api.Getenv("BOUNDARY_TESTING_PG_URL")
case api.Getenv("THRESHOLD_TESTING_PG_URL") != "":
url = api.Getenv("THRESHOLD_TESTING_PG_URL")
return func() error { return nil }, url, "", nil
case repository != "":
runOpts.Repository = repository
@@ -20,12 +20,12 @@ const (
)
// buildInfoVec is a gauge metric whose value is always equal to 1 and whose
// labels contain the current go version, git revision, and boundary version.
// labels contain the current go version, git revision, and threshold version.
var buildInfoVec = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: globals.MetricNamespace,
Name: "build_info",
Help: "Gauge with labels describing go version, git revision hash, and Boundary release version.",
Help: "Gauge with labels describing go version, git revision hash, and Threshold release version.",
},
[]string{labelGoVersion, labelGitRevision, labelBoundaryVersion},
)
+25 -4
View File
@@ -28,7 +28,11 @@ const (
DefaultTokenName = "default"
LoginCollection = "login"
PassPrefix = "HashiCorp_Boundary"
// PassPrefix is the prefix used for tokens stored in "pass"-style
// keyrings. LegacyPassPrefix is the value used by upstream HashiCorp
// Boundary; it is only read as a fallback and never written.
PassPrefix = "Threshold"
LegacyPassPrefix = "HashiCorp_Boundary"
)
// ErrNoToken is returned when no matching token could be found in the keyring
@@ -125,11 +129,15 @@ func ReadTokenFromKeyring(ui cli.Ui, keyringType, tokenName string) (*authtokens
case WincredKeyring, KeychainKeyring:
token, err = zkeyring.Get(StoredTokenName, tokenName)
if err == zkeyring.ErrNotFound {
// Fall back to the entry name used by upstream HashiCorp Boundary
token, err = zkeyring.Get(LegacyStoredTokenName, tokenName)
}
if err != nil {
if err == zkeyring.ErrNotFound {
ui.Error("No saved credential found, continuing without")
} else {
ui.Warn("Token must be provided via BOUNDARY_TOKEN env var or -token flag. Reading the token can also be disabled via -keyring-type=none.")
ui.Warn("Token must be provided via THRESHOLD_TOKEN env var or -token flag. Reading the token can also be disabled via -keyring-type=none.")
return nil, fmt.Errorf("%s: error reading auth token from keyring: %w", op, err)
}
}
@@ -143,13 +151,26 @@ func ReadTokenFromKeyring(ui cli.Ui, keyringType, tokenName string) (*authtokens
kr, err := nkeyring.Open(krConfig)
if err != nil {
ui.Warn("Token must be provided via BOUNDARY_TOKEN env var or -token flag. Reading the token can also be disabled via -keyring-type=none.")
ui.Warn("Token must be provided via THRESHOLD_TOKEN env var or -token flag. Reading the token can also be disabled via -keyring-type=none.")
return nil, fmt.Errorf("%s: failed to open keyring: %w", op, err)
}
item, err := kr.Get(tokenName)
if err != nil {
ui.Warn("Token must be provided via BOUNDARY_TOKEN env var or -token flag. Reading the token can also be disabled via -keyring-type=none.")
// Fall back to the keyring prefix used by upstream HashiCorp Boundary
legacyKr, legacyErr := nkeyring.Open(nkeyring.Config{
LibSecretCollectionName: LoginCollection,
PassPrefix: LegacyPassPrefix,
AllowedBackends: []nkeyring.BackendType{nkeyring.BackendType(keyringType)},
})
if legacyErr == nil {
if legacyItem, getErr := legacyKr.Get(tokenName); getErr == nil {
item, err = legacyItem, nil
}
}
}
if err != nil {
ui.Warn("Token must be provided via THRESHOLD_TOKEN env var or -token flag. Reading the token can also be disabled via -keyring-type=none.")
return nil, fmt.Errorf("%s: failed to get token from keyring: %w", op, err)
}
+1 -1
View File
@@ -67,7 +67,7 @@ func ParseLogFormat(format string) (LogFormat, error) {
// ParseEnvLogFormat parses the log format from an environment variable.
func ParseEnvLogFormat() LogFormat {
logFormat := api.Getenv("BOUNDARY_LOG_FORMAT")
logFormat := api.Getenv("THRESHOLD_LOG_FORMAT")
switch strings.ToLower(logFormat) {
case "json":
return JSONFormat
+1 -1
View File
@@ -192,7 +192,7 @@ func WithStatusCode(statusCode int) Option {
}
// WithDatabaseTemplate allows for using an existing database template for
// initializing the boundary database.
// initializing the threshold database.
func WithDatabaseTemplate(template string) Option {
return func(o *Options) {
o.withDatabaseTemplate = template
+5 -5
View File
@@ -285,7 +285,7 @@ func (b *Server) SetupLogging(flagLogLevel, flagLogFormat, configLogLevel, confi
// create GRPC logger
namedGRPCLogFaker := b.Logger.Named("grpclogfaker")
grpcLogFaker.SetLogOnOff(api.Getenv("BOUNDARY_GRPC_LOGGING") != "")
grpcLogFaker.SetLogOnOff(api.Getenv("THRESHOLD_GRPC_LOGGING") != "")
grpcLogFaker.SetLogger(namedGRPCLogFaker)
b.Info["log level"] = logLevel.String()
@@ -385,7 +385,7 @@ func (b *Server) PrintInfo(ui cli.Ui) {
verInfo := version.Get()
if verInfo.Version != "" {
b.InfoKeys = append(b.InfoKeys, "version")
b.Info["version"] = verInfo.FullVersionNumber(false)
b.Info["version"] = verInfo.DisplayVersionNumber(false)
}
if verInfo.Revision != "" {
b.Info["version sha"] = strings.Trim(verInfo.Revision, "'")
@@ -406,7 +406,7 @@ func (b *Server) PrintInfo(ui cli.Ui) {
}
}
sort.Strings(b.InfoKeys)
ui.Output("==> Boundary server configuration:\n")
ui.Output("==> Threshold server configuration:\n")
for _, k := range b.InfoKeys {
ui.Output(fmt.Sprintf(
"%s%s: %s",
@@ -418,7 +418,7 @@ func (b *Server) PrintInfo(ui cli.Ui) {
// Output the header that the server has started
if !b.CombineLogs {
ui.Output("==> Boundary server started! Log data will stream in below:\n")
ui.Output("==> Threshold server started! Log data will stream in below:\n")
}
}
@@ -761,7 +761,7 @@ func (b *Server) OpenDatabase(ctx context.Context, dialect, url string) (*db.DB,
db.WithMaxIdleConnections(b.DatabaseMaxIdleConnections),
db.WithConnMaxIdleTimeDuration(b.DatabaseConnMaxIdleTimeDuration),
}
if api.Getenv("BOUNDARY_DISABLE_GORM_FORMATTER") == "" {
if api.Getenv("THRESHOLD_DISABLE_GORM_FORMATTER") == "" {
opts = append(opts, db.WithGormFormatter(b.Logger))
}