mirror of
https://github.com/tailscale/tailscale.git
synced 2026-05-05 20:26:47 +02:00
cmd/get-authkey: add expiry argument
Allow the lifetime to be adjusted from the default 90 days. Updates https://github.com/tailscale/tailscale/issues/3243 Signed-off-by: Denton Gentry <dgentry@tailscale.com>
This commit is contained in:
parent
9f05018419
commit
80e67a8c4d
@ -28,6 +28,7 @@ func main() {
|
||||
ephemeral := flag.Bool("ephemeral", false, "allocate an ephemeral authkey")
|
||||
preauth := flag.Bool("preauth", true, "set the authkey as pre-authorized")
|
||||
tags := flag.String("tags", "", "comma-separated list of tags to apply to the authkey")
|
||||
expiry := flag.Duration("expiry", 0, "amount of time until authkey expires, for example 24h.")
|
||||
flag.Parse()
|
||||
|
||||
clientID := os.Getenv("TS_API_CLIENT_ID")
|
||||
@ -65,7 +66,7 @@ func main() {
|
||||
},
|
||||
}
|
||||
|
||||
authkey, _, err := tsClient.CreateKey(ctx, caps)
|
||||
authkey, _, err := tsClient.CreateKeyWithExpiry(ctx, caps, *expiry)
|
||||
if err != nil {
|
||||
log.Fatal(err.Error())
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user