mirror of
https://github.com/bitwarden/server.git
synced 2025-04-24 22:32:22 -05: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.2 KiB
C#
42 lines
1.2 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
using Bit.Core.Utilities;
|
|
|
|
namespace Bit.Core.Entities;
|
|
|
|
public class AuthRequest : ITableObject<Guid>
|
|
{
|
|
public Guid Id { get; set; }
|
|
public Guid UserId { get; set; }
|
|
public Enums.AuthRequestType Type { get; set; }
|
|
[MaxLength(50)]
|
|
public string RequestDeviceIdentifier { get; set; }
|
|
public Enums.DeviceType RequestDeviceType { get; set; }
|
|
[MaxLength(50)]
|
|
public string RequestIpAddress { get; set; }
|
|
public Guid? ResponseDeviceId { get; set; }
|
|
[MaxLength(25)]
|
|
public string AccessCode { get; set; }
|
|
public string PublicKey { get; set; }
|
|
public string Key { get; set; }
|
|
public string MasterPasswordHash { get; set; }
|
|
public bool? Approved { get; set; }
|
|
public DateTime CreationDate { get; set; } = DateTime.UtcNow;
|
|
public DateTime? ResponseDate { get; set; }
|
|
public DateTime? AuthenticationDate { get; set; }
|
|
|
|
public void SetNewId()
|
|
{
|
|
Id = CoreHelpers.GenerateComb();
|
|
}
|
|
|
|
public bool IsSpent()
|
|
{
|
|
return ResponseDate.HasValue || AuthenticationDate.HasValue || GetExpirationDate() < DateTime.UtcNow;
|
|
}
|
|
|
|
public DateTime GetExpirationDate()
|
|
{
|
|
return CreationDate.AddMinutes(15);
|
|
}
|
|
}
|