1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-16 10:38:17 -05:00

additional identity fields

This commit is contained in:
Kyle Spearrin 2017-10-09 11:23:20 -04:00
parent c7e7734dfc
commit b0fd99b218
4 changed files with 23 additions and 2 deletions

View File

@ -92,7 +92,7 @@ namespace Bit.Api.Controllers
IEnumerable<CipherDetails> ciphers; IEnumerable<CipherDetails> ciphers;
if(type.HasValue) if(type.HasValue)
{ {
ciphers = await _cipherRepository.GetManyByTypeAndUserIdAsync(Core.Enums.CipherType.Login, userId); ciphers = await _cipherRepository.GetManyByTypeAndUserIdAsync(type.Value, userId);
} }
else else
{ {

View File

@ -22,13 +22,16 @@ namespace Bit.Core.Models.Api
Address2 = cipher.Identity.Address2; Address2 = cipher.Identity.Address2;
Address3 = cipher.Identity.Address3; Address3 = cipher.Identity.Address3;
City = cipher.Identity.City; City = cipher.Identity.City;
State = cipher.Identity.City; State = cipher.Identity.State;
PostalCode = cipher.Identity.PostalCode; PostalCode = cipher.Identity.PostalCode;
Country = cipher.Identity.Country; Country = cipher.Identity.Country;
Company = cipher.Identity.Company; Company = cipher.Identity.Company;
Email = cipher.Identity.Email; Email = cipher.Identity.Email;
Phone = cipher.Identity.Phone; Phone = cipher.Identity.Phone;
SSN = cipher.Identity.SSN; SSN = cipher.Identity.SSN;
Username = cipher.Identity.Username;
PassportNumber = cipher.Identity.PassportNumber;
LicenseNumber = cipher.Identity.LicenseNumber;
} }
public IdentityDataModel(Cipher cipher) public IdentityDataModel(Cipher cipher)
@ -59,6 +62,9 @@ namespace Bit.Core.Models.Api
Email = data.Email; Email = data.Email;
Phone = data.Phone; Phone = data.Phone;
SSN = data.SSN; SSN = data.SSN;
Username = data.Username;
PassportNumber = data.PassportNumber;
LicenseNumber = data.LicenseNumber;
} }
public string Title { get; set; } public string Title { get; set; }
@ -76,5 +82,8 @@ namespace Bit.Core.Models.Api
public string Email { get; set; } public string Email { get; set; }
public string Phone { get; set; } public string Phone { get; set; }
public string SSN { get; set; } public string SSN { get; set; }
public string Username { get; set; }
public string PassportNumber { get; set; }
public string LicenseNumber { get; set; }
} }
} }

View File

@ -207,6 +207,15 @@ namespace Bit.Core.Models.Api
[EncryptedString] [EncryptedString]
[StringLength(1000)] [StringLength(1000)]
public string SSN { get; set; } public string SSN { get; set; }
[EncryptedString]
[StringLength(1000)]
public string Username { get; set; }
[EncryptedString]
[StringLength(1000)]
public string PassportNumber { get; set; }
[EncryptedString]
[StringLength(1000)]
public string LicenseNumber { get; set; }
} }
public class SecureNoteType public class SecureNoteType

View File

@ -34,6 +34,9 @@ namespace Bit.Core.Models.Api
case Enums.CipherType.Card: case Enums.CipherType.Card:
Data = new CardDataModel(cipher); Data = new CardDataModel(cipher);
break; break;
case Enums.CipherType.Identity:
Data = new IdentityDataModel(cipher);
break;
default: default:
throw new ArgumentException("Unsupported " + nameof(Type) + "."); throw new ArgumentException("Unsupported " + nameof(Type) + ".");
} }