feat: add SSH key signing and verification UI
This commit is contained in:
@@ -24,3 +24,30 @@ export async function createSSHKey(data: SSHKeyCreate): Promise<SSHKey> {
|
||||
export async function deleteSSHKey(keyId: string): Promise<void> {
|
||||
await apiClient.delete(`/ssh-keys/${keyId}`);
|
||||
}
|
||||
|
||||
export interface SignPayloadRequest {
|
||||
payload: string;
|
||||
}
|
||||
|
||||
export interface SignatureResponse {
|
||||
signature: string;
|
||||
}
|
||||
|
||||
export interface VerifySignatureRequest {
|
||||
payload: string;
|
||||
signature: string;
|
||||
}
|
||||
|
||||
export interface VerifySignatureResponse {
|
||||
valid: boolean;
|
||||
}
|
||||
|
||||
export async function signPayload(keyId: string, data: SignPayloadRequest): Promise<SignatureResponse> {
|
||||
const response = await apiClient.post<SignatureResponse>(`/ssh-keys/${keyId}/sign`, data);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
export async function verifySignature(keyId: string, data: VerifySignatureRequest): Promise<VerifySignatureResponse> {
|
||||
const response = await apiClient.post<VerifySignatureResponse>(`/ssh-keys/${keyId}/verify`, data);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user