feat: add host self-enrollment workflow v0.1.7
All checks were successful
CI Pipeline / Rust Format Check (push) Successful in 5s
CI Pipeline / Clippy Lints (push) Successful in 53s
CI Pipeline / Rust Unit Tests (push) Successful in 1m11s
CI Pipeline / Security Audit (push) Successful in 4s
CI Pipeline / Frontend Lint & Type Check (push) Successful in 14s
CI Pipeline / Build .deb & Release (push) Has been skipped
All checks were successful
CI Pipeline / Rust Format Check (push) Successful in 5s
CI Pipeline / Clippy Lints (push) Successful in 53s
CI Pipeline / Rust Unit Tests (push) Successful in 1m11s
CI Pipeline / Security Audit (push) Successful in 4s
CI Pipeline / Frontend Lint & Type Check (push) Successful in 14s
CI Pipeline / Build .deb & Release (push) Has been skipped
This commit is contained in:
@ -372,3 +372,26 @@ export const usersApi = {
|
||||
adminDisableMfa: (id: string) => apiClient.delete(`/users/${id}/mfa`),
|
||||
disableMfa: (password: string) => apiClient.delete('/auth/mfa', { data: { password } }),
|
||||
}
|
||||
|
||||
// ── Enrollment API (Admin) ────────────────────────────────────────────────
|
||||
export interface EnrollmentRequest {
|
||||
id: string
|
||||
machine_id: string
|
||||
fqdn: string
|
||||
ip_address: string
|
||||
os_details: Record<string, unknown>
|
||||
polling_token: string
|
||||
created_at: string
|
||||
expires_at: string
|
||||
}
|
||||
|
||||
export const enrollmentApi = {
|
||||
listPending: (): Promise<EnrollmentRequest[]> =>
|
||||
apiClient.get<EnrollmentRequest[]>('/admin/enrollments').then(r => r.data),
|
||||
|
||||
approve: (id: string): Promise<void> =>
|
||||
apiClient.post(`/admin/enrollments/${id}/approve`).then(() => {}),
|
||||
|
||||
deny: (id: string): Promise<void> =>
|
||||
apiClient.delete(`/admin/enrollments/${id}/deny`).then(() => {}),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user