mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 15:42:48 -05:00
[PM-1198] Modify AuthRequest
Purge Job (#3048)
* Add PasswordlessAuth Settings * Update Repository Method to Take TimeSpan * Update AuthRequest_DeleteIfExpired - Take Configurable Expiration - Add Special Cases for AdminApproval AuthRequests * Add AuthRequestRepositoryTests * Run Formatting * Remove Comment * Fix Bug in EF Repo * Add Test Covering Expired Rejected AuthRequest * Use Longer Param Names * Use Longer Names in Test Helpers
This commit is contained in:
@ -5,7 +5,7 @@ namespace Bit.Core.Repositories;
|
||||
|
||||
public interface IAuthRequestRepository : IRepository<AuthRequest, Guid>
|
||||
{
|
||||
Task<int> DeleteExpiredAsync();
|
||||
Task<int> DeleteExpiredAsync(TimeSpan userRequestExpiration, TimeSpan adminRequestExpiration, TimeSpan afterAdminApprovalExpiration);
|
||||
Task<ICollection<AuthRequest>> GetManyByUserIdAsync(Guid userId);
|
||||
Task<ICollection<OrganizationAdminAuthRequest>> GetManyPendingByOrganizationIdAsync(Guid organizationId);
|
||||
Task<ICollection<OrganizationAdminAuthRequest>> GetManyAdminApprovalRequestsByManyIdsAsync(Guid organizationId, IEnumerable<Guid> ids);
|
||||
|
@ -3,4 +3,7 @@
|
||||
public interface IPasswordlessAuthSettings
|
||||
{
|
||||
bool KnownDevicesOnly { get; set; }
|
||||
TimeSpan UserRequestExpiration { get; set; }
|
||||
TimeSpan AdminRequestExpiration { get; set; }
|
||||
TimeSpan AfterAdminApprovalExpiration { get; set; }
|
||||
}
|
||||
|
@ -534,6 +534,9 @@ public class GlobalSettings : IGlobalSettings
|
||||
public class PasswordlessAuthSettings : IPasswordlessAuthSettings
|
||||
{
|
||||
public bool KnownDevicesOnly { get; set; } = true;
|
||||
public TimeSpan UserRequestExpiration { get; set; } = TimeSpan.FromMinutes(15);
|
||||
public TimeSpan AdminRequestExpiration { get; set; } = TimeSpan.FromDays(7);
|
||||
public TimeSpan AfterAdminApprovalExpiration { get; set; } = TimeSpan.FromHours(12);
|
||||
}
|
||||
|
||||
public class DomainVerificationSettings : IDomainVerificationSettings
|
||||
|
Reference in New Issue
Block a user