1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-26 12:55:17 +01:00

[EC-529] fix: missing constructor DI assignment (#2258)

* [EC-529] fix: missing constructor DI assignment

* [EC-239] fix: move logging to CiphersController
This commit is contained in:
Andreas Coroiu 2022-09-09 13:20:59 +02:00 committed by GitHub
parent 70f16bc069
commit e2b6f2a5bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 7 deletions

View File

@ -222,6 +222,12 @@ public class CiphersController : Controller
var responses = orgCiphers.Select(c => new CipherMiniDetailsResponseModel(c, _globalSettings, var responses = orgCiphers.Select(c => new CipherMiniDetailsResponseModel(c, _globalSettings,
collectionCiphersGroupDict, c.OrganizationUseTotp)); collectionCiphersGroupDict, c.OrganizationUseTotp));
var providerId = await _currentContext.ProviderIdForOrg(orgIdGuid);
if (providerId.HasValue)
{
await _providerService.LogProviderAccessToOrganizationAsync(orgIdGuid);
}
return new ListResponseModel<CipherMiniDetailsResponseModel>(responses); return new ListResponseModel<CipherMiniDetailsResponseModel>(responses);
} }

View File

@ -31,7 +31,6 @@ public class CipherService : ICipherService
private const long _fileSizeLeeway = 1024L * 1024L; // 1MB private const long _fileSizeLeeway = 1024L * 1024L; // 1MB
private readonly IReferenceEventService _referenceEventService; private readonly IReferenceEventService _referenceEventService;
private readonly ICurrentContext _currentContext; private readonly ICurrentContext _currentContext;
private readonly IProviderService _providerService;
public CipherService( public CipherService(
ICipherRepository cipherRepository, ICipherRepository cipherRepository,
@ -876,12 +875,6 @@ public class CipherService : ICipherService
.Where(c => orgCipherIds.Contains(c.CipherId)) .Where(c => orgCipherIds.Contains(c.CipherId))
.GroupBy(c => c.CipherId).ToDictionary(s => s.Key); .GroupBy(c => c.CipherId).ToDictionary(s => s.Key);
var providerId = await _currentContext.ProviderIdForOrg(organizationId);
if (providerId.HasValue)
{
await _providerService.LogProviderAccessToOrganizationAsync(organizationId);
}
return (orgCiphers, collectionCiphersGroupDict); return (orgCiphers, collectionCiphersGroupDict);
} }