Add configurable authorization header to marketplace API calls (#7596)

This commit is contained in:
Vladimir Mladenovic 2025-12-12 02:02:42 +01:00 committed by GitHub
parent ea9a3a5ab2
commit 0de7cf5679
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 23 additions and 0 deletions

View file

@ -90,3 +90,18 @@ Index: code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/ext
}
}
Index: code-server/lib/vscode/src/vs/platform/externalServices/common/marketplace.ts
===================================================================
--- code-server.orig/lib/vscode/src/vs/platform/externalServices/common/marketplace.ts
+++ code-server/lib/vscode/src/vs/platform/externalServices/common/marketplace.ts
@@ -26,6 +26,10 @@ export async function resolveMarketplace
'User-Agent': `VSCode ${version} (${productService.nameShort})`
};
+ if (productService.extensionsGallery?.authorizationHeaderToken) {
+ headers['Authorization'] = `Bearer ${productService.extensionsGallery.authorizationHeaderToken}`;
+ }
+
if (supportsTelemetry(productService, environmentService) && getTelemetryLevel(configurationService) === TelemetryLevel.USAGE) {
const serviceMachineId = await getServiceMachineId(environmentService, fileService, storageService);
headers['X-Market-User-Id'] = serviceMachineId;

View file

@ -101,6 +101,14 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts
readonly version: string;
readonly date?: string;
@@ -112,6 +113,7 @@ export interface IProductConfiguration {
readonly resourceUrlTemplate: string;
readonly nlsBaseUrl: string;
readonly accessSKUs?: string[];
+ readonly authorizationHeaderToken?: string;
};
readonly mcpGallery?: {
Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
===================================================================
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts