From 6ae2178fe1989d64ad1dea46479caf1ed7ce5b87 Mon Sep 17 00:00:00 2001 From: Zac Bergquist Date: Wed, 16 Mar 2022 10:24:27 -0600 Subject: [PATCH] Remove mention of max ttl for tctl tokens command (#11148) (#11164) The 48h maximum is enforced for `tctl users add`, not `tctl tokens add`. Fixes #11137 --- docs/pages/setup/reference/cli.mdx | 2 +- tool/tctl/common/token_command.go | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/pages/setup/reference/cli.mdx b/docs/pages/setup/reference/cli.mdx index 86e017f2f8367..977cea63084c4 100644 --- a/docs/pages/setup/reference/cli.mdx +++ b/docs/pages/setup/reference/cli.mdx @@ -930,7 +930,7 @@ $ tctl tokens add --type=TYPE [] | - | - | - | - | | `--type` | none | `trusted_cluster`, `node`, `proxy` | Type of token to add | | `--value` | none | **string** token value | Value of token to add | -| `--ttl` | 1h | relative duration like 5s, 2m, or 3h, **maximum 48h** | Set expiration time for token | +| `--ttl` | 1h | relative duration like 5s, 2m, or 3h | Set expiration time for token | #### [Global Flags](#tctl-global-flags) diff --git a/tool/tctl/common/token_command.go b/tool/tctl/common/token_command.go index f1c1b72dac225..3eb2e0621cec6 100644 --- a/tool/tctl/common/token_command.go +++ b/tool/tctl/common/token_command.go @@ -93,9 +93,10 @@ func (c *TokenCommand) Initialize(app *kingpin.Application, config *service.Conf c.tokenAdd.Flag("type", "Type of token to add").Required().StringVar(&c.tokenType) c.tokenAdd.Flag("value", "Value of token to add").StringVar(&c.value) c.tokenAdd.Flag("labels", "Set token labels, e.g. env=prod,region=us-west").StringVar(&c.labels) - c.tokenAdd.Flag("ttl", fmt.Sprintf("Set expiration time for token, default is %v hour, maximum is %v hours", - int(defaults.SignupTokenTTL/time.Hour), int(defaults.MaxSignupTokenTTL/time.Hour))). - Default(fmt.Sprintf("%v", defaults.SignupTokenTTL)).DurationVar(&c.ttl) + c.tokenAdd.Flag("ttl", fmt.Sprintf("Set expiration time for token, default is %v hour", + int(defaults.SignupTokenTTL/time.Hour))). + Default(fmt.Sprintf("%v", defaults.SignupTokenTTL)). + DurationVar(&c.ttl) c.tokenAdd.Flag("app-name", "Name of the application to add").Default("example-app").StringVar(&c.appName) c.tokenAdd.Flag("app-uri", "URI of the application to add").Default("http://localhost:8080").StringVar(&c.appURI) c.tokenAdd.Flag("db-name", "Name of the database to add").StringVar(&c.dbName)