Skip to content

Commit

Permalink
Remove mention of max ttl for tctl tokens command (#11148) (#11164)
Browse files Browse the repository at this point in the history
The 48h maximum is enforced for `tctl users add`,
not `tctl tokens add`.

Fixes #11137
  • Loading branch information
zmb3 committed Mar 16, 2022
1 parent 0d18409 commit 6ae2178
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/pages/setup/reference/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,7 @@ $ tctl tokens add --type=TYPE [<flags>]
| - | - | - | - |
| `--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)

Expand Down
7 changes: 4 additions & 3 deletions tool/tctl/common/token_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6ae2178

Please sign in to comment.