Desk: the fork desk's Bifrost half (#40)

This commit is contained in:
Heimdall 2026-11-11 01:02:36 +00:00
commit 7e9ba5796b
28 changed files with 20775 additions and 6 deletions

View file

@ -7,6 +7,7 @@ using Bifrost.Web.Data;
using Bifrost.Web.Domain;
using Bifrost.Web.Features.Bridge;
using Bifrost.Web.Features.ConceptVotes;
using Bifrost.Web.Features.Desk;
using Bifrost.Web.Features.GitHub;
using Bifrost.Web.Features.Heimdall;
using Bifrost.Web.Features.Membership;
@ -76,6 +77,10 @@ builder.Services
.AddOptions<ConceptVoteOptions>()
.BindConfiguration(ConceptVoteOptions.SectionName);
builder.Services
.AddOptions<DeskOptions>()
.BindConfiguration(DeskOptions.SectionName);
builder.Services.AddAntiforgery(options =>
{
options.Cookie.Name = BifrostCookies.Antiforgery;
@ -252,6 +257,13 @@ if (oidcOptions is not null)
builder.Services.AddBifrostOidc(oidcOptions);
}
// The desk is mapped only when the Desk section exists, and a configured desk needs its credential and door ports.
var deskConfigured = builder.Configuration.GetSection(DeskOptions.SectionName).Exists();
if (deskConfigured)
{
builder.Services.AddBifrostDesk();
}
var app = builder.Build();
var appJsonSerializerOptions = CreateAppJsonSerializerOptions();
@ -300,6 +312,11 @@ if (oidcOptions is not null)
app.MapBifrostOidc();
}
if (deskConfigured)
{
app.MapDesk();
}
app.MapPost("/github/webhooks", async (
HttpRequest request,
GitHubWebhookService gitHubWebhookService,