Decrease number of flags shown for daemon/search (#4312)
* Decrease number of flags shown for daemon/search * Update changelog --------- Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com> Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
This commit is contained in:
7 files changed
+99
-11
No files matched your search
@@ -55,6 +55,16 @@ Canonical reference for changes, improvements, and bugfixes for Boundary.
|
||||
relative to the last result received.
|
||||
* config: add new controller max_page_size field for controlling the default and max size
|
||||
of pages when paginating through results.
|
||||
* New command `search` has been added allowing quick searching of targets or
|
||||
sessions. It utilizes a client side cache also added in this release. The
|
||||
client side cache starts itself automatically in the background when successfully
|
||||
executing any command that communicates with a Boundary controller. To disable
|
||||
the client cache from starting automatically set the
|
||||
`BOUNDARY_SKIP_CACHE_DAEMON` environment variable or pass the
|
||||
`-skip-cache-daemon` flag when running a command that may start it.
|
||||
Commands `daemon start`, `daemon stop`, `daemon status`, and `daemon add-token`
|
||||
were added to help manage the cache. The cache does not currently work with
|
||||
Boundary instances that require the use of client side certs.
|
||||
|
||||
## 0.14.3 (2023/12/12)
|
||||
|
||||
|
||||
@@ -46,7 +46,46 @@ Usage: boundary daemon add-token [options]
|
||||
}
|
||||
|
||||
func (c *AddTokenCommand) Flags() *base.FlagSets {
|
||||
set := c.FlagSet(base.FlagSetClient | base.FlagSetOutputFormat)
|
||||
set := c.FlagSet(base.FlagSetOutputFormat)
|
||||
f := set.NewFlagSet("Connection Options")
|
||||
|
||||
f.StringVar(&base.StringVar{
|
||||
Name: base.FlagNameAddr,
|
||||
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).",
|
||||
})
|
||||
|
||||
f = set.NewFlagSet("Client Options")
|
||||
|
||||
f.StringVar(&base.StringVar{
|
||||
Name: "token-name",
|
||||
Target: &c.FlagTokenName,
|
||||
EnvVar: base.EnvTokenName,
|
||||
Usage: `If specified, the given value will be used as the name when storing the token in the system credential store. This can allow switching user identities for different commands.`,
|
||||
})
|
||||
|
||||
f.StringVar(&base.StringVar{
|
||||
Name: "keyring-type",
|
||||
Target: &c.FlagKeyringType,
|
||||
Default: "auto",
|
||||
EnvVar: base.EnvKeyringType,
|
||||
Usage: `The type of keyring to use. Defaults to "auto" which will use the Windows credential manager, OSX keychain, or cross-platform password store depending on platform. Set to "none" to disable keyring functionality. Available types, depending on platform, are: "wincred", "keychain", "pass", and "secret-service".`,
|
||||
})
|
||||
|
||||
f.StringVar(&base.StringVar{
|
||||
Name: "token",
|
||||
Target: &c.FlagToken,
|
||||
Usage: `A URL pointing to a file on disk (file://) from which a token will be read or an env var (env://) from which the token will be read. Overrides the "token-name" parameter.`,
|
||||
})
|
||||
|
||||
f.BoolVar(&base.BoolVar{
|
||||
Name: "output-curl-string",
|
||||
Target: &c.FlagOutputCurlString,
|
||||
Usage: "Instead of executing the request, print an equivalent cURL command string and exit.",
|
||||
})
|
||||
|
||||
return set
|
||||
}
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ Usage: boundary daemon start [options]
|
||||
}
|
||||
|
||||
func (c *StartCommand) Flags() *base.FlagSets {
|
||||
set := c.FlagSet(base.FlagSetHTTP | base.FlagSetClient)
|
||||
set := c.FlagSet(base.FlagSetNone)
|
||||
|
||||
f := set.NewFlagSet("Command Options")
|
||||
f.StringVar(&base.StringVar{
|
||||
@@ -82,6 +82,7 @@ func (c *StartCommand) Flags() *base.FlagSets {
|
||||
Completion: complete.PredictSet("trace", "debug", "info", "warn", "err"),
|
||||
Usage: "Log verbosity level, mostly as a fallback for events. Supported values (in order of more detail to less) are " +
|
||||
"\"trace\", \"debug\", \"info\", \"warn\", and \"err\".",
|
||||
Hidden: true,
|
||||
})
|
||||
f.StringVar(&base.StringVar{
|
||||
Name: "log-format",
|
||||
@@ -93,6 +94,7 @@ func (c *StartCommand) Flags() *base.FlagSets {
|
||||
Name: "database-url",
|
||||
Target: &c.flagDatabaseUrl,
|
||||
Usage: `If set, specifies the URL used to connect to the sqlite database (store) for caching. This can refer to a file on disk (file://) from which a URL will be read; an env var (env://) from which the URL will be read; or a direct database URL.`,
|
||||
Hidden: true,
|
||||
})
|
||||
f.DurationVar(&base.DurationVar{
|
||||
Name: "refresh-interval",
|
||||
|
||||
@@ -52,7 +52,15 @@ Usage: boundary daemon status [options]
|
||||
}
|
||||
|
||||
func (c *StatusCommand) Flags() *base.FlagSets {
|
||||
set := c.FlagSet(base.FlagSetClient | base.FlagSetOutputFormat)
|
||||
set := c.FlagSet(base.FlagSetOutputFormat)
|
||||
f := set.NewFlagSet("Client Options")
|
||||
|
||||
f.BoolVar(&base.BoolVar{
|
||||
Name: "output-curl-string",
|
||||
Target: &c.FlagOutputCurlString,
|
||||
Usage: "Instead of executing the request, print an equivalent cURL command string and exit.",
|
||||
})
|
||||
|
||||
return set
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ Usage: boundary daemon stop
|
||||
}
|
||||
|
||||
func (c *StopCommand) Flags() *base.FlagSets {
|
||||
set := c.FlagSet(base.FlagSetHTTP | base.FlagSetClient)
|
||||
set := c.FlagSet(base.FlagSetNone)
|
||||
return set
|
||||
}
|
||||
|
||||
|
||||
@@ -62,13 +62,42 @@ Usage: boundary search [options]
|
||||
}
|
||||
|
||||
func (c *SearchCommand) Flags() *base.FlagSets {
|
||||
set := c.FlagSet(base.FlagSetClient | base.FlagSetOutputFormat)
|
||||
set := c.FlagSet(base.FlagSetOutputFormat)
|
||||
|
||||
f := set.NewFlagSet("Command Options")
|
||||
f := set.NewFlagSet("Client Options")
|
||||
|
||||
f.StringVar(&base.StringVar{
|
||||
Name: "token-name",
|
||||
Target: &c.FlagTokenName,
|
||||
EnvVar: base.EnvTokenName,
|
||||
Usage: `If specified, the given value will be used as the name when storing the token in the system credential store. This can allow switching user identities for different commands.`,
|
||||
})
|
||||
|
||||
f.StringVar(&base.StringVar{
|
||||
Name: "keyring-type",
|
||||
Target: &c.FlagKeyringType,
|
||||
Default: "auto",
|
||||
EnvVar: base.EnvKeyringType,
|
||||
Usage: `The type of keyring to use. Defaults to "auto" which will use the Windows credential manager, OSX keychain, or cross-platform password store depending on platform. Set to "none" to disable keyring functionality. Available types, depending on platform, are: "wincred", "keychain", "pass", and "secret-service".`,
|
||||
})
|
||||
|
||||
f.StringVar(&base.StringVar{
|
||||
Name: "token",
|
||||
Target: &c.FlagToken,
|
||||
Usage: `A URL pointing to a file on disk (file://) from which a token will be read or an env var (env://) from which the token will be read. Overrides the "token-name" parameter.`,
|
||||
})
|
||||
|
||||
f.BoolVar(&base.BoolVar{
|
||||
Name: "output-curl-string",
|
||||
Target: &c.FlagOutputCurlString,
|
||||
Usage: "Instead of executing the request, print an equivalent cURL command string and exit.",
|
||||
})
|
||||
|
||||
f = set.NewFlagSet("Command Options")
|
||||
f.StringVar(&base.StringVar{
|
||||
Name: "query",
|
||||
Target: &c.flagQuery,
|
||||
Usage: `If set, specifies the resource search query`,
|
||||
Usage: `If set, specifies the resource search query. See https://www.boundaryproject.io/docs/commands/search for more information.`,
|
||||
})
|
||||
f.StringVar(&base.StringVar{
|
||||
Name: "filter",
|
||||
|
||||
@@ -90,7 +90,7 @@ type Command struct {
|
||||
flags *FlagSets
|
||||
flagsOnce sync.Once
|
||||
|
||||
flagAddr string
|
||||
FlagAddr string
|
||||
flagVerbose bool
|
||||
|
||||
flagTLSCACert string
|
||||
@@ -220,8 +220,8 @@ func (c *Command) Client(opt ...Option) (*api.Client, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if c.flagAddr != "" {
|
||||
if err := c.client.SetAddr(c.flagAddr); err != nil {
|
||||
if c.FlagAddr != "" {
|
||||
if err := c.client.SetAddr(c.FlagAddr); err != nil {
|
||||
return nil, fmt.Errorf("error setting address on client: %w", err)
|
||||
}
|
||||
}
|
||||
@@ -364,7 +364,7 @@ func (c *Command) FlagSet(bit FlagSetBit) *FlagSets {
|
||||
|
||||
f.StringVar(&StringVar{
|
||||
Name: FlagNameAddr,
|
||||
Target: &c.flagAddr,
|
||||
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).",
|
||||
|
||||
Reference in new issue
Block a user