MCPcopy Create free account
hub / github.com/oboard/claude-code-rev / prefetchGcpCredentialsIfSafe

Function prefetchGcpCredentialsIfSafe

src/utils/auth.ts:1044–1064  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1042 * Returns void to prevent misuse - use refreshGcpCredentialsIfNeeded() to actually refresh.
1043 */
1044export function prefetchGcpCredentialsIfSafe(): void {
1045 // Check if gcpAuthRefresh is configured
1046 const gcpAuthRefresh = getConfiguredGcpAuthRefresh()
1047
1048 if (!gcpAuthRefresh) {
1049 return
1050 }
1051
1052 // Check if gcpAuthRefresh is from project settings
1053 if (isGcpAuthRefreshFromProjectSettings()) {
1054 // Only prefetch if trust has already been established
1055 const hasTrust = checkHasTrustDialogAccepted()
1056 if (!hasTrust && !getIsNonInteractiveSession()) {
1057 // Don't prefetch - wait for trust to be established first
1058 return
1059 }
1060 }
1061
1062 // Safe to prefetch - either not from project settings or trust already established
1063 void refreshGcpCredentialsIfNeeded()
1064}
1065
1066/**
1067 * Prefetches AWS credentials only if workspace trust has already been established.

Callers 1

startDeferredPrefetchesFunction · 0.85

Tested by

no test coverage detected