Heimdall sign-in: redact the app secret from client logging, expire the attempt cookie at its path, bound the return path

- The HeimdallAuthService client redacts x-heimdall-app-secret from HTTP client logging at every level; a Trace canary test pins it.
- The attempt cookie's deletion carries its Path and no Max-Age (which outranks the 1970 expiry); pinned on success and refusal paths.
- LocalReturnPath is at most 256 characters, else /App, so the attempt cookie stays far below the browser limit; pinned at the bound and with the heaviest-escaping path.
- A set BaseUrl with a blank AppSlug is refused at Start before any Heimdall call; behavioural test.

Builds untested until the verification job at the end of this batch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-11 08:58:19 +02:00
commit d695674359
5 changed files with 136 additions and 6 deletions

View file

@ -347,6 +347,7 @@ public sealed class HeimdallHost : TestWebApplicationFactory
public const string AppSecret = "test-heimdall-app-secret";
private readonly string _appSecret;
private readonly string _appSlug;
private readonly string _baseUrl;
private readonly string _publicBaseUrl;
private readonly bool _discordRoles;
@ -363,9 +364,11 @@ public sealed class HeimdallHost : TestWebApplicationFactory
string appSecret = AppSecret,
string baseUrl = HeimdallShapes.Issuer,
string publicBaseUrl = "https://localhost",
bool discordRoles = true)
bool discordRoles = true,
string appSlug = "bifrost")
{
_appSecret = appSecret;
_appSlug = appSlug;
_baseUrl = baseUrl;
_publicBaseUrl = publicBaseUrl;
_discordRoles = discordRoles;
@ -385,6 +388,7 @@ public sealed class HeimdallHost : TestWebApplicationFactory
{
["Heimdall:BaseUrl"] = _baseUrl,
["Heimdall:AppSecret"] = _appSecret,
["Heimdall:AppSlug"] = _appSlug,
["Heimdall:DiscordGuildId"] = "guild-1",
["Host:PublicBaseUrl"] = _publicBaseUrl
});