Skip to content
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

New command: verify-pat #525

Closed
felipecrs opened this issue Jan 16, 2021 · 2 comments · Fixed by #532
Closed

New command: verify-pat #525

felipecrs opened this issue Jan 16, 2021 · 2 comments · Fixed by #532
Assignees
Labels
feature-request Request for new features or functionality
Milestone

Comments

@felipecrs
Copy link
Contributor

Or something like that. Since apparently there is no public API in the VSCode Marketplace for that purpose, it would be handy to have a command which could verify if the PAT is actually usable.

I need this for validating the token as a verification step in the semantic-release-vsce plugin.

https://github.com/raix/semantic-release-vsce/blob/59e9fa4e0ed090388d4a475e7bbbc2d5bdc10df0/lib/verify.js#L17

@joaomoreno
Copy link
Member

I like that. Wanna PR it?

We already have code which tests a PAT:

vscode-vsce/src/store.ts

Lines 59 to 64 in 3ef8985

// If the caller of the `getRoleAssignments` API has any of the roles
// (Creator, Owner, Contributor, Reader) on the publisher, we get a 200,
// otherwise we get a 403.
const api = await getSecurityRolesAPI(pat);
await api.getRoleAssignments('gallery.publisher', publisherName);

@joaomoreno joaomoreno self-assigned this Jan 18, 2021
@joaomoreno joaomoreno modified the milestone: back Jan 18, 2021
@joaomoreno joaomoreno added the feature-request Request for new features or functionality label Jan 18, 2021
@felipecrs
Copy link
Contributor Author

Amazing!

Wanna PR it?

Yes, please!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants