- Move login and refresh endpoints under a unified /auth route group
- Relocate institution connection logic from /accounts to /institutions
- Implement GET /institutions/{id}/available to fetch real-time Plaid
accounts
- Introduce HttpRequestBuilder utility to streamline integration testing
- Enhance PlaidService with GetAccountsAsync to support account fetching
- Clean up global usings and project structure for better domain
isolation
39 lines
988 B
C#
39 lines
988 B
C#
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
builder.Services.AddValidation();
|
|
builder.Services.AddProblemDetails();
|
|
|
|
builder.Services.AddInfrastructure();
|
|
|
|
builder.Services.AddAuthentication(static o =>
|
|
{
|
|
o.DefaultAuthenticateScheme = Schemes.Default;
|
|
o.DefaultChallengeScheme = Schemes.Default;
|
|
})
|
|
.AddJwtBearer(Schemes.Default)
|
|
.AddJwtBearer(Schemes.AllowExpiredTokens);
|
|
|
|
builder.Services.AddAuthorizationBuilder()
|
|
.AddPolicy(Schemes.Default, static policy =>
|
|
{
|
|
policy.AuthenticationSchemes = [Schemes.Default];
|
|
policy.RequireAuthenticatedUser();
|
|
})
|
|
.AddPolicy(Schemes.AllowExpiredTokens, static policy =>
|
|
{
|
|
policy.AuthenticationSchemes = [Schemes.AllowExpiredTokens];
|
|
policy.RequireAuthenticatedUser();
|
|
});
|
|
|
|
var app = builder.Build();
|
|
|
|
app.UseHttpsRedirection();
|
|
app.UseAuthentication();
|
|
app.UseAuthorization();
|
|
app.UseStatusCodePages();
|
|
|
|
app.MapAuthEndpoints();
|
|
app.MapAccountsEndpoints();
|
|
app.MapInstitutionsEndpoints();
|
|
|
|
app.Run(); |