1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-30 15:42:48 -05:00

Provide anonymous user context for unauthenticated requests using LaunchDarkly (#2819)

This commit is contained in:
Matt Bishop
2023-03-22 11:05:09 -04:00
committed by GitHub
parent d7b091d7d6
commit 39f884ddcc
2 changed files with 47 additions and 11 deletions

View File

@ -41,8 +41,23 @@ public class ConfigControllerTests : IClassFixture<ApiApplicationFactory>, IAsyn
}
[Fact]
public async Task GetConfigs()
public async Task GetConfigs_Unauthenticated()
{
_client.DefaultRequestHeaders.Authorization = null;
var response = await _client.GetAsync("/config");
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadFromJsonAsync<ConfigResponseModel>();
Assert.NotNull(result);
Assert.NotEmpty(result!.Version);
}
[Fact]
public async Task GetConfigs_Authenticated()
{
await LoginAsync();
var response = await _client.GetAsync("/config");
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadFromJsonAsync<ConfigResponseModel>();