mirror of
https://github.com/bitwarden/server
synced 2025-12-20 02:03:46 +00:00
added identity cipher type
This commit is contained in:
@@ -30,6 +30,7 @@ namespace Bit.Core.Models.Api
|
||||
|
||||
public LoginType Login { get; set; }
|
||||
public CardType Card { get; set; }
|
||||
public IdentityType Identity { get; set; }
|
||||
public SecureNoteType SecureNote { get; set; }
|
||||
|
||||
public CipherDetails ToCipherDetails(Guid userId)
|
||||
@@ -65,12 +66,16 @@ namespace Bit.Core.Models.Api
|
||||
existingCipher.Data = JsonConvert.SerializeObject(new CardDataModel(this),
|
||||
new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
|
||||
break;
|
||||
case CipherType.Identity:
|
||||
existingCipher.Data = JsonConvert.SerializeObject(new IdentityDataModel(this),
|
||||
new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
|
||||
break;
|
||||
case CipherType.SecureNote:
|
||||
existingCipher.Data = JsonConvert.SerializeObject(new SecureNoteDataModel(this),
|
||||
new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentException("Unsupported " + nameof(Type) + ".");
|
||||
throw new ArgumentException("Unsupported type: " + nameof(Type) + ".");
|
||||
}
|
||||
|
||||
if((Attachments?.Count ?? 0) == 0)
|
||||
@@ -155,6 +160,55 @@ namespace Bit.Core.Models.Api
|
||||
public string Code { get; set; }
|
||||
}
|
||||
|
||||
public class IdentityType
|
||||
{
|
||||
[EncryptedString]
|
||||
[StringLength(1000)]
|
||||
public string Title { get; set; }
|
||||
[EncryptedString]
|
||||
[StringLength(1000)]
|
||||
public string FirstName { get; set; }
|
||||
[EncryptedString]
|
||||
[StringLength(1000)]
|
||||
public string MiddleName { get; set; }
|
||||
[EncryptedString]
|
||||
[StringLength(1000)]
|
||||
public string LastName { get; set; }
|
||||
[EncryptedString]
|
||||
[StringLength(1000)]
|
||||
public string Address1 { get; set; }
|
||||
[EncryptedString]
|
||||
[StringLength(1000)]
|
||||
public string Address2 { get; set; }
|
||||
[EncryptedString]
|
||||
[StringLength(1000)]
|
||||
public string Address3 { get; set; }
|
||||
[EncryptedString]
|
||||
[StringLength(1000)]
|
||||
public string City { get; set; }
|
||||
[EncryptedString]
|
||||
[StringLength(1000)]
|
||||
public string State { get; set; }
|
||||
[EncryptedString]
|
||||
[StringLength(1000)]
|
||||
public string PostalCode { get; set; }
|
||||
[EncryptedString]
|
||||
[StringLength(1000)]
|
||||
public string Country { get; set; }
|
||||
[EncryptedString]
|
||||
[StringLength(1000)]
|
||||
public string Company { get; set; }
|
||||
[EncryptedString]
|
||||
[StringLength(1000)]
|
||||
public string Email { get; set; }
|
||||
[EncryptedString]
|
||||
[StringLength(1000)]
|
||||
public string Phone { get; set; }
|
||||
[EncryptedString]
|
||||
[StringLength(1000)]
|
||||
public string SSN { get; set; }
|
||||
}
|
||||
|
||||
public class SecureNoteType
|
||||
{
|
||||
public Enums.SecureNoteType Type { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user