1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-24 12:35:25 +01:00
bitwarden-server/src/Identity
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
..
Controllers Turn On ImplicitUsings (#2079) 2022-06-29 19:46:41 -04:00
Models sso integrations (#822) 2020-07-16 08:01:39 -04:00
Properties Fix swapped launch settings default (#1925) 2022-03-25 16:11:01 -04:00
Utilities Turn On ImplicitUsings (#2079) 2022-06-29 19:46:41 -04:00
Views/Shared sso integrations (#822) 2020-07-16 08:01:39 -04:00
.dockerignore Update output directory for dotnet builds (#1358) 2021-05-27 12:16:12 -04:00
appsettings.Development.json Log swallowed HttpRequestExceptions (#1866) 2022-04-07 12:37:11 +02:00
appsettings.json Fix Stripe object lock timeouts (#1735) 2021-11-29 10:01:51 +10:00
appsettings.Production.json [EC-261] SCIM (#2105) 2022-07-14 15:58:48 -04:00
appsettings.QA.json [EC-261] SCIM (#2105) 2022-07-14 15:58:48 -04:00
appsettings.SelfHosted.json [EC-261] SCIM (#2105) 2022-07-14 15:58:48 -04:00
build.ps1 local build scripts 2020-03-06 22:05:50 -05:00
build.sh revamping the build scripts (#1620) 2021-10-08 09:53:56 -07:00
Dockerfile [PS-40] Upgrade to .NET 6 (#2056) 2022-06-24 10:39:34 -04:00
entrypoint.sh dev null failure output from ca-cert copy 2018-07-20 11:46:55 -04:00
Identity.csproj Add Swagger generation for Identity (#2058) 2022-07-04 12:05:46 +02:00
packages.lock.json [PS-93] Distributed Ip rate limiting (#2060) 2022-07-19 11:58:32 -07:00
Program.cs Turn On ImplicitUsings (#2079) 2022-06-29 19:46:41 -04:00
Startup.cs [PS-93] Distributed Ip rate limiting (#2060) 2022-07-19 11:58:32 -07:00