-
Notifications
You must be signed in to change notification settings - Fork 881
chore(cli)!: change default max-token-duration to unlimited #6467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Usage: "The maximum lifetime duration users can specify when creating an API token.", | ||
Flag: "max-token-lifetime", | ||
// max time.Duration is 290 years | ||
Default: 290 * 365 * 24 * time.Hour, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the docs, the max time.Duration one can set is 290 years. If there's a cleaner way to represent this max, let me know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A cleaner way to do this is time.Duration(math.MaxInt64)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I'll follow up in my next PR!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for fun: https://go.dev/play/p/YtHsPbOIR-N
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this, Kira. This is technically a breaking change, so can you label it as such?
Thinking we can change the title to: chore: change default max-token-duration to unlimited
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but please address the "breaking change" concern.
Product has requested that token lifetimes follow the below rules:
Make default of
--max-token-lifetime
unlimited.Make default lifetime of
coder tokens create
30 days, but then another lifetime can be set with--lifetime
up to the max (set by server).