MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / prefetchGcpCredentialsIfSafe

Function prefetchGcpCredentialsIfSafe

source code/utils/auth.ts:996–1016  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

994 * Returns void to prevent misuse - use refreshGcpCredentialsIfNeeded() to actually refresh.
995 */
996export function prefetchGcpCredentialsIfSafe(): void {
997 // Check if gcpAuthRefresh is configured
998 const gcpAuthRefresh = getConfiguredGcpAuthRefresh()
999
1000 if (!gcpAuthRefresh) {
1001 return
1002 }
1003
1004 // Check if gcpAuthRefresh is from project settings
1005 if (isGcpAuthRefreshFromProjectSettings()) {
1006 // Only prefetch if trust has already been established
1007 const hasTrust = checkHasTrustDialogAccepted()
1008 if (!hasTrust && !getIsNonInteractiveSession()) {
1009 // Don't prefetch - wait for trust to be established first
1010 return
1011 }
1012 }
1013
1014 // Safe to prefetch - either not from project settings or trust already established
1015 void refreshGcpCredentialsIfNeeded()
1016}
1017
1018/**
1019 * Prefetches AWS credentials only if workspace trust has already been established.

Callers 1

startDeferredPrefetchesFunction · 0.85

Tested by

no test coverage detected