feat(developers): add developer program signup with SilverDESK integration
Add developer application page with form submission that creates tickets in SilverDESK. Includes provisioning service scaffolding for Mattermost, Mailcow, and Gitea account creation. Fixes API key header casing (X-API-Key) and ticket payload to match SilverDESK's CreateTicketDto contract. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
using SilverLabs.Website.Components;
|
||||
using SilverLabs.Website.Endpoints;
|
||||
using SilverLabs.Website.Services;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
@@ -6,6 +8,42 @@ var builder = WebApplication.CreateBuilder(args);
|
||||
builder.Services.AddRazorComponents()
|
||||
.AddInteractiveServerComponents();
|
||||
|
||||
// HttpClient for SilverDESK (used by DeveloperApplicationService directly)
|
||||
builder.Services.AddHttpClient<DeveloperApplicationService>(client =>
|
||||
{
|
||||
client.BaseAddress = new Uri(builder.Configuration["SilverDesk:BaseUrl"] ?? "https://silverdesk.silverlabs.uk");
|
||||
var apiKey = builder.Configuration["SilverDesk:ApiKey"];
|
||||
if (!string.IsNullOrEmpty(apiKey))
|
||||
client.DefaultRequestHeaders.Add("X-API-Key", apiKey);
|
||||
});
|
||||
|
||||
// Named HttpClients for provisioning
|
||||
builder.Services.AddHttpClient("SilverDesk", client =>
|
||||
{
|
||||
client.BaseAddress = new Uri(builder.Configuration["SilverDesk:BaseUrl"] ?? "https://silverdesk.silverlabs.uk");
|
||||
var apiKey = builder.Configuration["SilverDesk:ApiKey"];
|
||||
if (!string.IsNullOrEmpty(apiKey))
|
||||
client.DefaultRequestHeaders.Add("X-API-Key", apiKey);
|
||||
});
|
||||
|
||||
builder.Services.AddHttpClient("Mattermost", client =>
|
||||
{
|
||||
client.BaseAddress = new Uri(builder.Configuration["Mattermost:BaseUrl"] ?? "https://ops.silverlined.uk");
|
||||
var token = builder.Configuration["Mattermost:ApiToken"];
|
||||
if (!string.IsNullOrEmpty(token))
|
||||
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {token}");
|
||||
});
|
||||
|
||||
builder.Services.AddHttpClient("Mailcow", client =>
|
||||
{
|
||||
client.BaseAddress = new Uri(builder.Configuration["Mailcow:BaseUrl"] ?? "https://mail.silverlined.uk");
|
||||
var apiKey = builder.Configuration["Mailcow:ApiKey"];
|
||||
if (!string.IsNullOrEmpty(apiKey))
|
||||
client.DefaultRequestHeaders.Add("X-API-Key", apiKey);
|
||||
});
|
||||
|
||||
builder.Services.AddScoped<ProvisioningService>();
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
// Configure the HTTP request pipeline.
|
||||
@@ -24,4 +62,6 @@ app.MapStaticAssets();
|
||||
app.MapRazorComponents<App>()
|
||||
.AddInteractiveServerRenderMode();
|
||||
|
||||
app.MapDeveloperEndpoints();
|
||||
|
||||
app.Run();
|
||||
|
||||
Reference in New Issue
Block a user