0.2.1 • Published 3 years ago
vs-codespaces-authorization v0.2.1
GitHub Codespaces Authorization library
The npm
module that makes life easier when dealing with the GitHub Codespaces platform authorization calls. Includes:
- Typescript types for the authorization info payload.
- Javascript utilities for performing cross-domain top-level HTTP POST request to the platform.
- JSON schemas to validate the JSON authorization payloads.
Installation
npm install vs-codespaces-authorization
Using Javascript util
import { authorizePlatform } from 'vs-codespaces-authorization';
await authorizePlatform(
'https://online.visualstudio.com/platform-authentication',
{
"partnerName": "github",
"managementPortalUrl": "https://github.com/codespaces",
"codespaceToken": "<codespace JWT>",
"credentials": [],
"codespaceId": "<codespace guid>",
"vscodeSettings": {}
}
);
{
"partnerName": "github",
"managementPortalUrl": "https://github.com/codespaces",
"codespaceToken": "<codespaces JWT>",
"credentials": [{
"expiration": 10000000000000,
"token": "<github token>",
"host": "github.com",
"path": "/"
}],
"codespaceId": "<codespace guid>",
"gitHubApiUrl": "https://api.github.com",
"featureFlags": {
"example-pfs-name": "not real feature flag",
"example-enable-pfs": true,
"example-multithreading": 5
},
"vscodeSettings": {
"vscodeChannel": "insider",
"loadingScreenThemeColor": "dark",
"defaultSettings": {
"workbench.colorTheme": "GitHub Light",
"workbench.startupEditor": "welcomePageInEmptyWorkbench"
},
"defaultExtensions": [{
"id": "GitHub.vscode-pull-request-github"
}, {
"id": "ms-vsliveshare.vsliveshare"
}],
"defaultAuthSessions": [{
"type": "github",
"id": "github-session-github-pr",
"accessToken": "<github token>",
"scopes": ["read:user", "user:email", "repo"]
}]
}
}
Using Schemas
Online playground: https://www.jsonschemavalidator.net/s/kGYLyowr
The lastest JSON schema defined in src/schemas/
and published at https://aka.ms/vscs-platform-json-schema.
(The extended schema https://aka.ms/vscs-platform-json-schema-extended can be used internally).
License
See LICENSE.md
0.2.1
3 years ago
0.1.28
4 years ago
0.1.26
4 years ago
0.1.27
4 years ago
0.1.24
4 years ago
0.1.25
4 years ago
0.1.23
4 years ago
0.1.22
4 years ago
0.1.21
5 years ago
0.1.19
5 years ago
0.1.18
5 years ago
0.1.17
5 years ago
0.1.16
5 years ago
0.1.15
5 years ago
0.1.14
5 years ago
0.1.11
5 years ago
0.1.12
5 years ago
0.1.10
5 years ago
0.1.9
5 years ago
0.1.8
5 years ago
0.1.7
5 years ago
0.1.5
5 years ago
0.1.4
5 years ago