mirror of
https://github.com/bitwarden/server
synced 2025-12-10 21:33:41 +00:00
**feat**: create `SendGrantValidator` and initial `SendPasswordValidator` for Send access grants **feat**: add feature flag to toggle Send grant validation logic **feat**: add Send client to Identity and update `ApiClient` to generic `Client` **feat**: register Send services in DI pipeline **feat**: add claims management support to `ProfileService` **feat**: distinguish between invalid grant and invalid request in `SendAccessGrantValidator` **fix**: update parsing of `send_id` from request **fix**: add early return when feature flag is disabled **fix**: rename and organize Send access scope and grant type **fix**: dotnet format **test**: add unit and integration tests for `SendGrantValidator` **test**: update OpenID configuration and API resource claims **doc**: move documentation to interfaces and update inline comments **chore**: add TODO for future support of `CustomGrantTypes`
28 lines
715 B
C#
28 lines
715 B
C#
using BenchmarkDotNet.Attributes;
|
|
using Bit.Core.Settings;
|
|
using Bit.Identity.IdentityServer;
|
|
using Duende.IdentityServer.Models;
|
|
|
|
namespace Bit.MicroBenchmarks.Identity.IdentityServer;
|
|
|
|
public class StaticClientStoreTests
|
|
{
|
|
private readonly StaticClientStore _store;
|
|
|
|
public StaticClientStoreTests()
|
|
{
|
|
_store = new StaticClientStore(new GlobalSettings());
|
|
}
|
|
|
|
[Params("mobile", "connector", "invalid", "a_much_longer_invalid_value_that_i_am_making_up", "WEB", "")]
|
|
public string ClientId { get; set; } = null!;
|
|
|
|
[Benchmark]
|
|
public Client? TryGetValue()
|
|
{
|
|
return _store.Clients.TryGetValue(ClientId, out var client)
|
|
? client
|
|
: null;
|
|
}
|
|
}
|