1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-30 23:52:50 -05:00

Issue 1362: Proposed change for controllers parsing string GUIDs. (#1887)

Co-authored-by: alexanderhlee <alexanderhlee@gmail.com>
This commit is contained in:
AHL
2022-04-05 04:08:37 -04:00
committed by GitHub
parent 9a1a7543c5
commit af152811af
3 changed files with 31 additions and 31 deletions

View File

@ -25,6 +25,6 @@ namespace Bit.Core.Services
Task SendNotificationsAsync();
Task HandleTimedOutRequestsAsync();
Task<EmergencyAccessViewData> ViewAsync(Guid id, User user);
Task<AttachmentResponseData> GetAttachmentDownloadAsync(Guid id, string cipherId, string attachmentId, User user);
Task<AttachmentResponseData> GetAttachmentDownloadAsync(Guid id, Guid cipherId, string attachmentId, User user);
}
}

View File

@ -392,7 +392,7 @@ namespace Bit.Core.Services
};
}
public async Task<AttachmentResponseData> GetAttachmentDownloadAsync(Guid id, string cipherId, string attachmentId, User requestingUser)
public async Task<AttachmentResponseData> GetAttachmentDownloadAsync(Guid id, Guid cipherId, string attachmentId, User requestingUser)
{
var emergencyAccess = await _emergencyAccessRepository.GetByIdAsync(id);
@ -401,7 +401,7 @@ namespace Bit.Core.Services
throw new BadRequestException("Emergency Access not valid.");
}
var cipher = await _cipherRepository.GetByIdAsync(new Guid(cipherId), emergencyAccess.GrantorId);
var cipher = await _cipherRepository.GetByIdAsync(cipherId, emergencyAccess.GrantorId);
return await _cipherService.GetAttachmentDownloadDataAsync(cipher, attachmentId);
}