Files
Luna/Luna.Core/Program.cs
T
darman ec78c0cdf5 Add user identity system with channel pairing and web /link command
Introduce Luna.Identity project with user identity service, pairing code
generation, and channel linking. Channels (Telegram, CLI) now verify link
status before routing messages and prompt users to pair via the web
interface. WebChannel handles /link <channel-type> <code> commands to
complete the pairing flow.

Fix inverted expiration check in IsPairingCodeExpired that caused codes
to be treated as expired immediately after creation.
2026-04-04 16:09:10 +02:00

53 lines
1.2 KiB
C#

using System.Text.Json;
using System.Text.Json.Serialization;
using Luna.Agents.Extensions;
using Luna.Channels.Extensions;
using Luna.Configuration.Extensions;
using Luna.Core.Abstractions;
using Luna.Core.Hubs;
using Luna.Core.Services.Extensions;
using Luna.Core.Tools.Extensions;
using Luna.Identity.Extensions;
using Luna.Memory.Extensions;
using Luna.Providers.Extensions;
var builder = WebApplication.CreateBuilder(args);
builder.Configuration
.AddLunaConfiguration();
builder.Services
.AddOpenApi()
.AddProviders()
.AddAgents()
.AddTools()
.AddMemoryStore()
.AddUserIdentity()
.AddSessionManager()
.AddChannels();
builder.Services.AddSignalR()
.AddJsonProtocol(options =>
{
options.PayloadSerializerOptions.Converters.Add(
new JsonStringEnumConverter(JsonNamingPolicy.CamelCase));
});
builder.Services.AddTransient<IChatHubContext, ChatHubContext>();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.MapOpenApi();
}
app.MapHub<ChatHub>("/chat");
app.Run();
// Expose Program type for WebApplicationFactory in integration tests
namespace Luna.Core
{
public partial class Program { }
}