mirror of
https://github.com/bitwarden/server.git
synced 2025-05-25 13:24:50 -05:00

* Start switch to System.Text.Json * Work on switching to System.Text.Json * Main work on STJ refactor * Fix build errors * Run formatting * Delete unused file * Use legacy for two factor providers * Run formatter * Add TokenProviderTests * Run formatting * Fix merge issues * Switch to use JsonSerializer * Address PR feedback * Fix formatting * Ran formatter * Switch to async * Ensure Enums are serialized as strings * Fix formatting * Enqueue single items as arrays * Remove CreateAsync method on AzureQueueService
38 lines
1.2 KiB
C#
38 lines
1.2 KiB
C#
using System;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace Bit.Core.Models.Data
|
|
{
|
|
public class CipherAttachment
|
|
{
|
|
public Guid Id { get; set; }
|
|
public Guid? UserId { get; set; }
|
|
public Guid? OrganizationId { get; set; }
|
|
public string AttachmentId { get; set; }
|
|
public string AttachmentData { get; set; }
|
|
|
|
public class MetaData
|
|
{
|
|
private long _size;
|
|
|
|
// We serialize Size as a string since JSON (or Javascript) doesn't support full precision for long numbers
|
|
[JsonNumberHandling(JsonNumberHandling.AllowReadingFromString | JsonNumberHandling.WriteAsString)]
|
|
public long Size
|
|
{
|
|
get { return _size; }
|
|
set { _size = value; }
|
|
}
|
|
|
|
public string FileName { get; set; }
|
|
public string Key { get; set; }
|
|
|
|
public string ContainerName { get; set; } = "attachments";
|
|
public bool Validated { get; set; } = true;
|
|
|
|
// This is stored alongside metadata as an identifier. It does not need repeating in serialization
|
|
[JsonIgnore]
|
|
public string AttachmentId { get; set; }
|
|
}
|
|
}
|
|
}
|