Skip to content

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

Merge remote-tracking branch 'origin/main' into feat/kmip-client-management

Sheen Capadngan8e2cce865afd
diff --cc backend/src/services/kms/kms-key-dal.ts
index 3b21d1e3ed,69a1754710..c5c8a5ec55
--- a/backend/src/services/kms/kms-key-dal.ts
+++ b/backend/src/services/kms/kms-key-dal.ts
@@@ -73,35 -93,7 +93,35 @@@ export const kmskeyDALFactory = (db: TD
}
};
+ const findProjectCmeks = async (projectId: string, tx?: Knex) => {
+ try {
+ const result = await (tx || db.replicaNode())(TableName.KmsKey)
+ .where({
+ [`${TableName.KmsKey}.projectId` as "projectId"]: projectId,
+ [`${TableName.KmsKey}.isReserved` as "isReserved"]: false
+ })
+ .join(TableName.Organization, `${TableName.KmsKey}.orgId`, `${TableName.Organization}.id`)
+ .join(TableName.InternalKms, `${TableName.KmsKey}.id`, `${TableName.InternalKms}.kmsKeyId`)
+ .select(selectAllTableCols(TableName.KmsKey))
+ .select(
+ db.ref("encryptedKey").withSchema(TableName.InternalKms).as("internalKmsEncryptedKey"),
+ db.ref("encryptionAlgorithm").withSchema(TableName.InternalKms).as("internalKmsEncryptionAlgorithm"),
+ db.ref("version").withSchema(TableName.InternalKms).as("internalKmsVersion")
+ );
+
+ return result.map((entry) => ({
+ ...KmsKeysSchema.parse(entry),
+ isActive: !entry.isDisabled,
+ encryptedKey: entry.internalKmsEncryptedKey,
+ algorithm: entry.internalKmsEncryptionAlgorithm,
+ version: entry.internalKmsVersion
+ }));
+ } catch (error) {
+ throw new DatabaseError({ error, name: "Find project cmeks" });
+ }
+ };
+
- const findKmsKeysByProjectId = async (
+ const listCmeksByProjectId = async (
{
projectId,
offset = 0,
@@@ -146,5 -139,33 +167,33 @@@
}
};
- return { ...kmsOrm, findByIdWithAssociatedKms, findKmsKeysByProjectId, findProjectCmeks };
+ const findCmekById = async (id: string, tx?: Knex) => {
+ try {
+ const key = await baseCmekQuery({
+ filter: { id },
+ db,
+ tx
+ }).first();
+
+ return key;
+ } catch (error) {
+ throw new DatabaseError({ error, name: "Find by ID - KMS Key" });
+ }
+ };
+
+ const findCmekByName = async (keyName: string, projectId: string, tx?: Knex) => {
+ try {
+ const key = await baseCmekQuery({
+ filter: { name: keyName, projectId },
+ db,
+ tx
+ }).first();
+
+ return key;
+ } catch (error) {
+ throw new DatabaseError({ error, name: "Find by Name - KMS Key" });
+ }
+ };
+
- return { ...kmsOrm, findByIdWithAssociatedKms, listCmeksByProjectId, findCmekById, findCmekByName };
++ return { ...kmsOrm, findByIdWithAssociatedKms, listCmeksByProjectId, findCmekById, findCmekByName, findProjectCmeks };
};
diff --cc frontend/src/pages/organization/SettingsPage/components/OrgTabGroup/OrgTabGroup.tsx
index 303d959de1,bfc2ee7450..31f8efb0c1
--- a/frontend/src/pages/organization/SettingsPage/components/OrgTabGroup/OrgTabGroup.tsx
+++ b/frontend/src/pages/organization/SettingsPage/components/OrgTabGroup/OrgTabGroup.tsx
@@@ -4,10 -4,8 +4,9 @@@ import { useSearch } from "@tanstack/re
import { Tab, TabList, TabPanel, Tabs } from "@app/components/v2";
import { ROUTE_PATHS } from "@app/const/routes";
- import { AppConnectionsTab } from "../AppConnectionsTab";
import { AuditLogStreamsTab } from "../AuditLogStreamTab";
import { ImportTab } from "../ImportTab";
+import { KmipTab } from "../KmipTab/OrgKmipTab";
import { OrgAuthTab } from "../OrgAuthTab";
import { OrgEncryptionTab } from "../OrgEncryptionTab";
import { OrgGeneralTab } from "../OrgGeneralTab";
@@@ -27,11 -25,9 +26,10 @@@ export const OrgTabGroup = () =>
key: "workflow-integrations",
component: OrgWorkflowIntegrationTab
},
- { name: "App Connections", key: "app-connections", component: AppConnectionsTab },
{ name: "Audit Log Streams", key: "tag-audit-log-streams", component: AuditLogStreamsTab },
{ name: "Import", key: "tab-import", component: ImportTab },
- { name: "Project Templates", key: "project-templates", component: ProjectTemplatesTab }
+ { name: "Project Templates", key: "project-templates", component: ProjectTemplatesTab },
+ { name: "KMIP", key: "kmip", component: KmipTab }
];
const [selectedTab, setSelectedTab] = useState(search.selectedTab || tabs[0].key);