Address greptile suggestions

This commit is contained in:
Tuan Dang
2025-04-10 16:45:24 -07:00
parent 77dd768a38
commit 264177638f
14 changed files with 48 additions and 214 deletions
@@ -71,7 +71,6 @@ export enum ProjectPermissionSshHostActions {
Create = "create",
Edit = "edit",
Delete = "delete",
IssueUserCert = "issue-user-cert",
IssueHostCert = "issue-host-cert"
}
@@ -214,14 +214,6 @@ export const sshHostServiceFactory = ({
tx
);
await sshHostLoginUserDAL.insertMany(
loginMappings.map(({ loginUser }) => ({
sshHostId: host.id,
loginUser
})),
tx
);
// (dangtony98): room to optimize
for await (const { loginUser, allowedPrincipals } of loginMappings) {
const sshHostLoginUser = await sshHostLoginUserDAL.create(
@@ -524,7 +516,7 @@ export const sshHostServiceFactory = ({
await sshCertificateDAL.transaction(async (tx) => {
const cert = await sshCertificateDAL.create(
{
sshCaId: host.hostSshCaId,
sshCaId: host.userSshCaId,
sshHostId: host.id,
serialNumber,
certType: SshCertType.USER,
@@ -543,7 +543,7 @@ export const createSshCaHelper = async ({
// use external SSH CA key pair
if (!externalPk || !externalSk) {
throw new BadRequestError({
message: "Public and private keys are required if generateSigningKey is false"
message: "Public and private keys are required when key source is external"
});
}
publicKey = externalPk;