OIDC chat tier: honest refusal text for a missing account, comments name the real doors

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Heimdall 2026-11-11 08:09:50 +00:00
commit 65823b3d65
2 changed files with 9 additions and 4 deletions

View file

@ -50,8 +50,13 @@ public static class OidcEndpoints
var actor = await actors.GetAsync(http.RequestAborted);
// Chat tier: any account that is not suspended may sign in to chat. Membership is neither required nor written;
// every member or governance surface keeps asking for Active itself (ActiveMemberIdAsync).
if (actor.UserAccount is null || actor.Membership?.Status == MembershipStatus.Suspended)
// every member or governance surface keeps asking for Active itself (the Active-member policy, IsActiveMember, ActiveMemberIdAsync).
if (actor.UserAccount is null)
{
return Deny(Errors.AccessDenied, NoIdentityDescription);
}
if (actor.Membership?.Status == MembershipStatus.Suspended)
{
return Deny(Errors.AccessDenied, SuspendedDescription);
}
@ -145,7 +150,7 @@ public static class OidcEndpoints
return account is not null && account.Membership?.Status != MembershipStatus.Suspended;
}
/// <summary>The account id of the subject when it is an Active member now, else null. The only door to member surfaces (the fork desk); a chat-tier token does not pass it. Re-read on every call.</summary>
/// <summary>The account id of the subject when it is an Active member now, else null. The door to the fork desk (cookie surfaces check IsActiveMember); a chat-tier token does not pass it. Re-read on every call.</summary>
internal static async Task<Guid?> ActiveMemberIdAsync(BifrostDbContext db, string? subject, CancellationToken cancellationToken)
{
if (!Guid.TryParse(subject, out var accountId))

View file

@ -12,7 +12,7 @@ namespace Bifrost.Web.Features.Oidc;
/// <summary>
/// Ends the chat sessions of a subject who is no longer allowed to chat (suspended, or the account gone). Each tick it lists the subjects holding valid
/// authorizations of the configured client; for each one the shared active-member reading refuses, it POSTs one signed
/// authorizations of the configured client; for each one the shared chat-eligibility reading refuses, it POSTs one signed
/// OIDC back-channel logout token to MAS and, only after a 2xx, revokes that subject's authorizations. The
/// authorizations table is the queue: nothing is stored, so a restart, a MAS outage or a later-set URI resumes from it.
/// Per-subject backoff lives in memory only. One subject's unexpected exception is logged and skipped, never aborting the