mirror of
https://github.com/bitwarden/server.git
synced 2025-12-13 02:58:10 -06:00
* [PM-131] Remove fingerprint (#2759) * [PM-107][PM-131] Remove fingerprint property from auth request * [PM-107][PM-131] Remove fingerprint property from comparer * [PM-132] Drop fingerprint phrase (#2803) * [PM-132] Added migrations to remove fingerprint phrase from db * [PM-132] Remove fp from stored procedures
42 lines
1.5 KiB
C#
42 lines
1.5 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
using System.Reflection;
|
|
using Bit.Core.Entities;
|
|
using Bit.Core.Models.Api;
|
|
|
|
namespace Bit.Api.Models.Response;
|
|
|
|
public class AuthRequestResponseModel : ResponseModel
|
|
{
|
|
public AuthRequestResponseModel(AuthRequest authRequest, string vaultUri, string obj = "auth-request")
|
|
: base(obj)
|
|
{
|
|
if (authRequest == null)
|
|
{
|
|
throw new ArgumentNullException(nameof(authRequest));
|
|
}
|
|
|
|
Id = authRequest.Id.ToString();
|
|
PublicKey = authRequest.PublicKey;
|
|
RequestDeviceType = authRequest.RequestDeviceType.GetType().GetMember(authRequest.RequestDeviceType.ToString())
|
|
.FirstOrDefault()?.GetCustomAttribute<DisplayAttribute>()?.GetName();
|
|
RequestIpAddress = authRequest.RequestIpAddress;
|
|
Key = authRequest.Key;
|
|
MasterPasswordHash = authRequest.MasterPasswordHash;
|
|
CreationDate = authRequest.CreationDate;
|
|
RequestApproved = authRequest.Approved ?? false;
|
|
Origin = new Uri(vaultUri).Host;
|
|
ResponseDate = authRequest.ResponseDate;
|
|
}
|
|
|
|
public string Id { get; set; }
|
|
public string PublicKey { get; set; }
|
|
public string RequestDeviceType { get; set; }
|
|
public string RequestIpAddress { get; set; }
|
|
public string Key { get; set; }
|
|
public string MasterPasswordHash { get; set; }
|
|
public DateTime CreationDate { get; set; }
|
|
public DateTime? ResponseDate { get; set; }
|
|
public bool RequestApproved { get; set; }
|
|
public string Origin { get; set; }
|
|
}
|