Skip to content

Epic: Personal Access Tokens #14280

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

Closed
32 tasks done
easyCZ opened this issue Oct 31, 2022 · 20 comments
Closed
32 tasks done

Epic: Personal Access Tokens #14280

easyCZ opened this issue Oct 31, 2022 · 20 comments
Assignees
Labels
feature: public-api Issues relating to Public API meta: stale This issue/PR is stale and will be closed soon team: webapp Issue belongs to the WebApp team type: epic

Comments

@easyCZ
Copy link
Member

easyCZ commented Oct 31, 2022

Summary

To enable automated interaction with Gitpod, users need the ability to manage their Personal Access Tokens.

Context

Personal Access Tokens are API tokens which act on behalf of the user. They can be used to automate workflows against Gitpod.

Value

  • Integration on API level
  • Enables extensibility of Gitpod
  • Complements our efforts to introduce the Public API

Acceptance Criteria

The user is able to:

  • Create Access Token
  • Rotate an Access Token
  • List Tokens
  • Delete a Token

Measurement

  • We will measure proportion of traffic against Gitpod with API keys vs regular dashboard sessions

RFC

User stories

  1. As a user, I want to add a token with a name, an expiry date, and scopes, so that I can use it to authenticate
    Note: Properties here
  2. As a user, I want to see the token that I have just created.
  3. As a user, I want to see the tokens that I have created, when it expires, and when it was used.
    Note: without seeing the secret value
  4. As a user, I want to delete a token so that I can revoke permissions
  5. As a user, I want to regenerate a token (for any reason) and see the new token.
  6. As a user, I want to update the scopes of an existing token.
  7. As a user, I want to authenticate to Gitpod API using my existing token.

Milestone plan

  • 1 week of API implementation
  • 1 week of UI implementation
  • 1 week of validation
    Note: UI and API implementation can be started independently

Diagram

Screenshot 2022-11-11 at 12 57 28

Storage

Will be stored in a new table d_b_personal_access_token.
Reasons why we are not using the existing d_b_gitpod_token:

  • Does not fit the new usecase
  • Allows simpler migration path in the future

(additional contexts[1][2])

Schema

-- field type
primary key, idx id varchar
idx user_id varchar
idx hash varchar
  name varchar
  description text
  scopes text
  expiration_time timestamp
  created_at timestamp
idx last_modified timestamp
  deleted boolean

Issues

Rollout

Documentation

https://www.gitpod.io/docs/configure/user-settings/access-tokens

Follow-up

Follow-up epic which tracks feedback, improvements and general direction towards a stable release is in

@gtsiolis
Copy link
Contributor

gtsiolis commented Nov 8, 2022

Adding this to the product design board. 🎹

Cross-linking relevant discussion (internal):

Regarding the Gitpod Tokens: RFC (internal), we used to have a similar functionality in the dashboard before the redesign last year (see API Tokens section in relevant discussion), which was not widely used and we decided to drop during the dashboard redesign.

There’s already an issue with design specs for this section, named loosely Access Tokens, (see #3399) thought which we could use as a base for this iteration taking into account the decisions or needs described in the RFC once approved and updating the designs, copy, and structure.

@laushinka
Copy link
Contributor

we used to have a similar functionality in the dashboard before the redesign last year

There’s already an issue with design specs for this section, named loosely Access Tokens, (see #3399) thought which we could use as a base for this iteration

Thanks for the context, @gtsiolis!
Looking at the past designs briefly we could use the same base. Some WIP to keep in mind:

  • Creation will require more input than just name, but also description, scopes, expiration time. Depending on the length of scopes list, it might affect whether we use a modal on creation.
  • List of tokens shows more details e.g. when it expires, maybe when it was last used.
  • Each token can be deleted, regenerated, or (scopes) updated.

Will post updates in this epic.

@laushinka laushinka moved this to Scheduled in 🍎 WebApp Team Nov 9, 2022
@laushinka laushinka moved this from Scheduled to In Progress in 🍎 WebApp Team Nov 9, 2022
@laushinka
Copy link
Contributor

the RFC once approved

@gtsiolis RFC is accepted 👍🏼

@gtsiolis
Copy link
Contributor

gtsiolis commented Nov 9, 2022

Thanks for the heads-up, @laushinka!

Regarding the context in #14280 (comment), I haven't read the RFC in-depth yet but the list of options listed there looks long. Should we consider breaking the list of features into smaller pieces as MVC skateboards to avoid scope creep?

Cc @easyCZ

@easyCZ
Copy link
Member Author

easyCZ commented Nov 9, 2022

@laushinka is doing the breakdown currently. Once we have that, we we will of course slice it up, or choose to defer some parts of it.

As it stands, the only aspect that can be deferred is "fine grained scopes". From the user stories, it's necessary to offer the token lifecycle and the corresponding authentication pieces as without them, the feature does not actually yield the value we want.

@gtsiolis
Copy link
Contributor

gtsiolis commented Nov 9, 2022

@easyCZ Perfect, sounds good! I'll dive into more designs for this features in the next few days.

@akosyakov
Copy link
Member

@gtsiolis Is there a design available?

@gtsiolis
Copy link
Contributor

gtsiolis commented Nov 22, 2022

@akosyakov I'm currently working on this. I'm planning to upload some early designs today. Any feedback or something that designs should take into account, besides the relevant RFC (internal)?

@akosyakov
Copy link
Member

@gtsiolis nope it just we wanted to start to work on it. If we do some cross cutting slices it would be good to have some ideas about UI.

@gtsiolis
Copy link
Contributor

Posting some early designs for the personal access tokens (PATs) flow, including 1️⃣ the empty state and 2️⃣ the new token modal. I’ll add later today, 3️⃣ the new token confirmation and 4️⃣ the listing of existing tokens. Cc @laushinka @easyCZ

1️⃣ No tokens 2️⃣ New token
Empty New

See design specs.

@tdensmore
Copy link

Quick question about the "Permissions" checkbox: does this need to be checked for the PAT to work as expected? If not, what are the default permissions? I have seen these split into USER and ADMIN options for other products, but maybe that does not apply yet since we are still building out our public API set?

@gtsiolis
Copy link
Contributor

Hey @tdensmore! Cross-posting from the relevant discussion (internal) for visibility:

@easyCZ: For the Token Create - the scopes:

  • Initially we should include a checkbox which says "Grant all my permissions to this PAT". This acts as a "grant all" special token and explicitly acknowledges that is what the token will be able to do
  • This allows us to then later introduce more fine-grained scopes in subsequent iterations

@gtsiolis
Copy link
Contributor

gtsiolis commented Nov 22, 2022

Adding below more design specs for the token creation.

Creating the first token Refreshing the list Creating the second token
List List-2 List-1
More actions on a token Editing a token Deleting a token
List-3 List-4 Delete

For the token creation, an alternative approach could be to use a modal for nudging users to copy the token:

Creating the token (Alternative)
New

@jimmybrancaccio
Copy link

I wonder if it's worth using a yellow alert component for the "nudge" text. I like the alternative with the modal too - but perhaps remove the footer of the model since there's already a copy button/function in the text field.

Look great though, really nice job!

@gtsiolis
Copy link
Contributor

gtsiolis commented Nov 23, 2022

Thanks for the feedback @jimmybrancaccio!

I'd avoid relying on the alert component for everything we add as this could be overwhelming for users. We're already using a lot of alerts for other cases like local preview, usage limit, etc.

For the latest designs, we're leaning towards a non-modal approach as it would scale better with more permissions that we'd like to add over time, see relevant discussion (internal). Feedback is welcome!

@easyCZ easyCZ self-assigned this Dec 2, 2022
@easyCZ easyCZ moved this from In Progress to In Validation in 🍎 WebApp Team Dec 6, 2022
@loujaybee loujaybee self-assigned this Dec 7, 2022
@gtsiolis
Copy link
Contributor

gtsiolis commented Dec 12, 2022

Shall we close this in favor of #15100? Cc @easyCZ @jldec

@easyCZ
Copy link
Member Author

easyCZ commented Dec 12, 2022

@gtsiolis Currently this epic is in a validation phase. I'd like to keep it open until we've concluded that phase, and have run it for some time.

@gtsiolis
Copy link
Contributor

gtsiolis commented Dec 12, 2022

OK, @easyCZ! I've removed this from product design / in progress board for now, as there's no ongoing product design work for any issues related to this feature. 🤝

@atduarte
Copy link
Contributor

atduarte commented Feb 7, 2023

@easyCZ can we close this?

@loujaybee loujaybee removed their assignment Feb 20, 2023
@stale
Copy link

stale bot commented May 9, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the meta: stale This issue/PR is stale and will be closed soon label May 9, 2023
@stale stale bot closed this as completed Jun 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: public-api Issues relating to Public API meta: stale This issue/PR is stale and will be closed soon team: webapp Issue belongs to the WebApp team type: epic
Projects
Status: In Validation
Development

No branches or pull requests

8 participants