Finish preliminary support for external key source for ssh cas

This commit is contained in:
Tuan Dang
2025-04-03 22:46:41 -07:00
parent 5e7ad5614d
commit 9fc9f69fc9
12 changed files with 346 additions and 58 deletions
@@ -12,3 +12,8 @@ export const sshCertTypeToNameMap: { [K in SshCertType]: string } = {
[SshCertType.USER]: "User",
[SshCertType.HOST]: "Host"
};
export enum SshCaKeySource {
INTERNAL = "internal",
EXTERNAL = "external"
}
+17 -6
View File
@@ -1,5 +1,5 @@
import { CertKeyAlgorithm } from "../certificates/enums";
import { SshCaStatus, SshCertType } from "./constants";
import { SshCaKeySource, SshCaStatus, SshCertType } from "./constants";
export type TSshCertificate = {
id: string;
@@ -19,16 +19,27 @@ export type TSshCertificateAuthority = {
status: SshCaStatus;
friendlyName: string;
keyAlgorithm: CertKeyAlgorithm;
keySource: SshCaKeySource;
createdAt: string;
updatedAt: string;
publicKey: string;
};
export type TCreateSshCaDTO = {
projectId: string;
friendlyName?: string;
keyAlgorithm: CertKeyAlgorithm;
};
export type TCreateSshCaDTO =
| {
projectId: string;
friendlyName?: string;
keySource: SshCaKeySource.INTERNAL;
keyAlgorithm: CertKeyAlgorithm;
}
| {
projectId: string;
friendlyName?: string;
keySource: SshCaKeySource.EXTERNAL;
keyAlgorithm: CertKeyAlgorithm;
publicKey: string;
privateKey: string;
};
export type TUpdateSshCaDTO = {
caId: string;