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
Implement list order
Fang-Pen Linbf39f5eb1734
diff --git a/backend/src/ee/services/pki-acme/pki-acme-order-dal.ts b/backend/src/ee/services/pki-acme/pki-acme-order-dal.tsindex 8600079df8..ca02b09bbc 100644--- a/backend/src/ee/services/pki-acme/pki-acme-order-dal.ts+++ b/backend/src/ee/services/pki-acme/pki-acme-order-dal.ts@@ -60,9 +60,19 @@ export const pkiAcmeOrderDALFactory = (db: TDbClient) => {}};+ const listByAccountId = async (accountId: string, tx?: Knex) => {+ try {+ const orders = await (tx || db)(TableName.PkiAcmeOrder).where({ accountId }).orderBy("createdAt", "desc");+ return orders;+ } catch (error) {+ throw new DatabaseError({ error, name: "List PKI ACME orders by account id" });+ }+ };+return {...pkiAcmeOrderOrm,findByIdForFinalization,- findByAccountAndOrderIdWithAuthorizations+ findByAccountAndOrderIdWithAuthorizations,+ listByAccountId};};diff --git a/backend/src/ee/services/pki-acme/pki-acme-service.ts b/backend/src/ee/services/pki-acme/pki-acme-service.tsindex 0f537731cd..5bfbf2120c 100644--- a/backend/src/ee/services/pki-acme/pki-acme-service.ts+++ b/backend/src/ee/services/pki-acme/pki-acme-service.ts@@ -84,7 +84,12 @@ type TPkiAcmeServiceFactoryDep = {>;acmeOrderDAL: Pick<TPkiAcmeOrderDALFactory,- "create" | "transaction" | "updateById" | "findByAccountAndOrderIdWithAuthorizations" | "findByIdForFinalization"+ | "create"+ | "transaction"+ | "updateById"+ | "findByAccountAndOrderIdWithAuthorizations"+ | "findByIdForFinalization"+ | "listByAccountId">;acmeAuthDAL: Pick<TPkiAcmeAuthDALFactory, "create" | "findByAccountIdAndAuthIdWithChallenges">;acmeOrderAuthDAL: Pick<TPkiAcmeOrderAuthDALFactory, "insertMany">;@@ -727,15 +732,11 @@ export const pkiAcmeServiceFactory = ({profileId: string;accountId: string;}): Promise<TAcmeResponse<TListAcmeOrdersResponse>> => {- const profile = await validateAcmeProfile(profileId);- // FIXME: Implement ACME list orders+ const orders = await acmeOrderDAL.listByAccountId(accountId);return {status: 200,- body: {- orders: []- },+ body: { orders: orders.map((order) => buildUrl(profileId, `/orders/${order.id}`)) },headers: {- Location: buildUrl(profileId, `/accounts/${accountId}/orders`),Link: `<${buildUrl(profileId, "/directory")}>;rel="index"`}};