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: address unhandled promise rejects causing 502s
Sheen Capadngan9711e73a062e
diff --git a/backend/src/services/integration-auth/integration-auth-service.ts b/backend/src/services/integration-auth/integration-auth-service.tsindex 1d9fedde78..77f7d96b56 100644--- a/backend/src/services/integration-auth/integration-auth-service.ts+++ b/backend/src/services/integration-auth/integration-auth-service.ts@@ -114,20 +114,27 @@ export const integrationAuthServiceFactory = ({const listOrgIntegrationAuth = async ({ actorId, actor, actorOrgId, actorAuthMethod }: TGenericPermission) => {const authorizations = await integrationAuthDAL.getByOrg(actorOrgId as string);- return Promise.all(- authorizations.filter(async (auth) => {- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId: auth.projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.SecretManager- });+ const filteredAuthorizations = await Promise.all(+ authorizations.map(async (auth) => {+ try {+ const { permission } = await permissionService.getProjectPermission({+ actor,+ actorId,+ projectId: auth.projectId,+ actorAuthMethod,+ actorOrgId,+ actionProjectType: ActionProjectType.SecretManager+ });- return permission.can(ProjectPermissionActions.Read, ProjectPermissionSub.Integrations);+ return permission.can(ProjectPermissionActions.Read, ProjectPermissionSub.Integrations) ? auth : null;+ } catch (error) {+ // user does not belong to the project that the integration auth belongs to+ return null;+ }}));++ return filteredAuthorizations.filter((auth) => auth !== null);};const getIntegrationAuth = async ({ actor, id, actorId, actorAuthMethod, actorOrgId }: TGetIntegrationAuthDTO) => {