feat(@xen-orchestra/rest-api): setup simple auth middleware (#8327)

Configure dependency injection + configure authentication middleware for openapi (copy of what actually exists in the current REST API. Will be improved later when implementing ACL/resource set)
This commit is contained in:
Mathieu
2025-02-20 16:07:09 +01:00
committed by GitHub
parent db3f702235
commit 6f5b97f7f3
12 changed files with 179 additions and 6 deletions

View File

@@ -89,6 +89,12 @@ type BaseXoVm = {
}
}
export type XoGroup = {
id: Branded<'group'>
name: string
users: XoUser['id'][]
}
export type XoHost = {
id: Branded<'host'>
type: 'host'
@@ -104,6 +110,17 @@ export type XoSr = {
type: 'SR'
}
export type XoUser = {
authProviders?: Record<string, string>
email: string
groups: XoGroup['id'][]
id: Branded<'user'>
name: string
permission: string
pw_hash: string
preferences: Record<string, string>
}
export type XoVbd = {
id: Branded<'VBD'>
type: 'VBDu'
@@ -166,9 +183,11 @@ export type XoVtpm = {
}
export type XoRecord =
| XoGroup
| XoHost
| XoPool
| XoSr
| XoUser
| XoVbd
| XoVdi
| XoVgpu