Skip to content

[CLD-1637] support API key duration in days#271

Merged
shakeelrao merged 9 commits intomainfrom
shakeel/api-key-duration
Oct 30, 2023
Merged

[CLD-1637] support API key duration in days#271
shakeelrao merged 9 commits intomainfrom
shakeel/api-key-duration

Conversation

@shakeelrao
Copy link
Copy Markdown
Contributor

@shakeelrao shakeelrao commented Oct 26, 2023

Problem
The duration flag for API key creation uses time.ParseDuration, which only supports strings of the form 2h45m (where hour is the highest level of granularity). However, the UI for API key creation only supports days, which is a mismatch in UX.

Solution
Switch to utils.ParseDuration which extends time.ParseDuration to accept years and days.

Result
Clients can specify API key expiration in days.

Copy link
Copy Markdown
Contributor

@tminusplus tminusplus left a comment

Choose a reason for hiding this comment

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

Couple small comments otherwise 🚀

Comment thread app/apikey.go Outdated
Comment thread app/apikey.go Outdated
@shakeelrao shakeelrao merged commit a2d4cae into main Oct 30, 2023
@shakeelrao shakeelrao deleted the shakeel/api-key-duration branch October 30, 2023 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants