forked from baron/baron-sso
feat: 테넌트/RP 관리자 할당 UI 및 ReBAC 권한 검증 도구 구현 #244
This commit is contained in:
@@ -287,6 +287,50 @@ export async function removeTenantFromGroup(groupId: string, tenantId: string) {
|
||||
);
|
||||
}
|
||||
|
||||
export type TenantAdmin = {
|
||||
id: string;
|
||||
name: string;
|
||||
email: string;
|
||||
};
|
||||
|
||||
export async function fetchTenantAdmins(tenantId: string) {
|
||||
const { data } = await apiClient.get<TenantAdmin[]>(
|
||||
`/v1/admin/tenants/${tenantId}/admins`,
|
||||
);
|
||||
return data;
|
||||
}
|
||||
|
||||
export async function addTenantAdmin(tenantId: string, userId: string) {
|
||||
await apiClient.post(`/v1/admin/tenants/${tenantId}/admins/${userId}`);
|
||||
}
|
||||
|
||||
export async function removeTenantAdmin(tenantId: string, userId: string) {
|
||||
await apiClient.delete(`/v1/admin/tenants/${tenantId}/admins/${userId}`);
|
||||
}
|
||||
|
||||
export type GroupAdmin = {
|
||||
id: string;
|
||||
name: string;
|
||||
email: string;
|
||||
};
|
||||
|
||||
export async function fetchGroupAdmins(groupId: string) {
|
||||
const { data } = await apiClient.get<GroupAdmin[]>(
|
||||
`/v1/admin/tenant-groups/${groupId}/admins`,
|
||||
);
|
||||
return data;
|
||||
}
|
||||
|
||||
export async function addGroupAdmin(groupId: string, userId: string) {
|
||||
await apiClient.post(`/v1/admin/tenant-groups/${groupId}/admins/${userId}`);
|
||||
}
|
||||
|
||||
export async function removeGroupAdmin(groupId: string, userId: string) {
|
||||
await apiClient.delete(
|
||||
`/v1/admin/tenant-groups/${groupId}/admins/${userId}`,
|
||||
);
|
||||
}
|
||||
|
||||
// API Key Management (M2M)
|
||||
export type ApiKeyCreateRequest = {
|
||||
name: string;
|
||||
@@ -465,5 +509,55 @@ export async function updateRelyingParty(id: string, payload: HydraClientReq) {
|
||||
}
|
||||
|
||||
export async function deleteRelyingParty(id: string) {
|
||||
|
||||
await apiClient.delete(`/v1/admin/relying-parties/${id}`);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
export type RPOwner = {
|
||||
|
||||
subject: string;
|
||||
|
||||
name?: string;
|
||||
|
||||
email?: string;
|
||||
|
||||
type: string;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
export async function fetchRPOwners(clientId: string) {
|
||||
|
||||
const { data } = await apiClient.get<RPOwner[]>(
|
||||
|
||||
`/v1/admin/relying-parties/${clientId}/owners`,
|
||||
|
||||
);
|
||||
|
||||
return data;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
export async function addRPOwner(clientId: string, subject: string) {
|
||||
|
||||
await apiClient.post(`/v1/admin/relying-parties/${clientId}/owners/${subject}`);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
export async function removeRPOwner(clientId: string, subject: string) {
|
||||
|
||||
await apiClient.delete(
|
||||
|
||||
`/v1/admin/relying-parties/${clientId}/owners/${subject}`,
|
||||
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user