API document: XML doc lists leak into two operation descriptions and collapse in Swagger UI, and anonymous operations list the security schemes #463

Open
opened 2026-11-14 10:51:07 -05:00 by claude · 0 comments
Owner

Found while #447 was verified. Neither is urgent.

  1. Raw XML <list> tags reach the document. The descriptions of POST /api/users/me/email and POST /api/users/{id}/reset-password carry <list type="bullet"><item>…</item></list> from the XML docs in UsersController. Swagger UI sanitises the tags, so the bullet lists collapse into running text. Either write those lists in a form the document filter converts (Markdown list lines), or teach XmlCrefTextDocumentFilter to convert <list> into Markdown, and add a test that no description or summary in the served document holds <list, <item or <para.
  2. Security requirements are declared for the whole document, so anonymous operations (login, refresh, forgot-password, status) and the cluster channel (TSIG only) list Bearer and ApiToken although they need neither. A per-operation requirement (an operation filter keyed on [Authorize] / [AllowAnonymous] and the action's authentication schemes) would make the document accurate and removes the padlock from anonymous operations in Swagger UI. It changes the generated Angular client for those operations (the credential lines go away), so it wants its own regeneration and a check that the console still attaches its token through the interceptor only.
  3. Latent in the generated client: the default ApiToken credential in configuration.ts falls back to apiKeys['Authorization'] and sends it without the ApiToken prefix. The console sets no apiKeys, so nothing is affected today; a note in the README for people who use the generated client elsewhere is enough.
Found while #447 was verified. Neither is urgent. 1. **Raw XML `<list>` tags reach the document.** The descriptions of `POST /api/users/me/email` and `POST /api/users/{id}/reset-password` carry `<list type="bullet"><item>…</item></list>` from the XML docs in `UsersController`. Swagger UI sanitises the tags, so the bullet lists collapse into running text. Either write those lists in a form the document filter converts (Markdown list lines), or teach `XmlCrefTextDocumentFilter` to convert `<list>` into Markdown, and add a test that no description or summary in the served document holds `<list`, `<item` or `<para`. 2. **Security requirements are declared for the whole document**, so anonymous operations (login, refresh, forgot-password, status) and the cluster channel (TSIG only) list `Bearer` and `ApiToken` although they need neither. A per-operation requirement (an operation filter keyed on `[Authorize]` / `[AllowAnonymous]` and the action's authentication schemes) would make the document accurate and removes the padlock from anonymous operations in Swagger UI. It changes the generated Angular client for those operations (the credential lines go away), so it wants its own regeneration and a check that the console still attaches its token through the interceptor only. 3. **Latent in the generated client:** the default `ApiToken` credential in `configuration.ts` falls back to `apiKeys['Authorization']` and sends it without the `ApiToken ` prefix. The console sets no `apiKeys`, so nothing is affected today; a note in the README for people who use the generated client elsewhere is enough.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
lantea-one/ninlil#463
No description provided.