Stufe 2 (#764): Einmal-Anmeldung fuer die Huelle ueber den Manager-Socket
Der Manager hoert zusaetzlich auf einem lokalen Socket (0600 bzw. Pipe nur fuer den eigenen Benutzer). Dort gibt es nur /api/shell/*, ueber TCP gibt es diese Pfade nicht. Ein Einmal-Code (256 Bit, einmal, hoechstens 60 s) wird in der WebUI aus dem Fragment gegen das Token getauscht und sofort aus der Adresse entfernt. Tests: zweimal, zu spaet, ueber TCP - alle scheitern. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
c3927292fd
commit
775c4dbc8e
@@ -35,7 +35,13 @@ public sealed class AccessToken(byte[] expected)
|
||||
|
||||
/// <summary>Ob dieser Pfad ein Token braucht: alles unter <c>/api</c> und <c>/events</c>.</summary>
|
||||
public static bool NeedsToken(PathString path)
|
||||
=> path.StartsWithSegments("/api") || path.StartsWithSegments("/events");
|
||||
=> (path.StartsWithSegments("/api") || path.StartsWithSegments("/events"))
|
||||
// #764: Exchanging a one-time code is the login itself - like the page that asks
|
||||
// for the token, it cannot require one. The code is the proof (ShellLogin).
|
||||
&& !path.Equals(LoginExchangePath, StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
/// <summary>#764: Where the WebUI trades a one-time code from the shell for the access token.</summary>
|
||||
public const string LoginExchangePath = "/api/login/exchange";
|
||||
|
||||
/// <summary>
|
||||
/// Holt das Token aus der Anfrage.
|
||||
|
||||
Reference in New Issue
Block a user