()
| 994 | * Returns void to prevent misuse - use refreshGcpCredentialsIfNeeded() to actually refresh. |
| 995 | */ |
| 996 | export 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. |
no test coverage detected