()
| 1066 | * Returns void to prevent misuse - use refreshGcpCredentialsIfNeeded() to actually refresh. |
| 1067 | */ |
| 1068 | export function prefetchGcpCredentialsIfSafe(): void { |
| 1069 | // Check if gcpAuthRefresh is configured |
| 1070 | const gcpAuthRefresh = getConfiguredGcpAuthRefresh() |
| 1071 | |
| 1072 | if (!gcpAuthRefresh) { |
| 1073 | return |
| 1074 | } |
| 1075 | |
| 1076 | // Check if gcpAuthRefresh is from project settings |
| 1077 | if (isGcpAuthRefreshFromProjectSettings()) { |
| 1078 | // Only prefetch if trust has already been established |
| 1079 | const hasTrust = checkHasTrustDialogAccepted() |
| 1080 | if (!hasTrust && !getIsNonInteractiveSession()) { |
| 1081 | // Don't prefetch - wait for trust to be established first |
| 1082 | return |
| 1083 | } |
| 1084 | } |
| 1085 | |
| 1086 | // Safe to prefetch - either not from project settings or trust already established |
| 1087 | void refreshGcpCredentialsIfNeeded() |
| 1088 | } |
| 1089 | |
| 1090 | /** |
| 1091 | * Prefetches AWS credentials only if workspace trust has already been established. |
no test coverage detected