@vscode/vsce
Advanced tools
Comparing version 2.25.1-3 to 2.25.1-4
@@ -165,2 +165,3 @@ /// <reference types="node" /> | ||
readonly pat?: string; | ||
readonly azureCredential?: boolean; | ||
readonly allowProposedApi?: boolean; | ||
@@ -167,0 +168,0 @@ readonly noVerify?: boolean; |
@@ -146,2 +146,3 @@ "use strict"; | ||
.option('-p, --pat <token>', 'Personal Access Token (defaults to VSCE_PAT environment variable)', process.env['VSCE_PAT']) | ||
.option('--azure-credential', 'Use Microsoft Entra ID for authentication') | ||
.option('-t, --target <targets...>', `Target architectures. Valid targets: ${ValidTargets}`) | ||
@@ -174,4 +175,5 @@ .option('--ignore-other-target-folders', `Ignore other target folders. Valid only when --target <target> is provided.`) | ||
.option('--skip-license', 'Allow publishing without license file') | ||
.action((version, { pat, target, ignoreOtherTargetFolders, readmePath, changelogPath, message, gitTagVersion, updatePackageJson, packagePath, sigzipPath, githubBranch, gitlabBranch, baseContentUrl, baseImagesUrl, yarn, noVerify, allowProposedApis, allowAllProposedApis, ignoreFile, dependencies, preRelease, allowStarActivation, allowMissingRepository, skipDuplicate, skipLicense, }) => main((0, publish_1.publish)({ | ||
.action((version, { pat, azureCredential, target, ignoreOtherTargetFolders, readmePath, changelogPath, message, gitTagVersion, updatePackageJson, packagePath, sigzipPath, githubBranch, gitlabBranch, baseContentUrl, baseImagesUrl, yarn, noVerify, allowProposedApis, allowAllProposedApis, ignoreFile, dependencies, preRelease, allowStarActivation, allowMissingRepository, skipDuplicate, skipLicense, }) => main((0, publish_1.publish)({ | ||
pat, | ||
azureCredential, | ||
version, | ||
@@ -207,4 +209,5 @@ targets: target, | ||
.option('-p, --pat <token>', 'Personal Access Token') | ||
.option('--azure-credential', 'Use Microsoft Entra ID for authentication') | ||
.option('-f, --force', 'Skip confirmation prompt when unpublishing an extension') | ||
.action((id, { pat, force }) => main((0, publish_1.unpublish)({ id, pat, force }))); | ||
.action((id, { pat, azureCredential, force }) => main((0, publish_1.unpublish)({ id, pat, azureCredential, force }))); | ||
commander_1.default | ||
@@ -228,5 +231,6 @@ .command('ls-publishers') | ||
.command('verify-pat [publisher]') | ||
.description('Verifies if the Personal Access Token has publish rights for the publisher') | ||
.description('Verifies if the Personal Access Token or Azure identity has publish rights for the publisher') | ||
.option('-p, --pat <token>', 'Personal Access Token (defaults to VSCE_PAT environment variable)', process.env['VSCE_PAT']) | ||
.action((publisherName, { pat }) => main((0, store_1.verifyPat)({ publisherName, pat }))); | ||
.option('--azure-credential', 'Use Microsoft Entra ID for authentication') | ||
.action((publisherName, { pat, azureCredential }) => main((0, store_1.verifyPat)({ publisherName, pat, azureCredential }))); | ||
commander_1.default | ||
@@ -233,0 +237,0 @@ .command('show <extensionid>') |
@@ -29,3 +29,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.unpublish = exports.publish = void 0; | ||
exports.getPAT = exports.unpublish = exports.publish = void 0; | ||
const fs = __importStar(require("fs")); | ||
@@ -103,3 +103,3 @@ const util_1 = require("util"); | ||
async function _publish(packagePath, sigzipPath, manifest, options) { | ||
const pat = options.pat ?? (await (0, store_1.getPublisher)(manifest.publisher)).pat; | ||
const pat = await getPAT(manifest.publisher, options); | ||
const api = await (0, util_2.getGalleryAPI)(pat); | ||
@@ -216,3 +216,3 @@ const packageStream = fs.createReadStream(packagePath); | ||
} | ||
const pat = options.pat ?? (await (0, store_1.getPublisher)(publisher)).pat; | ||
const pat = await getPAT(publisher, options); | ||
const api = await (0, util_2.getGalleryAPI)(pat); | ||
@@ -235,2 +235,12 @@ await api.deleteExtension(publisher, name); | ||
} | ||
async function getPAT(publisher, options) { | ||
if (options.pat) { | ||
return options.pat; | ||
} | ||
if (options.azureCredential) { | ||
return await (0, util_2.getAzureCredentialAccessToken)(); | ||
} | ||
return (await (0, store_1.getPublisher)(publisher)).pat; | ||
} | ||
exports.getPAT = getPAT; | ||
//# sourceMappingURL=publish.js.map |
@@ -33,2 +33,3 @@ "use strict"; | ||
const package_1 = require("./package"); | ||
const publish_1 = require("./publish"); | ||
class FileStore { | ||
@@ -117,3 +118,3 @@ constructor(path, publishers) { | ||
const publisherName = options.publisherName ?? (await (0, package_1.readManifest)()).publisher; | ||
const pat = options.pat ?? (await getPublisher(publisherName)).pat; | ||
const pat = await (0, publish_1.getPAT)(publisherName, options); | ||
try { | ||
@@ -120,0 +121,0 @@ // If the caller of the `getRoleAssignments` API has any of the roles |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.patchOptionsWithManifest = exports.log = exports.sequence = exports.CancellationToken = exports.isCancelledError = exports.nonnull = exports.flatten = exports.chain = exports.normalize = exports.getPublicGalleryAPI = exports.getSecurityRolesAPI = exports.getGalleryAPI = exports.getHubUrl = exports.getMarketplaceUrl = exports.getPublishedUrl = exports.read = void 0; | ||
exports.patchOptionsWithManifest = exports.log = exports.sequence = exports.CancellationToken = exports.isCancelledError = exports.nonnull = exports.flatten = exports.chain = exports.normalize = exports.getAzureCredentialAccessToken = exports.getPublicGalleryAPI = exports.getSecurityRolesAPI = exports.getGalleryAPI = exports.getHubUrl = exports.getMarketplaceUrl = exports.getPublishedUrl = exports.read = void 0; | ||
const util_1 = require("util"); | ||
@@ -15,2 +15,3 @@ const read_1 = __importDefault(require("read")); | ||
const os_1 = require("os"); | ||
const identity_1 = require("@azure/identity"); | ||
const __read = (0, util_1.promisify)(read_1.default); | ||
@@ -55,2 +56,13 @@ function read(prompt, options = {}) { | ||
exports.getPublicGalleryAPI = getPublicGalleryAPI; | ||
async function getAzureCredentialAccessToken() { | ||
try { | ||
const credential = new identity_1.DefaultAzureCredential(); | ||
const token = await credential.getToken('499b84ac-1321-427f-aa17-267ca6975798/.default'); | ||
return token.token; | ||
} | ||
catch (error) { | ||
throw new Error('Can not acquire a Microsoft Entra ID access token. Additional information:\n\n' + error); | ||
} | ||
} | ||
exports.getAzureCredentialAccessToken = getAzureCredentialAccessToken; | ||
function normalize(path) { | ||
@@ -57,0 +69,0 @@ return path.replace(/\\/g, '/'); |
{ | ||
"name": "@vscode/vsce", | ||
"version": "2.25.1-3", | ||
"version": "2.25.1-4", | ||
"description": "VS Code Extensions Manager", | ||
@@ -41,2 +41,3 @@ "repository": { | ||
"dependencies": { | ||
"@azure/identity": "^4.1.0", | ||
"azure-devops-node-api": "^12.5.0", | ||
@@ -43,0 +44,0 @@ "chalk": "^2.4.2", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
159862
3234
24
+ Added@azure/identity@^4.1.0
+ Added@azure/abort-controller@2.1.2(transitive)
+ Added@azure/core-auth@1.9.0(transitive)
+ Added@azure/core-client@1.9.2(transitive)
+ Added@azure/core-rest-pipeline@1.17.0(transitive)
+ Added@azure/core-tracing@1.2.0(transitive)
+ Added@azure/core-util@1.11.0(transitive)
+ Added@azure/identity@4.5.0(transitive)
+ Added@azure/logger@1.1.4(transitive)
+ Added@azure/msal-browser@3.27.0(transitive)
+ Added@azure/msal-common@14.16.0(transitive)
+ Added@azure/msal-node@2.16.0(transitive)
+ Addedagent-base@7.1.1(transitive)
+ Addedbuffer-equal-constant-time@1.0.1(transitive)
+ Addeddebug@4.3.7(transitive)
+ Addeddefine-lazy-prop@2.0.0(transitive)
+ Addedecdsa-sig-formatter@1.0.11(transitive)
+ Addedevents@3.3.0(transitive)
+ Addedhttp-proxy-agent@7.0.2(transitive)
+ Addedhttps-proxy-agent@7.0.5(transitive)
+ Addedis-docker@2.2.1(transitive)
+ Addedis-wsl@2.2.0(transitive)
+ Addedjsonwebtoken@9.0.2(transitive)
+ Addedjwa@1.4.12.0.0(transitive)
+ Addedjws@3.2.24.0.0(transitive)
+ Addedlodash.includes@4.3.0(transitive)
+ Addedlodash.isboolean@3.0.3(transitive)
+ Addedlodash.isinteger@4.0.4(transitive)
+ Addedlodash.isnumber@3.0.3(transitive)
+ Addedlodash.isplainobject@4.0.6(transitive)
+ Addedlodash.isstring@4.0.1(transitive)
+ Addedlodash.once@4.1.1(transitive)
+ Addedms@2.1.3(transitive)
+ Addedopen@8.4.2(transitive)
+ Addedstoppable@1.1.0(transitive)
+ Addedtslib@2.8.1(transitive)
+ Addeduuid@8.3.2(transitive)