mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-16 06:45:28 +00:00
23 lines
667 B
TypeScript
23 lines
667 B
TypeScript
import SecurityClient from "@app/components/utilities/SecurityClient";
|
|
|
|
/**
|
|
* This route lets us get the public keys of everyone in your workspace.
|
|
* @param {string} workspaceId
|
|
* @returns
|
|
*/
|
|
const getWorkspaceKeys = ({ workspaceId }: { workspaceId: string }) =>
|
|
SecurityClient.fetchCall(`/api/v1/workspace/${workspaceId}/keys`, {
|
|
method: "GET",
|
|
headers: {
|
|
"Content-Type": "application/json"
|
|
}
|
|
}).then(async (res) => {
|
|
if (res?.status === 200) {
|
|
return (await res.json()).publicKeys;
|
|
}
|
|
console.log("Failed to get the public keys of everyone in the workspace");
|
|
return undefined;
|
|
});
|
|
|
|
export default getWorkspaceKeys;
|