mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-27 05:24:34 -07:00
feat(auth): Add option for metadata server application default credentials without project override (#12948)
This commit is contained in:
@@ -284,13 +284,19 @@ export async function main() {
|
||||
validateDnsResolutionOrder(settings.merged.advanced?.dnsResolutionOrder),
|
||||
);
|
||||
|
||||
// Set a default auth type if one isn't set.
|
||||
if (!settings.merged.security?.auth?.selectedType) {
|
||||
if (process.env['CLOUD_SHELL'] === 'true') {
|
||||
// Set a default auth type if one isn't set or is set to a legacy type
|
||||
if (
|
||||
!settings.merged.security?.auth?.selectedType ||
|
||||
settings.merged.security?.auth?.selectedType === AuthType.LEGACY_CLOUD_SHELL
|
||||
) {
|
||||
if (
|
||||
process.env['CLOUD_SHELL'] === 'true' ||
|
||||
process.env['GEMINI_CLI_USE_COMPUTE_ADC'] === 'true'
|
||||
) {
|
||||
settings.setValue(
|
||||
SettingScope.User,
|
||||
'selectedAuthType',
|
||||
AuthType.CLOUD_SHELL,
|
||||
AuthType.COMPUTE_ADC,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user