Update ssh issue/sign fns to be based on certificate template id

This commit is contained in:
Tuan Dang
2024-12-17 10:37:05 -08:00
parent 1fa99e5585
commit 86800c0cdb
7 changed files with 28 additions and 53 deletions
+2 -2
View File
@@ -42,7 +42,7 @@ export type TDeleteSshCaDTO = {
export type TSignSshKeyDTO = {
projectId: string;
templateName: string;
certificateTemplateId: string;
publicKey?: string;
certType: SshCertType;
principals: string[];
@@ -57,7 +57,7 @@ export type TSignSshKeyResponse = {
export type TIssueSshCredsDTO = {
projectId: string;
templateName: string;
certificateTemplateId: string;
keyAlgorithm: CertKeyAlgorithm;
certType: SshCertType;
principals: string[];
@@ -126,8 +126,8 @@ export const SshCertificateModal = ({ popUp, handlePopUpToggle }: Props) => {
switch (operation) {
case SshCertificateOperation.SIGN_SSH_KEY: {
const { serialNumber, signedKey } = await signSshKey({
projectId: currentWorkspace?.id || "",
templateName: templateData.name,
projectId,
certificateTemplateId: templateData.id,
publicKey: existingPublicKey,
certType,
principals: principals.split(",").map((user) => user.trim()),
@@ -144,7 +144,7 @@ export const SshCertificateModal = ({ popUp, handlePopUpToggle }: Props) => {
case SshCertificateOperation.ISSUE_SSH_CREDS: {
const { serialNumber, publicKey, privateKey, signedKey } = await issueSshCreds({
projectId,
templateName: templateData.name,
certificateTemplateId: templateData.id,
keyAlgorithm,
certType,
principals: principals.split(",").map((user) => user.trim()),