1
0
forked from baron/baron-sso

api키 생성 기능 및 페이지 구현

This commit is contained in:
2026-01-29 16:38:27 +09:00
parent ee4c07f66d
commit a27026fa2a
9 changed files with 546 additions and 44 deletions

View File

@@ -127,8 +127,17 @@ export async function deleteTenant(tenantId: string) {
}
// API Key Management (M2M)
export type ApiKeyCreateRequest = {
name: string;
scopes: string[];
};
export type ApiKeyCreateResponse = {
apiKey: ApiKeySummary;
clientSecret: string;
};
export async function fetchApiKeys(limit = 50, offset = 0) {
// Placeholder implementation
const { data } = await apiClient.get<ApiKeyListResponse>(
"/v1/admin/api-keys",
{
@@ -138,21 +147,16 @@ export async function fetchApiKeys(limit = 50, offset = 0) {
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 },
});
export async function createApiKey(payload: ApiKeyCreateRequest) {
const { data } = await apiClient.post<ApiKeyCreateResponse>(
"/v1/admin/api-keys",
payload,
);
return data;
}
export async function deleteRole(roleId: string) {
await apiClient.delete(`/v1/admin/roles/${roleId}`);
export async function deleteApiKey(apiKeyId: string) {
await apiClient.delete(`/v1/admin/api-keys/${apiKeyId}`);
}
// User Management