Co-authored-by: Arnaud Dartois <admin@tordais.cc>
3.3 KiB
name, description
| name | description |
|---|---|
| signalr-documentation | Keep the Heimdall SignalR guide aligned with mapped routes, Hub RPC methods, broadcast events, authentication and resource authorization. |
Heimdall SignalR documentation workflow
Use this skill when changing a hub, SignalR authentication, subscription handling, broadcast contract or docs/signalr-usage.md.
Source of truth
- Routes are mapped in
src/Heimdall.Web/Program.csbeside theMapHub<T>calls. - Client-invokable Hub methods belong inside the concrete
Hubsubclass. Nearby*BroadcastServicemethods are server-side application services and must not be documented as client RPC methods. - Server-to-client event names and payload arguments are the
SendAsynccalls in the corresponding broadcast service. - Authentication schemes and token extraction come from each Hub's
[Authorize]attribute,ConfigureJwtBearerAuthenticationinProgram.cs, andApiKeyAuthenticationHandler.ResolveApiKeyFromRequest. - Resource-level subscriptions and reauthorization are implemented by the Hub methods,
ResourceAccess, andLiveSubscriptions.AuthorizedAsync. - Actual clients are
src/Heimdall.Agent/Services/ConfigReceiverService.csandsrc/Heimdall.Web/Services/NotificationsHubClient.cs. - Hub authorization/isolation tests are under
tests/Heimdall.Web.Tests/Hubs/.
Update procedure
- Read the route map and inspect the full Hub subclass before listing its public methods.
- Record separately: auth scheme, caller join/leave methods, site/camera/Agent checks, group/channel key, broadcast messages, and payload shape.
- Follow every broadcast message to the actual
SendAsynccall; omit planned or legacy messages that are not sent by current code. - Check whether recipients are filtered at subscribe time, reauthorized at send time, or both. Never describe a global group as unrestricted when a current access check exists.
- Inspect the real clients for token providers, initial API loads, retries/reconnect behavior and fallback. Do not expose token values or imply browser cookie auth where the Hub requires JWT.
- Confirm every documented route appears in
Program.cs; explicitly label absent routes as planned/unmapped rather than available. - Link the focused tests and distinguish unit/CI evidence from proxy, network or deployment validation.
- Review
docs/signalr-usage.mdfor unsupported event names, copied pseudocode, stale security claims, and missing limits on delivery/replay.
When the SignalR or live-view summary in docs/MASTER_SPECIFICATION.md changes, treat that file's dated architecture sections as historical unless verified against the mapped routes and current media path. Keep the mapped hub list exact, do not describe a planned hub or peer-to-peer media path as shipped, and link readers to docs/signalr-usage.md and docs/docker-compose.md for current contracts and deployment guidance. If retaining superseded material, put a historical-status note immediately before each affected diagram, roadmap phase, UI mockup, or target-results block; a header-only disclaimer is insufficient for those detailed examples.
Do not add runtime behavior in a documentation-only change. If the audit reveals a behavior defect, create a separate Gitea issue before implementation and keep the documentation explicit about the current state.