feature: oidc group membership mapping

This commit is contained in:
Scott Wilson
2025-01-30 10:21:30 -08:00
parent e1b016f76d
commit 9cc7edc869
31 changed files with 607 additions and 192 deletions
+16 -1
View File
@@ -5,7 +5,9 @@ import { apiRequest } from "@app/config/request";
import { OIDCConfigData } from "./types";
export const oidcConfigKeys = {
getOIDCConfig: (orgSlug: string) => [{ orgSlug }, "organization-oidc"] as const
getOIDCConfig: (orgSlug: string) => [{ orgSlug }, "organization-oidc"] as const,
getOIDCManageGroupMembershipsEnabled: (orgId: string) =>
["oidc-manage-group-memberships", orgId] as const
};
export const useGetOIDCConfig = (orgSlug: string) => {
@@ -25,3 +27,16 @@ export const useGetOIDCConfig = (orgSlug: string) => {
enabled: true
});
};
export const useOidcManageGroupMembershipsEnabled = (orgId: string) => {
return useQuery({
queryKey: oidcConfigKeys.getOIDCManageGroupMembershipsEnabled(orgId),
queryFn: async () => {
const { data } = await apiRequest.get<{ isEnabled: boolean }>(
`/api/v1/sso/oidc/manage-group-memberships?orgId=${orgId}`
);
return data.isEnabled;
}
});
};