Merge remote-tracking branch 'origin/main' into feature/web-zavady
This commit is contained in:
commit
1550c0343b
45 files changed
+1516
-169
No files matched your search
@@ -37,8 +37,12 @@ static void ConfigureApiClient(IServiceProvider services, HttpClient http)
|
||||
|
||||
builder.Services.AddHttpContextAccessor();
|
||||
builder.Services.AddTransient<BearerTokenHandler>();
|
||||
builder.Services.AddHttpClient<AuthApiClient>(ConfigureApiClient);
|
||||
builder.Services.AddHttpClient<HelpdeskApiClient>(ConfigureApiClient).AddHttpMessageHandler<BearerTokenHandler>();
|
||||
builder.Services.AddTransient<ForwardedClientIpHandler>();
|
||||
builder.Services.AddHttpClient<AuthApiClient>(ConfigureApiClient)
|
||||
.AddHttpMessageHandler<ForwardedClientIpHandler>();
|
||||
builder.Services.AddHttpClient<HelpdeskApiClient>(ConfigureApiClient)
|
||||
.AddHttpMessageHandler<ForwardedClientIpHandler>()
|
||||
.AddHttpMessageHandler<BearerTokenHandler>();
|
||||
|
||||
// Přihlášení: tokeny API v šifrované HttpOnly cookie, obnova access tokenu při ověření cookie.
|
||||
builder.Services.AddSingleton(TimeProvider.System);
|
||||
@@ -111,6 +115,13 @@ app.UseRouting();
|
||||
app.UseAuthentication();
|
||||
app.UseAuthorization();
|
||||
|
||||
app.MapSwaggerUI("swagger", options =>
|
||||
{
|
||||
options.SwaggerEndpoint("v1/swagger.json", "Helpdesk API v1");
|
||||
options.DocumentTitle = "Helpdesk API";
|
||||
options.CacheLifetime = null;
|
||||
}).RequireAuthorization(policy => policy.RequireRole(UserRoles.Admin));
|
||||
|
||||
app.MapStaticAssets();
|
||||
app.MapControllerRoute("default", "{controller=Home}/{action=Index}/{id?}").WithStaticAssets();
|
||||
|
||||
|
||||
Reference in new issue
Block a user