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