Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

fix: add back org auth method lockout to table view

Scott Wilsond3fe41f20e2d
diff --git a/backend/src/server/routes/v2/identity-router.ts b/backend/src/server/routes/v2/identity-router.ts
index 00df08e93b..7f1f41107f 100644
--- a/backend/src/server/routes/v2/identity-router.ts
+++ b/backend/src/server/routes/v2/identity-router.ts
@@ -53,7 +53,8 @@ const identityMembershipResponseSchema = z.object({
lastLoginTime: z.date().nullable().optional(),
roles: z.array(roleSchema),
identity: IdentitiesSchema.pick({ name: true, id: true, hasDeleteProtection: true, orgId: true }).extend({
- authMethods: z.array(z.string())
+ authMethods: z.array(z.string()),
+ activeLockoutAuthMethods: z.array(z.string())
})
});
diff --git a/backend/src/services/identity-v2/identity-service.ts b/backend/src/services/identity-v2/identity-service.ts
index 2c75b77922..74d5902e76 100644
--- a/backend/src/services/identity-v2/identity-service.ts
+++ b/backend/src/services/identity-v2/identity-service.ts
@@ -390,6 +390,17 @@ export const identityV2ServiceFactory = ({
return { identityMemberships: [], totalCount: 0 };
}
+ const enrichWithLockouts = async <T extends { identity: { id: string } }>(rows: T[]) =>
+ Promise.all(
+ rows.map(async (row) => ({
+ ...row,
+ identity: {
+ ...row.identity,
+ activeLockoutAuthMethods: await getIdentityActiveLockoutAuthMethods(row.identity.id, keyStore)
+ }
+ }))
+ );
+
if (conditionalProjectIds.size === 0) {
const { totalCount, docs } = await identityMembershipV2DAL.searchIdentitiesV2({
orgId: actorOrgId,
@@ -402,7 +413,7 @@ export const identityV2ServiceFactory = ({
accessibleProjectIds
});
- return { identityMemberships: docs, totalCount };
+ return { identityMemberships: await enrichWithLockouts(docs), totalCount };
}
// Conditional Read rules on Identity exist for at least one accessible project. SQL pagination
@@ -421,7 +432,7 @@ export const identityV2ServiceFactory = ({
const pageOffset = offset ?? 0;
const pageLimit = limit ?? filtered.length;
return {
- identityMemberships: filtered.slice(pageOffset, pageOffset + pageLimit),
+ identityMemberships: await enrichWithLockouts(filtered.slice(pageOffset, pageOffset + pageLimit)),
totalCount: filtered.length
};
};