refactor(api-keys): remove API key reset endpoint and update documentation
Eliminate the POST /tenants/{id}/api-key endpoint for resetting tenant API keys, transitioning to a more granular API key management approach. Update related documentation and API specifications to reflect the new structure, including changes to the tenant API key management paths. Adjust frontend code and internationalization files to remove references to the deprecated API key reset functionality, enhancing clarity and consistency across the application.
This commit is contained in:
@@ -108,23 +108,6 @@ export async function listAllTenants(): Promise<{ success: boolean; data?: { ite
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置租户的 API Key。成功后返回新的明文 Key,旧 Key 立即失效。
|
||||
*/
|
||||
export async function resetTenantApiKey(
|
||||
tenantId: string | number,
|
||||
): Promise<{ success: boolean; data?: { api_key: string }; message?: string }> {
|
||||
try {
|
||||
const response = await post(`/api/v1/tenants/${tenantId}/api-key`)
|
||||
return response as unknown as { success: boolean; data?: { api_key: string }; message?: string }
|
||||
} catch (error: any) {
|
||||
return {
|
||||
success: false,
|
||||
message: error.message || t('error.tenant.resetApiKeyFailed'),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export async function getAPIPrincipalConfig(
|
||||
tenantId: number,
|
||||
): Promise<{ success: boolean; data?: APIPrincipalConfig; message?: string }> {
|
||||
|
||||
@@ -3634,7 +3634,6 @@ export default {
|
||||
tenant: {
|
||||
listFailed: 'Failed to list tenants',
|
||||
searchFailed: 'Failed to search tenants',
|
||||
resetApiKeyFailed: 'Failed to reset API Key',
|
||||
getApiPrincipalConfigFailed: 'Failed to get API principal config',
|
||||
updateApiPrincipalConfigFailed: 'Failed to update API principal config',
|
||||
createApiPrincipalTestTokenFailed: 'Failed to create API test token',
|
||||
|
||||
@@ -2642,7 +2642,6 @@ export default {
|
||||
tenant: {
|
||||
listFailed: '테넌트 목록 조회 실패',
|
||||
searchFailed: '테넌트 검색 실패',
|
||||
resetApiKeyFailed: 'API 키 재설정 실패',
|
||||
getApiPrincipalConfigFailed: 'API principal config 조회 실패',
|
||||
updateApiPrincipalConfigFailed: 'API principal config 업데이트 실패',
|
||||
createApiPrincipalTestTokenFailed: 'API 테스트 토큰 생성 실패',
|
||||
|
||||
@@ -2357,7 +2357,6 @@ export default {
|
||||
tenant: {
|
||||
listFailed: 'Не удалось получить список тенантов',
|
||||
searchFailed: 'Не удалось выполнить поиск тенантов',
|
||||
resetApiKeyFailed: 'Не удалось сбросить API Key',
|
||||
getApiPrincipalConfigFailed: 'Не удалось получить конфигурацию API principal',
|
||||
updateApiPrincipalConfigFailed: 'Не удалось обновить конфигурацию API principal',
|
||||
createApiPrincipalTestTokenFailed: 'Не удалось создать тестовый API Token',
|
||||
|
||||
@@ -2652,7 +2652,6 @@ export default {
|
||||
tenant: {
|
||||
listFailed: "获取空间列表失败",
|
||||
searchFailed: "搜索空间失败",
|
||||
resetApiKeyFailed: "重置 API Key 失败",
|
||||
getApiPrincipalConfigFailed: "获取 API 用户身份配置失败",
|
||||
updateApiPrincipalConfigFailed: "更新 API 用户身份配置失败",
|
||||
createApiPrincipalTestTokenFailed: "生成 API 测试 Token 失败",
|
||||
|
||||
Reference in New Issue
Block a user