mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 12:38:36 +00:00
Start SCIM functionality
This commit is contained in:
@@ -10,6 +10,7 @@ export * from "./integrations";
|
||||
export * from "./keys";
|
||||
export * from "./organization";
|
||||
export * from "./roles";
|
||||
export * from "./scim";
|
||||
export * from "./secretApproval";
|
||||
export * from "./secretApprovalRequest";
|
||||
export * from "./secretFolders";
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
export {
|
||||
useGetScimToken
|
||||
} from "./queries";
|
||||
@@ -0,0 +1,24 @@
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
|
||||
import { apiRequest } from "@app/config/request";
|
||||
|
||||
import { GetScimTokenRes } from "./types";
|
||||
|
||||
const scimKeys = {
|
||||
getScimToken: (orgId: string) => [{ orgId }, "organization-scim-token"] as const,
|
||||
};
|
||||
|
||||
export const useGetScimToken = (organizationId: string) => {
|
||||
return useQuery({
|
||||
queryKey: scimKeys.getScimToken(organizationId),
|
||||
queryFn: async () => {
|
||||
if (organizationId === "") {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const { data: { scimToken } } = await apiRequest.get<GetScimTokenRes>(`/api/v1/scim/token/organizations/${organizationId}`);
|
||||
return scimToken;
|
||||
},
|
||||
enabled: true
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,3 @@
|
||||
export type GetScimTokenRes = {
|
||||
scimToken: string;
|
||||
};
|
||||
Reference in New Issue
Block a user