mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-14 15:40:47 +00:00
misc: created abstraction for get kms by id
This commit is contained in:
@@ -666,6 +666,18 @@ export const kmsServiceFactory = ({
|
||||
};
|
||||
};
|
||||
|
||||
const getKmsById = async (kmsKeyId: string, tx?: Knex) => {
|
||||
const kms = await kmsDAL.findByIdWithAssociatedKms(kmsKeyId, tx);
|
||||
|
||||
if (!kms.id) {
|
||||
throw new NotFoundError({
|
||||
message: "KMS not found"
|
||||
});
|
||||
}
|
||||
|
||||
return kms;
|
||||
};
|
||||
|
||||
const startService = async () => {
|
||||
const appCfg = getConfig();
|
||||
// This will switch to a seal process and HMS flow in future
|
||||
@@ -725,6 +737,7 @@ export const kmsServiceFactory = ({
|
||||
getProjectSecretManagerKmsKey,
|
||||
updateProjectSecretManagerKmsKey,
|
||||
getProjectKeyBackup,
|
||||
loadProjectKeyBackup
|
||||
loadProjectKeyBackup,
|
||||
getKmsById
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user