mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 11:38:55 +00:00
Add sign SSH key operation to frontend
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
export { SshCaStatus } from "./enums";
|
||||
export { useCreateSshCa, useDeleteSshCa, useIssueSshCreds,useUpdateSshCa } from "./mutations";
|
||||
export {
|
||||
useCreateSshCa,
|
||||
useDeleteSshCa,
|
||||
useIssueSshCreds,
|
||||
useSignSshKey,
|
||||
useUpdateSshCa} from "./mutations";
|
||||
export { useGetSshCaById, useGetSshCaCertTemplates } from "./queries";
|
||||
|
||||
@@ -8,6 +8,8 @@ import {
|
||||
TDeleteSshCaDTO,
|
||||
TIssueSshCredsDTO,
|
||||
TIssueSshCredsResponse,
|
||||
TSignSshKeyDTO,
|
||||
TSignSshKeyResponse,
|
||||
TSshCertificateAuthority,
|
||||
TUpdateSshCaDTO} from "./types";
|
||||
|
||||
@@ -61,6 +63,15 @@ export const useDeleteSshCa = () => {
|
||||
});
|
||||
};
|
||||
|
||||
export const useSignSshKey = () => {
|
||||
return useMutation<TSignSshKeyResponse, {}, TSignSshKeyDTO>({
|
||||
mutationFn: async (body) => {
|
||||
const { data } = await apiRequest.post<TSignSshKeyResponse>("/api/v1/ssh/sign", body);
|
||||
return data;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
export const useIssueSshCreds = () => {
|
||||
return useMutation<TIssueSshCredsResponse, {}, TIssueSshCredsDTO>({
|
||||
mutationFn: async (body) => {
|
||||
|
||||
@@ -27,6 +27,20 @@ export type TDeleteSshCaDTO = {
|
||||
caId: string;
|
||||
};
|
||||
|
||||
export type TSignSshKeyDTO = {
|
||||
templateName: string;
|
||||
publicKey?: string;
|
||||
certType: SshCertType;
|
||||
principals: string[];
|
||||
ttl?: string;
|
||||
keyId?: string;
|
||||
};
|
||||
|
||||
export type TSignSshKeyResponse = {
|
||||
serialNumber: string;
|
||||
signedKey: string;
|
||||
};
|
||||
|
||||
export type TIssueSshCredsDTO = {
|
||||
templateName: string;
|
||||
keyAlgorithm: CertKeyAlgorithm;
|
||||
|
||||
Reference in New Issue
Block a user