mirror of
https://github.com/bitwarden/server
synced 2026-01-05 01:53:17 +00:00
Merge branch 'master' into feature/flexible-collections
This commit is contained in:
@@ -112,7 +112,7 @@ public class CollectionsController : Controller
|
||||
[HttpGet("")]
|
||||
public async Task<ListResponseModel<CollectionResponseModel>> Get(Guid orgId)
|
||||
{
|
||||
IEnumerable<Collection> orgCollections = await _collectionService.GetOrganizationCollections(orgId);
|
||||
IEnumerable<Collection> orgCollections = await _collectionService.GetOrganizationCollectionsAsync(orgId);
|
||||
|
||||
var responses = orgCollections.Select(c => new CollectionResponseModel(c));
|
||||
return new ListResponseModel<CollectionResponseModel>(responses);
|
||||
@@ -209,7 +209,7 @@ public class CollectionsController : Controller
|
||||
throw new NotFoundException();
|
||||
}
|
||||
|
||||
var userCollections = await _collectionService.GetOrganizationCollections(orgId);
|
||||
var userCollections = await _collectionService.GetOrganizationCollectionsAsync(orgId);
|
||||
var filteredCollections = userCollections.Where(c => collectionIds.Contains(c.Id) && c.OrganizationId == orgId);
|
||||
|
||||
if (!filteredCollections.Any())
|
||||
|
||||
@@ -40,7 +40,7 @@ public class OrganizationExportController : Controller
|
||||
{
|
||||
var userId = _userService.GetProperUserId(User).Value;
|
||||
|
||||
IEnumerable<Collection> orgCollections = await _collectionService.GetOrganizationCollections(organizationId);
|
||||
IEnumerable<Collection> orgCollections = await _collectionService.GetOrganizationCollectionsAsync(organizationId);
|
||||
(IEnumerable<CipherOrganizationDetails> orgCiphers, Dictionary<Guid, IGrouping<Guid, CollectionCipher>> collectionCiphersGroupDict) = await _cipherService.GetOrganizationCiphers(userId, organizationId);
|
||||
|
||||
if (_currentContext.ClientVersion == null || _currentContext.ClientVersion >= new Version("2023.1.0"))
|
||||
|
||||
@@ -8,6 +8,7 @@ public class ProjectCreateRequestModel
|
||||
{
|
||||
[Required]
|
||||
[EncryptedString]
|
||||
[EncryptedStringLength(1000)]
|
||||
public string Name { get; set; }
|
||||
|
||||
public Project ToProject(Guid organizationId)
|
||||
|
||||
@@ -8,6 +8,7 @@ public class ProjectUpdateRequestModel
|
||||
{
|
||||
[Required]
|
||||
[EncryptedString]
|
||||
[EncryptedStringLength(1000)]
|
||||
public string Name { get; set; }
|
||||
|
||||
public Project ToProject(Guid id)
|
||||
|
||||
@@ -8,14 +8,17 @@ public class SecretCreateRequestModel : IValidatableObject
|
||||
{
|
||||
[Required]
|
||||
[EncryptedString]
|
||||
[EncryptedStringLength(1000)]
|
||||
public string Key { get; set; }
|
||||
|
||||
[Required]
|
||||
[EncryptedString]
|
||||
[EncryptedStringLength(5000)]
|
||||
public string Value { get; set; }
|
||||
|
||||
[Required]
|
||||
[EncryptedString]
|
||||
[EncryptedStringLength(10000)]
|
||||
public string Note { get; set; }
|
||||
|
||||
public Guid[] ProjectIds { get; set; }
|
||||
|
||||
@@ -8,14 +8,17 @@ public class SecretUpdateRequestModel : IValidatableObject
|
||||
{
|
||||
[Required]
|
||||
[EncryptedString]
|
||||
[EncryptedStringLength(1000)]
|
||||
public string Key { get; set; }
|
||||
|
||||
[Required]
|
||||
[EncryptedString]
|
||||
[EncryptedStringLength(5000)]
|
||||
public string Value { get; set; }
|
||||
|
||||
[Required]
|
||||
[EncryptedString]
|
||||
[EncryptedStringLength(10000)]
|
||||
public string Note { get; set; }
|
||||
|
||||
public Guid[] ProjectIds { get; set; }
|
||||
|
||||
@@ -8,6 +8,7 @@ public class ServiceAccountUpdateRequestModel
|
||||
{
|
||||
[Required]
|
||||
[EncryptedString]
|
||||
[EncryptedStringLength(1000)]
|
||||
public string Name { get; set; }
|
||||
|
||||
public ServiceAccount ToServiceAccount(Guid id)
|
||||
|
||||
@@ -8,6 +8,7 @@ public class ServiceAccountCreateRequestModel
|
||||
{
|
||||
[Required]
|
||||
[EncryptedString]
|
||||
[EncryptedStringLength(1000)]
|
||||
public string Name { get; set; }
|
||||
|
||||
public ServiceAccount ToServiceAccount(Guid organizationId)
|
||||
|
||||
Reference in New Issue
Block a user