forked from baron/baron-sso
adminfront에 API Key 관리 및 RBAC 기능 추가
This commit is contained in:
@@ -50,6 +50,35 @@ export type TenantUpdateRequest = {
|
||||
status?: string;
|
||||
};
|
||||
|
||||
export type ApiKeySummary = {
|
||||
id: string;
|
||||
name: string;
|
||||
client_id: string;
|
||||
scopes: string[];
|
||||
status: string;
|
||||
lastUsedAt?: string;
|
||||
createdAt: string;
|
||||
};
|
||||
|
||||
export type ApiKeyListResponse = {
|
||||
items: ApiKeySummary[];
|
||||
total: number;
|
||||
};
|
||||
|
||||
export type RoleSummary = {
|
||||
id: string;
|
||||
name: string;
|
||||
description: string;
|
||||
permissions: string[];
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
};
|
||||
|
||||
export type RoleListResponse = {
|
||||
items: RoleSummary[];
|
||||
total: number;
|
||||
};
|
||||
|
||||
export async function fetchAuditLogs(limit = 50, cursor?: string) {
|
||||
const { data } = await apiClient.get<AuditLogListResponse>("/v1/audit", {
|
||||
params: { limit, cursor },
|
||||
@@ -96,3 +125,32 @@ export async function updateTenant(
|
||||
export async function deleteTenant(tenantId: string) {
|
||||
await apiClient.delete(`/v1/admin/tenants/${tenantId}`);
|
||||
}
|
||||
|
||||
// API Key Management (M2M)
|
||||
export async function fetchApiKeys(limit = 50, offset = 0) {
|
||||
// Placeholder implementation
|
||||
const { data } = await apiClient.get<ApiKeyListResponse>(
|
||||
"/v1/admin/api-keys",
|
||||
{
|
||||
params: { limit, offset },
|
||||
},
|
||||
);
|
||||
return data;
|
||||
}
|
||||
|
||||
export async function deleteApiKey(apiKeyId: string) {
|
||||
await apiClient.delete(`/v1/admin/api-keys/${apiKeyId}`);
|
||||
}
|
||||
|
||||
// Role Management (RBAC)
|
||||
export async function fetchRoles(limit = 50, offset = 0) {
|
||||
// Placeholder implementation
|
||||
const { data } = await apiClient.get<RoleListResponse>("/v1/admin/roles", {
|
||||
params: { limit, offset },
|
||||
});
|
||||
return data;
|
||||
}
|
||||
|
||||
export async function deleteRole(roleId: string) {
|
||||
await apiClient.delete(`/v1/admin/roles/${roleId}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user