1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-25 12:45:18 +01:00

SM-609: Block imports where any secret is associated with more than one project (#2789)

This commit is contained in:
Colton Hurst 2023-03-09 08:15:22 -05:00 committed by GitHub
parent b3a2141ed3
commit a18ab213e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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());
}
}