mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-05 18:26:42 +00:00
Address greptile suggestions
This commit is contained in:
@@ -345,7 +345,7 @@ export const registerSshHostRouter = async (server: FastifyZodProvider) => {
|
||||
schema: {
|
||||
description: "Issue SSH certificate for host",
|
||||
params: z.object({
|
||||
sshHostId: z.string().describe(SSH_HOSTS.DELETE.sshHostId)
|
||||
sshHostId: z.string().describe(SSH_HOSTS.ISSUE_HOST_CERT.sshHostId)
|
||||
}),
|
||||
body: z.object({
|
||||
publicKey: z.string().describe(SSH_HOSTS.ISSUE_HOST_CERT.publicKey)
|
||||
@@ -430,7 +430,7 @@ export const registerSshHostRouter = async (server: FastifyZodProvider) => {
|
||||
schema: {
|
||||
description: "Get public key of the host SSH CA linked to the host",
|
||||
params: z.object({
|
||||
sshHostId: z.string().trim().describe(SSH_HOSTS.GET_USER_CA_PUBLIC_KEY.sshHostId)
|
||||
sshHostId: z.string().trim().describe(SSH_HOSTS.GET_HOST_CA_PUBLIC_KEY.sshHostId)
|
||||
}),
|
||||
response: {
|
||||
200: z.string()
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -1375,6 +1375,7 @@ export const SSH_HOSTS = {
|
||||
publicKey: "The public key of the issued SSH certificate."
|
||||
},
|
||||
ISSUE_HOST_CERT: {
|
||||
sshHostId: "The ID of the SSH host to issue the SSH certificate for.",
|
||||
publicKey: "The SSH public key to issue the SSH certificate for.",
|
||||
serialNumber: "The serial number of the issued SSH certificate.",
|
||||
signedKey: "The SSH certificate or signed SSH public key."
|
||||
|
||||
Reference in New Issue
Block a user