mirror of
https://github.com/bitwarden/server.git
synced 2024-12-25 17:27:45 +01:00
SM-609: Block imports where any secret is associated with more than one project (#2789)
This commit is contained in:
parent
b3a2141ed3
commit
a18ab213e4
@ -61,6 +61,11 @@ public class SecretsManagerPortingController : Controller
|
||||
throw new BadRequestException("You cannot import this much data at once, the limit is 1000 projects and 6000 secrets.");
|
||||
}
|
||||
|
||||
if (importRequest.Secrets.Any(s => s.ProjectIds.Count() > 1))
|
||||
{
|
||||
throw new BadRequestException("A secret can only be in one project at a time.");
|
||||
}
|
||||
|
||||
await _importCommand.ImportAsync(organizationId, importRequest.ToSMImport());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user