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