mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 15:42:48 -05:00
PM-16085 - Increase import limitations (#5275)
* PM-16261 move ImportCiphersAsync to the tools team and create services using CQRS design pattern * PM-16261 fix renaming methods and add unit tests for succes and bad request exception * PM-16261 clean up old code from test * make import limits configurable via appsettings * PM-16085 fix issue with appSettings converting to globalSettings for new cipher import limits
This commit is contained in:
@ -64,8 +64,9 @@ public class ImportCiphersController : Controller
|
||||
[FromBody] ImportOrganizationCiphersRequestModel model)
|
||||
{
|
||||
if (!_globalSettings.SelfHosted &&
|
||||
(model.Ciphers.Count() > 7000 || model.CollectionRelationships.Count() > 14000 ||
|
||||
model.Collections.Count() > 2000))
|
||||
(model.Ciphers.Count() > _globalSettings.ImportCiphersLimitation.CiphersLimit ||
|
||||
model.CollectionRelationships.Count() > _globalSettings.ImportCiphersLimitation.CollectionRelationshipsLimit ||
|
||||
model.Collections.Count() > _globalSettings.ImportCiphersLimitation.CollectionsLimit))
|
||||
{
|
||||
throw new BadRequestException("You cannot import this much data at once.");
|
||||
}
|
||||
|
Reference in New Issue
Block a user