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