refactor(gateway): simplify prefix extraction in TicketValidator

Read the prefix claim via ClaimsIdentity.FindFirst instead of a three-part
ternary over the claims dictionary, and drop the XML summary.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-05 21:59:55 +02:00
co-authored by Claude Opus 4.8
parent 45ce66a6ee
commit 5aeca4deb1
@@ -34,10 +34,6 @@ public sealed class TicketValidator : IDisposable
};
}
/// <summary>
/// Validates the stream ticket and returns the authorized object-key prefix,
/// or <see langword="null"/> if the ticket is missing, invalid, or carries no prefix.
/// </summary>
public async Task<string?> ValidateTicketAsync(string? token)
{
if (string.IsNullOrWhiteSpace(token))
@@ -47,11 +43,8 @@ public sealed class TicketValidator : IDisposable
if (!result.IsValid)
return null;
return result.Claims.TryGetValue("prefix", out var claim)
&& claim is string prefix
&& !string.IsNullOrEmpty(prefix)
? prefix
: null;
var prefix = result.ClaimsIdentity?.FindFirst("prefix")?.Value;
return string.IsNullOrEmpty(prefix) ? null : prefix;
}
public void Dispose() => _rsa.Dispose();