Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
fix(gcp): improve error handling for AWS credentials retrieval in GCP workload identity federation
Victor Hugo dos Santos034c11a9de1d
diff --git a/backend/src/services/app-connection/gcp/gcp-connection-fns.ts b/backend/src/services/app-connection/gcp/gcp-connection-fns.tsindex b6b81d2862..d570964f1d 100644--- a/backend/src/services/app-connection/gcp/gcp-connection-fns.ts+++ b/backend/src/services/app-connection/gcp/gcp-connection-fns.ts@@ -59,7 +59,16 @@ const buildGcpAwsExternalAccountClient = (credJson: TGcpCredentialJson, scopes:}},getAwsSecurityCredentials: async () => {- const credentials = await stsClient.config.credentials();+ let credentials;+ try {+ credentials = await stsClient.config.credentials();+ } catch (error) {+ logger.error({ err: error }, "Failed to resolve AWS credentials for GCP workload identity federation");+ throw new InternalServerError({+ message:+ "Failed to resolve AWS credentials for GCP workload identity federation. Verify the instance has valid AWS credentials available (task role, instance profile, or environment variables)."+ });+ }return {accessKeyId: credentials.accessKeyId,secretAccessKey: credentials.secretAccessKey,