mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 10:35:17 +00:00
Add issue SSH certificate modal
This commit is contained in:
@@ -2,3 +2,8 @@ export enum SshCaStatus {
|
||||
ACTIVE = "active",
|
||||
DISABLED = "disabled"
|
||||
}
|
||||
|
||||
export enum SshCertType {
|
||||
USER = "user",
|
||||
HOST = "host"
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
export { SshCaStatus } from "./enums";
|
||||
export { useCreateSshCa, useDeleteSshCa,useUpdateSshCa } from "./mutations";
|
||||
export { useCreateSshCa, useDeleteSshCa, useIssueSshCreds,useUpdateSshCa } from "./mutations";
|
||||
export { useGetSshCaById, useGetSshCaCertTemplates } from "./queries";
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
||||
|
||||
import { apiRequest } from "@app/config/request";
|
||||
@@ -7,6 +6,8 @@ import { organizationKeys } from "../organization/queries";
|
||||
import {
|
||||
TCreateSshCaDTO,
|
||||
TDeleteSshCaDTO,
|
||||
TIssueSshCredsDTO,
|
||||
TIssueSshCredsResponse,
|
||||
TSshCertificateAuthority,
|
||||
TUpdateSshCaDTO} from "./types";
|
||||
|
||||
@@ -59,3 +60,12 @@ export const useDeleteSshCa = () => {
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
export const useIssueSshCreds = () => {
|
||||
return useMutation<TIssueSshCredsResponse, {}, TIssueSshCredsDTO>({
|
||||
mutationFn: async (body) => {
|
||||
const { data } = await apiRequest.post<TIssueSshCredsResponse>("/api/v1/ssh/issue", body);
|
||||
return data;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { CertKeyAlgorithm } from "../certificates/enums";
|
||||
import { SshCaStatus } from "./enums";
|
||||
import { SshCaStatus, SshCertType } from "./enums";
|
||||
|
||||
export type TSshCertificateAuthority = {
|
||||
id: string;
|
||||
@@ -26,3 +26,20 @@ export type TUpdateSshCaDTO = {
|
||||
export type TDeleteSshCaDTO = {
|
||||
caId: string;
|
||||
};
|
||||
|
||||
export type TIssueSshCredsDTO = {
|
||||
templateName: string;
|
||||
keyAlgorithm: CertKeyAlgorithm;
|
||||
certType: SshCertType;
|
||||
principals: string[];
|
||||
ttl?: string;
|
||||
keyId?: string;
|
||||
};
|
||||
|
||||
export type TIssueSshCredsResponse = {
|
||||
serialNumber: string;
|
||||
signedKey: string;
|
||||
privateKey: string;
|
||||
publicKey: string;
|
||||
keyAlgorithm: CertKeyAlgorithm;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user