refactor(keycloak): remove authentik naming and switch to keycloak-only paths
This commit is contained in:
@@ -9,11 +9,11 @@ export const getPermissionGroupBindings = (groupKey) => adminHttp.get(`/admin/pe
|
||||
export const updatePermissionGroupBindings = (groupKey, data) =>
|
||||
adminHttp.put(`/admin/permission-groups/${groupKey}/bindings`, data)
|
||||
|
||||
export const addMemberToGroup = (groupKey, authentikSub) =>
|
||||
adminHttp.post(`/admin/permission-groups/${groupKey}/members/${authentikSub}`)
|
||||
export const addMemberToGroup = (groupKey, idpSub) =>
|
||||
adminHttp.post(`/admin/permission-groups/${groupKey}/members/${idpSub}`)
|
||||
|
||||
export const removeMemberFromGroup = (groupKey, authentikSub) =>
|
||||
adminHttp.delete(`/admin/permission-groups/${groupKey}/members/${authentikSub}`)
|
||||
export const removeMemberFromGroup = (groupKey, idpSub) =>
|
||||
adminHttp.delete(`/admin/permission-groups/${groupKey}/members/${idpSub}`)
|
||||
|
||||
export const groupGrant = (groupKey, data) =>
|
||||
adminHttp.post(`/admin/permission-groups/${groupKey}/permissions/grant`, data)
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="啟用"><el-switch v-model="createForm.is_active" /></el-form-item>
|
||||
<el-form-item label="同步 Authentik"><el-switch v-model="createForm.sync_to_authentik" /></el-form-item>
|
||||
<el-form-item label="同步 Keycloak"><el-switch v-model="createForm.sync_to_idp" /></el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="showCreateDialog = false">取消</el-button>
|
||||
@@ -60,7 +60,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="啟用"><el-switch v-model="editForm.is_active" /></el-form-item>
|
||||
<el-form-item label="同步 Authentik"><el-switch v-model="editForm.sync_to_authentik" /></el-form-item>
|
||||
<el-form-item label="同步 Keycloak"><el-switch v-model="editForm.sync_to_idp" /></el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="showEditDialog = false">取消</el-button>
|
||||
@@ -100,7 +100,7 @@ const createForm = ref({
|
||||
display_name: '',
|
||||
group_keys: [],
|
||||
is_active: true,
|
||||
sync_to_authentik: true
|
||||
sync_to_idp: true
|
||||
})
|
||||
const createRules = {
|
||||
username: [{ required: true, message: '請輸入 Username', trigger: 'blur' }],
|
||||
@@ -116,7 +116,7 @@ const editForm = ref({
|
||||
display_name: '',
|
||||
group_keys: [],
|
||||
is_active: true,
|
||||
sync_to_authentik: true
|
||||
sync_to_idp: true
|
||||
})
|
||||
|
||||
async function load() {
|
||||
@@ -141,7 +141,7 @@ function resetCreateForm() {
|
||||
display_name: '',
|
||||
group_keys: [],
|
||||
is_active: true,
|
||||
sync_to_authentik: true
|
||||
sync_to_idp: true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ async function openEdit(row) {
|
||||
display_name: row.display_name || '',
|
||||
group_keys: [],
|
||||
is_active: !!row.is_active,
|
||||
sync_to_authentik: true
|
||||
sync_to_idp: true
|
||||
}
|
||||
try {
|
||||
const res = await getMemberPermissionGroups(row.user_sub)
|
||||
@@ -172,7 +172,7 @@ function resetEditForm() {
|
||||
display_name: '',
|
||||
group_keys: [],
|
||||
is_active: true,
|
||||
sync_to_authentik: true
|
||||
sync_to_idp: true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@ async function handleEdit() {
|
||||
email: editForm.value.email || null,
|
||||
display_name: editForm.value.display_name || null,
|
||||
is_active: editForm.value.is_active,
|
||||
sync_to_authentik: editForm.value.sync_to_authentik
|
||||
sync_to_idp: editForm.value.sync_to_idp
|
||||
})
|
||||
await setMemberPermissionGroups(editForm.value.user_sub, editForm.value.group_keys || [])
|
||||
ElMessage.success('更新會員成功')
|
||||
|
||||
@@ -361,7 +361,7 @@ function formatAdminError(err) {
|
||||
ip_not_allowed: 'IP 不在白名單',
|
||||
path_not_allowed: '路徑不允許',
|
||||
internal_secret_not_configured: '後端設定缺失(internal secret)',
|
||||
authentik_admin_not_configured: '後端設定缺失(authentik admin)',
|
||||
idp_admin_not_configured: '後端設定缺失(idp admin)',
|
||||
user_not_found: '找不到該使用者'
|
||||
}
|
||||
if (detail && map[detail]) return map[detail]
|
||||
|
||||
Reference in New Issue
Block a user