-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[public-api] Add Delete, Regenerate, and Update PAT UI #14936
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
started the job as gitpod-build-ide-public-api.1 because the annotations in the pull request description changed |
8d4960f
to
ea1295e
Compare
ea1295e
to
87e1dd8
Compare
87e1dd8
to
3343f45
Compare
The API implementation of the Update is here When we're editing a token, I believe we should not be able to update the Expiration. The expiration is tied to the token value and the only way to extend the expiration should be generate a new one. What do you think? |
Make sense, will change it to update name and scope (not) only gitpod/components/public-api-server/pkg/apiv1/tokens.go Lines 247 to 261 in 5642845
|
3343f45
to
3f8b2ab
Compare
Co-authored-by: Huiwen <mhqnwt@gmail.com>
3f8b2ab
to
3225597
Compare
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
We can do follow-up in subsequent PRs also.
<select | ||
name="expiration" | ||
value={value.expirationDays} | ||
onChange={(e) => { | ||
update({ expirationDays: Number(e.target.value) }); | ||
}} | ||
> | ||
<option value="30">30 Days</option> | ||
<option value="90">90 Days</option> | ||
<option value="180">180 Days</option> | ||
</select> | ||
<p className="text-gray-500 dark:text-gray-400 mt-2"> | ||
The token will expire on{" "} | ||
{Intl.DateTimeFormat("en-US", { dateStyle: "long" }).format(value.expirationDate)}. | ||
</p> |
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.
We've got the select duplicated in 2 views, any way to consolidate?
name: value.name, | ||
scopes: ["function:*", "resource:default"], | ||
}, | ||
updateMask: { paths: ["name", "scopes"] }, |
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.
Does this need to determine what's changed, to properly apply the update mask? Or do we just update all? There is a potential risk to two simultaneous requests performing an update but given these are Personal Tokens, we can probably keep it this way.
Description
Add
delete
,regenerate
andedit
UI(edit not implemented yet)Related Issue(s)
Fixes #14618
Fixes #14616
Relates #14612
How to test
Release Notes
Documentation
Werft options:
If enabled this will build
install/preview
Valid options are
all
,workspace
,webapp
,ide
,jetbrains
,vscode
,ssh
Screenshot