Skip to content

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

Merged
merged 1 commit into from
Mar 7, 2023

Conversation

Kira-Pilot
Copy link
Member

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).

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,
Copy link
Member Author

@Kira-Pilot Kira-Pilot Mar 6, 2023

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.

Copy link
Member

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)

Copy link
Member Author

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!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Kira-Pilot Kira-Pilot requested review from bpmct and mtojek March 6, 2023 20:37
Copy link
Member

@bpmct bpmct left a 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

Copy link
Member

@mtojek mtojek left a 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.

@Kira-Pilot Kira-Pilot changed the title chore: increase default max-token-duration chore: change default max-token-duration to unlimited Mar 7, 2023
@Kira-Pilot Kira-Pilot changed the title chore: change default max-token-duration to unlimited chore(cli)!: change default max-token-duration to unlimited Mar 7, 2023
@github-actions github-actions bot added the release/breaking This label is applied to PRs to detect breaking changes as part of the release process label Mar 7, 2023
@Kira-Pilot Kira-Pilot merged commit ef2e86f into main Mar 7, 2023
@Kira-Pilot Kira-Pilot deleted the increase-token-lifetime-default/kira-pilot branch March 7, 2023 14:35
@github-actions github-actions bot locked and limited conversation to collaborators Mar 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release/breaking This label is applied to PRs to detect breaking changes as part of the release process
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants