Skip to content

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

accomodating backend changes

x03220563422e973695
diff --git a/backend/src/ee/routes/v1/pam-routers/pam-account-router.ts b/backend/src/ee/routes/v1/pam-routers/pam-account-router.ts
index a8e27db414..e595487d94 100644
--- a/backend/src/ee/routes/v1/pam-routers/pam-account-router.ts
+++ b/backend/src/ee/routes/v1/pam-routers/pam-account-router.ts
@@ -305,7 +305,10 @@ export const registerPamAccountRouter = async (server: FastifyZodProvider) => {
tags: [ApiDocsTags.PamAccounts],
querystring: z.object({
offset: z.coerce.number().min(0).default(0).optional().describe("Number of items to skip"),
- limit: z.coerce.number().min(1).max(100).default(20).optional().describe("Maximum number of items to return")
+ limit: z.coerce.number().min(1).max(100).default(20).optional().describe("Maximum number of items to return"),
+ search: z.string().trim().optional().describe("Filter accounts by name (case-insensitive partial match)"),
+ folderId: z.string().uuid().optional().describe("Filter accounts by folder ID"),
+ accountType: z.nativeEnum(PamAccountType).optional().describe("Filter accounts by platform type")
}),
response: {
200: z.object({
@@ -337,7 +340,10 @@ export const registerPamAccountRouter = async (server: FastifyZodProvider) => {
actorOrgId: req.permission.orgId,
actorAuthMethod: req.permission.authMethod,
offset: req.query.offset,
- limit: req.query.limit
+ limit: req.query.limit,
+ search: req.query.search,
+ folderId: req.query.folderId,
+ accountType: req.query.accountType
});
return { accounts, totalCount };
}
diff --git a/backend/src/ee/services/gateway-v2/gateway-v2-service.ts b/backend/src/ee/services/gateway-v2/gateway-v2-service.ts
index 45c23622a9..02a91dee68 100644
--- a/backend/src/ee/services/gateway-v2/gateway-v2-service.ts
+++ b/backend/src/ee/services/gateway-v2/gateway-v2-service.ts
@@ -582,7 +582,7 @@ export const gatewayV2ServiceFactory = ({
Buffer.from(
JSON.stringify({
sessionId,
- accountType
+ resourceType: accountType // "resourceType" name needed to support current CLI version
})
)
);
diff --git a/backend/src/ee/services/pam-account/pam-account-dal.ts b/backend/src/ee/services/pam-account/pam-account-dal.ts
index 9d9224f897..7a5dba87b6 100644
--- a/backend/src/ee/services/pam-account/pam-account-dal.ts
+++ b/backend/src/ee/services/pam-account/pam-account-dal.ts
@@ -41,7 +41,14 @@ export const pamAccountDALFactory = (db: TDbClient) => {
projectId: string,
accessibleFolderIds: string[],
accessibleAccountIds: string[],
- filters?: { folderId?: string; templateId?: string; search?: string; offset?: number; limit?: number },
+ filters?: {
+ folderId?: string;
+ templateId?: string;
+ accountType?: string;
+ search?: string;
+ offset?: number;
+ limit?: number;
+ },
tx?: Knex
) => {
const baseQuery = (tx || db.replicaNode())(TableName.PamAccount)
@@ -63,6 +70,9 @@ export const pamAccountDALFactory = (db: TDbClient) => {
if (filters?.templateId) {
void baseQuery.where(`${TableName.PamAccount}.templateId`, filters.templateId);
}
+ if (filters?.accountType) {
+ void baseQuery.where(`${TableName.PamAccountTemplate}.type`, filters.accountType);
+ }
if (filters?.search) {
void baseQuery.whereILike(`${TableName.PamAccount}.name`, `%${sanitizeSqlLikeString(filters.search)}%`);
}
diff --git a/backend/src/ee/services/pam-account/pam-account-service.ts b/backend/src/ee/services/pam-account/pam-account-service.ts
index 682620d9e8..4ba346cf32 100644
--- a/backend/src/ee/services/pam-account/pam-account-service.ts
+++ b/backend/src/ee/services/pam-account/pam-account-service.ts
@@ -384,6 +384,9 @@ export const pamAccountServiceFactory = (deps: TPamAccountServiceFactoryDep) =>
projectId,
offset,
limit,
+ search,
+ folderId,
+ accountType,
...ctx
}: TListAccessibleAccountsDTO & TActorContext & { offset?: number; limit?: number }) => {
await verifyMembership(projectId, ctx);
@@ -405,7 +408,10 @@ export const pamAccountServiceFactory = (deps: TPamAccountServiceFactoryDep) =>
const { accounts, totalCount } = await pamAccountDAL.findAccessible(projectId, folderIds, accountIds, {
offset,
- limit
+ limit,
+ search,
+ folderId,
+ accountType
});
return {
diff --git a/backend/src/ee/services/pam-account/pam-account-types.ts b/backend/src/ee/services/pam-account/pam-account-types.ts
index 3518f15b86..051def6577 100644
--- a/backend/src/ee/services/pam-account/pam-account-types.ts
+++ b/backend/src/ee/services/pam-account/pam-account-types.ts
@@ -48,4 +48,7 @@ export type TListPamAccountsDTO = {
export type TListAccessibleAccountsDTO = {
projectId: string;
+ search?: string;
+ folderId?: string;
+ accountType?: string;
};