feat(acp): Add support for AI Gateway auth (#21305)

This commit is contained in:
Shreya Keshive
2026-03-05 17:15:23 -05:00
committed by GitHub
parent 19c9508fd1
commit 7ec477d40d
5 changed files with 140 additions and 7 deletions
+2
View File
@@ -512,6 +512,8 @@ describe('Server Config (config.ts)', () => {
config,
authType,
undefined,
undefined,
undefined,
);
// Verify that contentGeneratorConfig is updated
expect(config.getContentGeneratorConfig()).toEqual(mockContentConfig);
+8 -1
View File
@@ -1206,7 +1206,12 @@ export class Config implements McpContext {
return this.contentGenerator;
}
async refreshAuth(authMethod: AuthType, apiKey?: string) {
async refreshAuth(
authMethod: AuthType,
apiKey?: string,
baseUrl?: string,
customHeaders?: Record<string, string>,
) {
// Reset availability service when switching auth
this.modelAvailabilityService.reset();
@@ -1233,6 +1238,8 @@ export class Config implements McpContext {
this,
authMethod,
apiKey,
baseUrl,
customHeaders,
);
this.contentGenerator = await createContentGenerator(
newContentGeneratorConfig,