mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 23:52:50 -05:00
Use sas token for send downloads (#1157)
* Remove Url from SendFileModel Url is now generated on the fly with limited lifetime. New model houses the download url generated * Create API endpoint for getting Send file download url * Generate limited-life Azure download urls * Lint fix
This commit is contained in:
@ -0,0 +1,10 @@
|
||||
namespace Bit.Core.Models.Api.Response
|
||||
{
|
||||
public class SendFileDownloadDataResponseModel : ResponseModel
|
||||
{
|
||||
public string Id { get; set; }
|
||||
public string Url { get; set; }
|
||||
|
||||
public SendFileDownloadDataResponseModel() : base("send-fileDownload") { }
|
||||
}
|
||||
}
|
@ -11,14 +11,12 @@ namespace Bit.Core.Models.Api
|
||||
public SendFileModel(SendFileData data, GlobalSettings globalSettings)
|
||||
{
|
||||
Id = data.Id;
|
||||
Url = $"{globalSettings.Send.BaseUrl}/{data.Id}";
|
||||
FileName = data.FileName;
|
||||
Size = data.SizeString;
|
||||
SizeName = CoreHelpers.ReadableBytesSize(data.Size);
|
||||
}
|
||||
|
||||
public string Id { get; set; }
|
||||
public string Url { get; set; }
|
||||
[EncryptedString]
|
||||
[EncryptedStringLength(1000)]
|
||||
public string FileName { get; set; }
|
||||
|
Reference in New Issue
Block a user