1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-22 13:35:10 -05:00
bitwarden/src/Core/Models/Api/SendFileModel.cs
Matt Gibson e350daeeee
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
2021-02-24 13:03:16 -06:00

27 lines
695 B
C#

using Bit.Core.Models.Data;
using Bit.Core.Utilities;
using Bit.Core.Settings;
namespace Bit.Core.Models.Api
{
public class SendFileModel
{
public SendFileModel() { }
public SendFileModel(SendFileData data, GlobalSettings globalSettings)
{
Id = data.Id;
FileName = data.FileName;
Size = data.SizeString;
SizeName = CoreHelpers.ReadableBytesSize(data.Size);
}
public string Id { get; set; }
[EncryptedString]
[EncryptedStringLength(1000)]
public string FileName { get; set; }
public string Size { get; set; }
public string SizeName { get; set; }
}
}