Desk: the fork desk's Bifrost half (#40)
This commit is contained in:
parent
12a153f66f
commit
7e9ba5796b
28 changed files with 20775 additions and 6 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue