mirror of
https://github.com/cdr/code-server.git
synced 2025-12-16 13:24:51 +01:00
Add configurable authorization header to marketplace API calls (#7596)
This commit is contained in:
parent
ea9a3a5ab2
commit
0de7cf5679
2 changed files with 23 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue