XO 6 frontend compat - #3
Draft
nathanael-h wants to merge 3 commits into
Draft
Conversation
The XO 6 web frontend (@xen-orchestra/web) drives everything over the REST API: it streams collections as NDJSON and receives live updates over a Server-Sent Events channel. Two areas were needed for it to run against the simulator. Auth: - accept the `token` cookie set by the web UI's /dev/token page, in addition to the existing `authenticationToken` cookie and the Authorization header - GET /users/me resolves to the default admin fixture in accept-any mode, since the pasted dev token was never issued by the simulator - token issuing, optional enforcement middleware and the users fixture back the login flow NDJSON / SSE: - list, get-by-id and sub-collection endpoints emit newline-delimited JSON when `?ndjson=true`; the plain-JSON and URI-list behaviours are preserved - add the SSE channel at GET /rest/v0/events (init + ping) plus POST/DELETE /events/:sseId/subscriptions; the handshake must complete before a watched collection performs its initial fetch - stub the dashboard endpoints with empty aggregates and return an empty NDJSON list for sub-collections without fixture-backed relationships Document the full workflow in the README.
`npm start` failed before binding: ts-node rejected the /docs route with TS2769 (no overload matches this call). Two problems overlapped. `swaggerUi.serve` is a RequestHandler array passed where app.use expects a single handler, so it needs a spread. And @types/swagger-ui-express nests its own @types/express 5.0.6 while the project resolves @types/express 4.17.25 at top level, so the two RequestHandler declarations do not structurally match: express 5 widened IRouterMatcher paths to accept RegExp, and no cast-free spelling compiles. Type-only change; the handlers behave as before. A cleaner fix would be a package.json `overrides` entry pinning the transitive dep to the express 4 types, but that is a dependency decision and this branch may be heading toward express 5.
ci-runner-01 is `"power_state": "Halted"` but its $container referenced a host UUID from hosts.json. In XO's model $container is whatever currently holds the VM: the host it is resident on while running, the pool when it is not resident anywhere. Point it at the pool, which already matches its $pool and $poolId. The other running VMs keep their host containers. win-test is Suspended and still references a host, which is intentional: a suspended VM keeps its host affinity.
nathanael-h
commented
Aug 17, 2026
| issued tokens bind to the matching user, or to the first admin in accept-any | ||
| mode. | ||
|
|
||
| ## Authentication |
Member
Author
There was a problem hiding this comment.
duplicate, sorry I missed this one, I'll fix the doc
Member
Author
|
The main point for XO 6 compat was mocking auth system. So here is a mocked auth system, which could be lazy, i.e. let any user/pwd or could be enforced. |
Member
Author
|
I convert to draft, to rebase on #2 |
nathanael-h
marked this pull request as draft
August 18, 2026 09:02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR allows to run the xo-web frontend "XO 6" against this simulator. They're limitations, like no live data, no dashboard, no VNC console. But at least the frontend starts now, and static data is visible.
It also fix a VM halted parent in the mocked data set, and a code error for the Swgger UI.