Skip to content

Tokens cleanup - #2015

Open
cstamas wants to merge 12 commits into
eclipse-openvsx:trusted-publishingfrom
cstamas:tokens-cleanup
Open

Tokens cleanup#2015
cstamas wants to merge 12 commits into
eclipse-openvsx:trusted-publishingfrom
cstamas:tokens-cleanup

Conversation

@cstamas

@cstamas cstamas commented Jul 29, 2026

Copy link
Copy Markdown
Member

Just some cleanup and added token TYPE (LLT for "long lived token" and OTT for "one time token") for now. Token type of published version exposed.

Changes:

  • AccessTokenService "thinned" to minimum
  • Added new call to create "one time" token
  • PersonalAccessToken entity (and DB table) got new field type (enum; so far all token was LLT).
  • enforce expiration times, if set on use (this matters most OTT)
  • jooq code regenerated to pick up this and previous (index uniqueness) changes
  • All the jobs use directly PersonalAccessTokens component
  • OTT tokens does not have delete URL set, nor send emails, and on use are immediately deactivated
  • repository methods renamed personalAccessTokens... to make clear what it is about, methods grouped together
  • Extension JSON exposes publishedWith (token type; OTT or PAT) along with existing publishedBy.
  • NO WebUI required changes (but improvements may be done now; ExtVersion has exposed publishedWith).

@cstamas
cstamas requested review from gnugomez and netomi July 29, 2026 17:09
Comment thread server/src/main/java/org/eclipse/openvsx/entities/PersonalAccessTokenType.java Outdated
Comment thread server/src/main/java/org/eclipse/openvsx/entities/PersonalAccessTokenType.java Outdated
@cstamas
cstamas marked this pull request as ready for review July 30, 2026 08:53
ALTER TABLE ONLY public.personal_access_token
ADD COLUMN IF NOT EXISTS type CHARACTER VARYING(32);

UPDATE public.personal_access_token

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

that would set all existing tokens to type LLT

we have a lot of OTT already, what they share is that their description is always 'One time use publish token'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

when thinking about it, the OTT should also have a different prefix imho to the normal personal access tokens.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

pushed fix


@Schema(description = "The token type used to publish this version")
@NotNull
private String publishedWith;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

question: could this be considered sensitive? wouldn't it be better to expose a boolean for tokens that are coming from TP?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this is they type of the token: LLT or OTT. But yes, if the goal is to show "coming from TP" then we can make it different, but right now it is publishedWith == "OTT".

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.

3 participants