forked from baron/baron-sso
개발자 라우터 api -> dev
This commit is contained in:
@@ -475,15 +475,16 @@ func main() {
|
|||||||
admin.Post("/api-keys", apiKeyHandler.CreateApiKey)
|
admin.Post("/api-keys", apiKeyHandler.CreateApiKey)
|
||||||
admin.Delete("/api-keys/:id", apiKeyHandler.DeleteApiKey)
|
admin.Delete("/api-keys/:id", apiKeyHandler.DeleteApiKey)
|
||||||
|
|
||||||
// 개발자 포털 라우트 (RP/Consent 관리)
|
// 개발자 포털 라우트 (RP/Consent 관리 및 IdP 설정)
|
||||||
api.Get("/clients", devHandler.ListClients)
|
dev := api.Group("/dev")
|
||||||
api.Post("/clients", devHandler.CreateClient)
|
dev.Get("/clients", devHandler.ListClients)
|
||||||
api.Get("/clients/:id", devHandler.GetClient)
|
dev.Post("/clients", devHandler.CreateClient)
|
||||||
api.Put("/clients/:id", devHandler.UpdateClient)
|
dev.Get("/clients/:id", devHandler.GetClient)
|
||||||
api.Patch("/clients/:id/status", devHandler.UpdateClientStatus)
|
dev.Put("/clients/:id", devHandler.UpdateClient)
|
||||||
api.Delete("/clients/:id", devHandler.DeleteClient)
|
dev.Patch("/clients/:id/status", devHandler.UpdateClientStatus)
|
||||||
api.Get("/consents", devHandler.ListConsents)
|
dev.Delete("/clients/:id", devHandler.DeleteClient)
|
||||||
api.Delete("/consents", devHandler.RevokeConsents)
|
dev.Get("/consents", devHandler.ListConsents)
|
||||||
|
dev.Delete("/consents", devHandler.RevokeConsents)
|
||||||
|
|
||||||
// Webhook for Descope Generic SMS Gateway
|
// Webhook for Descope Generic SMS Gateway
|
||||||
auth.Post("/webhooks/descope-sms", authHandler.HandleDescopeSmsRelay)
|
auth.Post("/webhooks/descope-sms", authHandler.HandleDescopeSmsRelay)
|
||||||
|
|||||||
@@ -91,13 +91,13 @@ export type IdpConfigUpdateRequest = Partial<IdpConfigCreateRequest>;
|
|||||||
|
|
||||||
|
|
||||||
export async function fetchClients() {
|
export async function fetchClients() {
|
||||||
const { data } = await apiClient.get<ClientListResponse>("/clients");
|
const { data } = await apiClient.get<ClientListResponse>("/dev/clients");
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function fetchClient(clientId: string) {
|
export async function fetchClient(clientId: string) {
|
||||||
const { data } = await apiClient.get<ClientDetailResponse>(
|
const { data } = await apiClient.get<ClientDetailResponse>(
|
||||||
`/clients/${clientId}`,
|
`/dev/clients/${clientId}`,
|
||||||
);
|
);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
@@ -107,7 +107,7 @@ export async function updateClientStatus(
|
|||||||
status: ClientStatus,
|
status: ClientStatus,
|
||||||
) {
|
) {
|
||||||
const { data } = await apiClient.patch<ClientDetailResponse>(
|
const { data } = await apiClient.patch<ClientDetailResponse>(
|
||||||
`/clients/${clientId}/status`,
|
`/dev/clients/${clientId}/status`,
|
||||||
{ status },
|
{ status },
|
||||||
);
|
);
|
||||||
return data;
|
return data;
|
||||||
@@ -115,7 +115,7 @@ export async function updateClientStatus(
|
|||||||
|
|
||||||
export async function createClient(payload: ClientUpsertRequest) {
|
export async function createClient(payload: ClientUpsertRequest) {
|
||||||
const { data } = await apiClient.post<ClientDetailResponse>(
|
const { data } = await apiClient.post<ClientDetailResponse>(
|
||||||
"/clients",
|
"/dev/clients",
|
||||||
payload,
|
payload,
|
||||||
);
|
);
|
||||||
return data;
|
return data;
|
||||||
@@ -126,14 +126,14 @@ export async function updateClient(
|
|||||||
payload: ClientUpsertRequest,
|
payload: ClientUpsertRequest,
|
||||||
) {
|
) {
|
||||||
const { data } = await apiClient.put<ClientDetailResponse>(
|
const { data } = await apiClient.put<ClientDetailResponse>(
|
||||||
`/clients/${clientId}`,
|
`/dev/clients/${clientId}`,
|
||||||
payload,
|
payload,
|
||||||
);
|
);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function deleteClient(clientId: string) {
|
export async function deleteClient(clientId: string) {
|
||||||
await apiClient.delete(`/clients/${clientId}`);
|
await apiClient.delete(`/dev/clients/${clientId}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function fetchConsents(subject: string, clientId?: string) {
|
export async function fetchConsents(subject: string, clientId?: string) {
|
||||||
@@ -141,7 +141,7 @@ export async function fetchConsents(subject: string, clientId?: string) {
|
|||||||
if (clientId) {
|
if (clientId) {
|
||||||
params.client_id = clientId;
|
params.client_id = clientId;
|
||||||
}
|
}
|
||||||
const { data } = await apiClient.get<ConsentListResponse>("/consents", {
|
const { data } = await apiClient.get<ConsentListResponse>("/dev/consents", {
|
||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
return data;
|
return data;
|
||||||
@@ -152,21 +152,21 @@ export async function revokeConsent(subject: string, clientId?: string) {
|
|||||||
if (clientId) {
|
if (clientId) {
|
||||||
params.client_id = clientId;
|
params.client_id = clientId;
|
||||||
}
|
}
|
||||||
await apiClient.delete("/consents", { params });
|
await apiClient.delete("/dev/consents", { params });
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- Federation / IdP Config API Calls ---
|
// --- Federation / IdP Config API Calls ---
|
||||||
|
|
||||||
export async function listIdpConfigsForClient(clientId: string) {
|
export async function listIdpConfigsForClient(clientId: string) {
|
||||||
const { data } = await apiClient.get<IdpConfig[]>(
|
const { data } = await apiClient.get<IdpConfig[]>(
|
||||||
`/clients/${clientId}/idps`,
|
`/dev/clients/${clientId}/idps`,
|
||||||
);
|
);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function createIdpConfigForClient(payload: IdpConfigCreateRequest) {
|
export async function createIdpConfigForClient(payload: IdpConfigCreateRequest) {
|
||||||
const { data } = await apiClient.post<IdpConfig>(
|
const { data } = await apiClient.post<IdpConfig>(
|
||||||
`/clients/${payload.client_id}/idps`,
|
`/dev/clients/${payload.client_id}/idps`,
|
||||||
payload,
|
payload,
|
||||||
);
|
);
|
||||||
return data;
|
return data;
|
||||||
@@ -178,12 +178,12 @@ export async function updateIdpConfig(
|
|||||||
payload: IdpConfigUpdateRequest,
|
payload: IdpConfigUpdateRequest,
|
||||||
) {
|
) {
|
||||||
const { data } = await apiClient.put<IdpConfig>(
|
const { data } = await apiClient.put<IdpConfig>(
|
||||||
`/clients/${clientId}/idps/${idpId}`,
|
`/dev/clients/${clientId}/idps/${idpId}`,
|
||||||
payload,
|
payload,
|
||||||
);
|
);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function deleteIdpConfig(clientId: string, idpId: string) {
|
export async function deleteIdpConfig(clientId: string, idpId: string) {
|
||||||
await apiClient.delete(`/clients/${clientId}/idps/${idpId}`);
|
await apiClient.delete(`/dev/clients/${clientId}/idps/${idpId}`);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user