[public-api] Generate & Parse Personal Access Tokens #14806
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Introduces generation & validation of Personal Access Tokens (PAT).
A PAT is used as a stand-in for a user, inheriting their identity.
A PAT looks like
gitpod_pat_ko8KC1tJ-GkqIwqNliwF4tBUk2Jd5nEe9qOWqYfobtY.6ZDQVanpaTKj9hQuji0thCe8KFCcmEDGpsaTkSSb
(this is a random token, not having access to anything).It is composed out of the following:
gitpod_pat_
ko8KC1tJ-GkqIwqNliwF4tBUk2Jd5nEe9qOWqYfobtY
6ZDQVanpaTKj9hQuji0thCe8KFCcmEDGpsaTkSSb
A PAT has the following cryptographic properties:
The signature generation requires a secret key.
When validating a token, we do the following:
The reason for including a signature is to fail-early when tokens which are not issued by gitpod are received on the API. This acts as a defence for Auth DDoS and amplification attacks.
Related Issue(s)
How to test
Unit tests
Release Notes
Documentation
Werft options:
If enabled this will build
install/preview
Valid options are
all
,workspace
,webapp
,ide
,jetbrains
,vscode
,ssh