fix(acp/auth): prevent conflicting credentials on enterprise gateways and support optional API keys natively (#27021)

This commit is contained in:
Sri Pasumarthi
2026-05-14 08:38:01 -07:00
committed by GitHub
parent 488d71b8c9
commit b705505dae
3 changed files with 114 additions and 11 deletions
+10 -2
View File
@@ -69,7 +69,10 @@ export class AcpSessionManager {
);
const authType =
loadedSettings.merged.security.auth.selectedType || AuthType.USE_GEMINI;
loadedSettings.merged.security.auth.selectedType ||
(authDetails.baseUrl || process.env['GOOGLE_GEMINI_BASE_URL']
? AuthType.GATEWAY
: AuthType.USE_GEMINI);
let isAuthenticated = false;
let authErrorMessage = '';
@@ -231,7 +234,12 @@ export class AcpSessionManager {
mcpServers: acp.McpServer[],
authDetails: AuthDetails,
): Promise<Config> {
const selectedAuthType = this.settings.merged.security.auth.selectedType;
const selectedAuthType =
this.settings.merged.security.auth.selectedType ||
(authDetails.baseUrl || process.env['GOOGLE_GEMINI_BASE_URL']
? AuthType.GATEWAY
: undefined);
if (!selectedAuthType) {
throw acp.RequestError.authRequired();
}