mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 05:19:49 +00:00
Update permission logic
This commit is contained in:
@@ -1,2 +1,2 @@
|
||||
export { useCreateSshHost, useDeleteSshHost, useUpdateSshHost } from "./mutations";
|
||||
export { useGetSshHostById } from "./queries";
|
||||
export { fetchSshHostUserCaPublicKey, useGetSshHostById } from "./queries";
|
||||
|
||||
@@ -5,7 +5,8 @@ import { apiRequest } from "@app/config/request";
|
||||
import { TSshHost } from "./types";
|
||||
|
||||
export const sshHostKeys = {
|
||||
getSshHostById: (sshHostId: string) => [{ sshHostId }, "ssh-host"]
|
||||
getSshHostById: (sshHostId: string) => [{ sshHostId }, "ssh-host"],
|
||||
getSshHostUserCaPublicKey: (sshHostId: string) => [{ sshHostId }, "ssh-host-user-ca-public-key"]
|
||||
};
|
||||
|
||||
export const useGetSshHostById = (sshHostId: string) => {
|
||||
@@ -18,3 +19,10 @@ export const useGetSshHostById = (sshHostId: string) => {
|
||||
enabled: Boolean(sshHostId)
|
||||
});
|
||||
};
|
||||
|
||||
export const fetchSshHostUserCaPublicKey = async (sshHostId: string): Promise<string> => {
|
||||
const { data } = await apiRequest.get<string>(
|
||||
`/api/v1/ssh/hosts/${sshHostId}/user-ca-public-key`
|
||||
);
|
||||
return data;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user