backend + web: Protect Swagger UI behind admin login
This commit is contained in:
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);
|
||||
|
||||
Reference in new issue
Block a user