1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-26 12:55:17 +01: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;
if(type.HasValue)
{
ciphers = await _cipherRepository.GetManyByTypeAndUserIdAsync(Core.Enums.CipherType.Login, userId);
ciphers = await _cipherRepository.GetManyByTypeAndUserIdAsync(type.Value, userId);
}
else
{

View File

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

View File

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