1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-21 12:05:42 +01:00
bitwarden-server/test
Shane Melton 7d40b38352
[PS-93] Distributed Ip rate limiting (#2060)
* Upgrade AspNetCoreRateLimiter and enable redis distributed cache for rate limiting.

- Upgrades AspNetCoreRateLimiter to 4.0.2, which required updating NewtonSoft.Json to 13.0.1.
- Replaces Microsoft.Extensions.Caching.Redis with Microsoft.Extensions.Caching.StackExchangeRedis as the original was deprecated and conflicted with the latest AspNetCoreRateLimiter
- Adds startup task to Program.cs for Api/Identity projects to support AspNetCoreRateLimiters breaking changes for seeding its stores.
- Adds a Redis connection string option to GlobalSettings

Signed-off-by: Shane Melton <smelton@bitwarden.com>

* Cleanup Redis distributed cache registration

- Add new AddDistributedCache service collection extension to add either a Memory or Redis distributed cache.
- Remove distributed cache registration from Identity service collection extension.
- Add IpRateLimitSeedStartupService.cs to run at application startup to seed the Ip rate limiting policies.

Signed-off-by: Shane Melton <smelton@bitwarden.com>

* Add caching configuration to SSO Startup.cs

Signed-off-by: Shane Melton <smelton@bitwarden.com>

* Add ProjectName as an instance name for Redis options

Signed-off-by: Shane Melton <smelton@bitwarden.com>

* Use distributed cache in CustomIpRateLimitMiddleware.cs

Signed-off-by: Shane Melton <smelton@bitwarden.com>

* Undo changes to Program.cs and launchSettings.json

* Move new service collection extensions to SharedWeb

* Upgrade Caching.StackExchangeRedis package to v6

* Cleanup and fix leftover merge conflicts

* Remove use of Newtonsoft.Json in distributed cache extensions

* Cleanup more formatting

* Fix formatting

* Fix startup issue caused by merge and fix integration test

Signed-off-by: Shane Melton <smelton@bitwarden.com>

* Linting fix

Signed-off-by: Shane Melton <smelton@bitwarden.com>
2022-07-19 11:58:32 -07:00
..
Api.Test [PS-93] Distributed Ip rate limiting (#2060) 2022-07-19 11:58:32 -07:00
Billing.Test [PS-93] Distributed Ip rate limiting (#2060) 2022-07-19 11:58:32 -07:00
Common [PS-93] Distributed Ip rate limiting (#2060) 2022-07-19 11:58:32 -07:00
Core.Test [PS-93] Distributed Ip rate limiting (#2060) 2022-07-19 11:58:32 -07:00
Icons.Test [PS-93] Distributed Ip rate limiting (#2060) 2022-07-19 11:58:32 -07:00
Identity.IntegrationTest [PS-93] Distributed Ip rate limiting (#2060) 2022-07-19 11:58:32 -07:00
Identity.Test [PS-93] Distributed Ip rate limiting (#2060) 2022-07-19 11:58:32 -07:00
IntegrationTestCommon [PS-93] Distributed Ip rate limiting (#2060) 2022-07-19 11:58:32 -07:00
bitwarden.tests.sln [BEEEP] Integration tests (#1945) 2022-05-20 15:24:59 -04:00
coverage.ps1 Implement code coverage tool (#1390) 2021-06-21 12:22:47 -05:00
coverage.sh Fix bug in TaxInfo (#1682) 2021-11-01 12:13:31 -04:00