Questa pagina non è ancora tradotta in italiano: qui la trovi in inglese.
MentorApprovalOwners class
Which SignalR connection raised each pending HITL confirmation (BUG-058).
On this page
MentorApprovalStore in the core is keyed by Guid alone, which is right for it — the core has no notion of a connection. But POST /mentor/approve then had nothing to check a caller against, so anyone who learned an action id could approve a gated, destructive action its owner had not answered, or deny one they wanted. The action id shares the connection id's weakness: the documented client sends it in a query string, so it reaches access logs, proxy logs and browser history on the way back.
This map lives in the Server package, not the core, precisely because the thing it knows is transport-shaped. With the connection in hand the endpoint reuses the same ownership check /mentor/session uses, against the principal that opened it.
An action id that is not here has no owner to check: an SSE client's confirmation never passes through a hub connection, and neither does an in-process Blazor Server one. Those keep today's behaviour rather than failing closed, which would break HITL for every such host.
Definition
Section titled “Definition”Namespace: Novior.MentorAgent.Server.Hubs. Package: Novior.MentorAgent.Server.
public sealed class MentorApprovalOwners
dotnet add package Novior.MentorAgent.ServerConstructors
Section titled “Constructors”public MentorApprovalOwners()
Methods
Section titled “Methods”ConnectionFor
Section titled “ConnectionFor”public string? ConnectionFor(Guid actionId)
The connection that raised it, or null when nothing recorded one.
Forget
Section titled “Forget”public void Forget(Guid actionId)
Forgets one entry once it has been answered.
ForgetConnection
Section titled “ForgetConnection”public void ForgetConnection(string connectionId)
Forgets everything a dropped connection had pending. Without this the map grows for the life of the process — a confirmation that is never answered would otherwise leak an entry per abandoned turn.
Record
Section titled “Record”public void Record(Guid actionId, string connectionId)
Records that connectionId raised actionId.
