1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-30 07:36:14 -05:00

Require valid Send-Id header for access requests (#1381)

* Require valid Send-Id header for access requests

* Require valid Send-Id header for Send file access

* Add ICurrentContext to Send controller test
This commit is contained in:
Thomas Rittson
2021-06-08 14:34:36 -07:00
committed by GitHub
parent 30611bd78b
commit e2ff13aa14
2 changed files with 24 additions and 2 deletions

View File

@ -1,5 +1,6 @@
using AutoFixture.Xunit2;
using Bit.Api.Controllers;
using Bit.Core.Context;
using Bit.Core.Enums;
using Bit.Core.Models.Api;
using Bit.Core.Models.Table;
@ -28,6 +29,7 @@ namespace Bit.Api.Test.Controllers
private readonly ISendService _sendService;
private readonly ISendFileStorageService _sendFileStorageService;
private readonly ILogger<SendsController> _logger;
private readonly ICurrentContext _currentContext;
public SendsControllerTests()
{
@ -37,6 +39,7 @@ namespace Bit.Api.Test.Controllers
_sendFileStorageService = Substitute.For<ISendFileStorageService>();
_globalSettings = new GlobalSettings();
_logger = Substitute.For<ILogger<SendsController>>();
_currentContext = Substitute.For<ICurrentContext>();
_sut = new SendsController(
_sendRepository,
@ -44,7 +47,8 @@ namespace Bit.Api.Test.Controllers
_sendService,
_sendFileStorageService,
_logger,
_globalSettings
_globalSettings,
_currentContext
);
}