backend + web: Protect Swagger UI behind admin login

This commit is contained in:
GonnaHetzMe committed 2026-12-03 00:49:36 +01:00
1 parent d8de714481
commit eddf5837eb
16 files changed
+158 -28

No files matched your search

@@ -5,6 +5,13 @@ namespace Helpdesk.Web.Api;
/// <summary>Endpointy API pro přihlášeného uživatele; access token přidává <see cref="BearerTokenHandler"/>.</summary>
public sealed class HelpdeskApiClient(HttpClient http)
{
public async Task<string> GetOpenApiAsync(CancellationToken ct)
{
using var response = await http.GetAsync("api/v1/admin/openapi/v1.json", ct);
await ApiResponse.EnsureSuccessAsync(response, ct);
return await response.Content.ReadAsStringAsync(ct);
}
public async Task<UserDto> GetMeAsync(CancellationToken ct)
{
using var response = await http.GetAsync("api/v1/users/me", ct);