1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-25 12:45:18 +01:00

Move key rotation & validators to km ownership

This commit is contained in:
Bernd Schoolmann 2024-10-25 11:41:37 +02:00
parent d38c489443
commit 1ef37fb248
No known key found for this signature in database
18 changed files with 20 additions and 27 deletions

View File

@ -3,7 +3,7 @@ using Bit.Api.AdminConsole.Models.Response;
using Bit.Api.Auth.Models.Request; using Bit.Api.Auth.Models.Request;
using Bit.Api.Auth.Models.Request.Accounts; using Bit.Api.Auth.Models.Request.Accounts;
using Bit.Api.Auth.Models.Request.WebAuthn; using Bit.Api.Auth.Models.Request.WebAuthn;
using Bit.Api.Auth.Validators; using Bit.Api.KeyManagement.Validators;
using Bit.Api.Models.Request; using Bit.Api.Models.Request;
using Bit.Api.Models.Request.Accounts; using Bit.Api.Models.Request.Accounts;
using Bit.Api.Models.Response; using Bit.Api.Models.Response;

View File

@ -1,11 +1,10 @@
using Bit.Api.Auth.Validators; using Bit.Api.Vault.Models.Request;
using Bit.Api.Vault.Models.Request;
using Bit.Core.Entities; using Bit.Core.Entities;
using Bit.Core.Exceptions; using Bit.Core.Exceptions;
using Bit.Core.Vault.Entities; using Bit.Core.Vault.Entities;
using Bit.Core.Vault.Repositories; using Bit.Core.Vault.Repositories;
namespace Bit.Api.Vault.Validators; namespace Bit.Api.KeyManagement.Validators;
public class CipherRotationValidator : IRotationValidator<IEnumerable<CipherWithIdRequestModel>, IEnumerable<Cipher>> public class CipherRotationValidator : IRotationValidator<IEnumerable<CipherWithIdRequestModel>, IEnumerable<Cipher>>
{ {

View File

@ -5,7 +5,7 @@ using Bit.Core.Exceptions;
using Bit.Core.Repositories; using Bit.Core.Repositories;
using Bit.Core.Services; using Bit.Core.Services;
namespace Bit.Api.Auth.Validators; namespace Bit.Api.KeyManagement.Validators;
public class EmergencyAccessRotationValidator : IRotationValidator<IEnumerable<EmergencyAccessWithIdRequestModel>, public class EmergencyAccessRotationValidator : IRotationValidator<IEnumerable<EmergencyAccessWithIdRequestModel>,
IEnumerable<EmergencyAccess>> IEnumerable<EmergencyAccess>>

View File

@ -1,11 +1,10 @@
using Bit.Api.Auth.Validators; using Bit.Api.Vault.Models.Request;
using Bit.Api.Vault.Models.Request;
using Bit.Core.Entities; using Bit.Core.Entities;
using Bit.Core.Exceptions; using Bit.Core.Exceptions;
using Bit.Core.Vault.Entities; using Bit.Core.Vault.Entities;
using Bit.Core.Vault.Repositories; using Bit.Core.Vault.Repositories;
namespace Bit.Api.Vault.Validators; namespace Bit.Api.KeyManagement.Validators;
public class FolderRotationValidator : IRotationValidator<IEnumerable<FolderWithIdRequestModel>, IEnumerable<Folder>> public class FolderRotationValidator : IRotationValidator<IEnumerable<FolderWithIdRequestModel>, IEnumerable<Folder>>
{ {

View File

@ -1,7 +1,7 @@
using Bit.Core.Entities; using Bit.Core.Entities;
using Bit.Core.Exceptions; using Bit.Core.Exceptions;
namespace Bit.Api.Auth.Validators; namespace Bit.Api.KeyManagement.Validators;
/// <summary> /// <summary>
/// A consistent interface for domains to validate re-encrypted data before saved to database. Some examples are:<br/> /// A consistent interface for domains to validate re-encrypted data before saved to database. Some examples are:<br/>

View File

@ -1,10 +1,9 @@
using Bit.Api.AdminConsole.Models.Request.Organizations; using Bit.Api.AdminConsole.Models.Request.Organizations;
using Bit.Api.Auth.Validators;
using Bit.Core.Entities; using Bit.Core.Entities;
using Bit.Core.Exceptions; using Bit.Core.Exceptions;
using Bit.Core.Repositories; using Bit.Core.Repositories;
namespace Bit.Api.AdminConsole.Validators; namespace Bit.Api.KeyManagement.Validators;
/// <summary> /// <summary>
/// Organization user implementation for <see cref="IRotationValidator{T,R}"/> /// Organization user implementation for <see cref="IRotationValidator{T,R}"/>

View File

@ -1,12 +1,11 @@
using Bit.Api.Auth.Validators; using Bit.Api.Tools.Models.Request;
using Bit.Api.Tools.Models.Request;
using Bit.Core.Entities; using Bit.Core.Entities;
using Bit.Core.Exceptions; using Bit.Core.Exceptions;
using Bit.Core.Tools.Entities; using Bit.Core.Tools.Entities;
using Bit.Core.Tools.Repositories; using Bit.Core.Tools.Repositories;
using Bit.Core.Tools.Services; using Bit.Core.Tools.Services;
namespace Bit.Api.Tools.Validators; namespace Bit.Api.KeyManagement.Validators;
/// <summary> /// <summary>
/// Send implementation for <see cref="IRotationValidator{T,R}"/> /// Send implementation for <see cref="IRotationValidator{T,R}"/>

View File

@ -4,7 +4,7 @@ using Bit.Core.Auth.Repositories;
using Bit.Core.Entities; using Bit.Core.Entities;
using Bit.Core.Exceptions; using Bit.Core.Exceptions;
namespace Bit.Api.Auth.Validators; namespace Bit.Api.KeyManagement.Validators;
public class WebAuthnLoginKeyRotationValidator : IRotationValidator<IEnumerable<WebAuthnLoginRotateKeyRequestModel>, IEnumerable<WebAuthnLoginRotateKeyData>> public class WebAuthnLoginKeyRotationValidator : IRotationValidator<IEnumerable<WebAuthnLoginRotateKeyRequestModel>, IEnumerable<WebAuthnLoginRotateKeyData>>
{ {

View File

@ -8,13 +8,10 @@ using Bit.Core.Utilities;
using IdentityModel; using IdentityModel;
using System.Globalization; using System.Globalization;
using Bit.Api.AdminConsole.Models.Request.Organizations; using Bit.Api.AdminConsole.Models.Request.Organizations;
using Bit.Api.AdminConsole.Validators;
using Bit.Api.Auth.Models.Request; using Bit.Api.Auth.Models.Request;
using Bit.Api.Auth.Validators; using Bit.Api.KeyManagement.Validators;
using Bit.Api.Tools.Models.Request; using Bit.Api.Tools.Models.Request;
using Bit.Api.Tools.Validators;
using Bit.Api.Vault.Models.Request; using Bit.Api.Vault.Models.Request;
using Bit.Api.Vault.Validators;
using Bit.Core.Auth.Entities; using Bit.Core.Auth.Entities;
using Bit.Core.IdentityServer; using Bit.Core.IdentityServer;
using Bit.SharedWeb.Health; using Bit.SharedWeb.Health;

View File

@ -4,7 +4,7 @@ using Bit.Api.Auth.Controllers;
using Bit.Api.Auth.Models.Request; using Bit.Api.Auth.Models.Request;
using Bit.Api.Auth.Models.Request.Accounts; using Bit.Api.Auth.Models.Request.Accounts;
using Bit.Api.Auth.Models.Request.WebAuthn; using Bit.Api.Auth.Models.Request.WebAuthn;
using Bit.Api.Auth.Validators; using Bit.Api.KeyManagement.Validators;
using Bit.Api.Tools.Models.Request; using Bit.Api.Tools.Models.Request;
using Bit.Api.Vault.Models.Request; using Bit.Api.Vault.Models.Request;
using Bit.Core.AdminConsole.Repositories; using Bit.Core.AdminConsole.Repositories;

View File

@ -1,5 +1,5 @@
using Bit.Api.Auth.Models.Request; using Bit.Api.Auth.Models.Request;
using Bit.Api.Auth.Validators; using Bit.Api.KeyManagement.Validators;
using Bit.Core.Auth.Models.Data; using Bit.Core.Auth.Models.Data;
using Bit.Core.Entities; using Bit.Core.Entities;
using Bit.Core.Exceptions; using Bit.Core.Exceptions;
@ -10,7 +10,7 @@ using Bit.Test.Common.AutoFixture.Attributes;
using NSubstitute; using NSubstitute;
using Xunit; using Xunit;
namespace Bit.Api.Test.Auth.Validators; namespace Bit.Api.Test.KeyManagement.Validators;
[SutProviderCustomize] [SutProviderCustomize]
public class EmergencyAccessRotationValidatorTests public class EmergencyAccessRotationValidatorTests

View File

@ -1,5 +1,5 @@
using Bit.Api.Vault.Models.Request; using Bit.Api.Vault.Models.Request;
using Bit.Api.Vault.Validators; using Bit.Api.KeyManagement.Validators;
using Bit.Core.Entities; using Bit.Core.Entities;
using Bit.Core.Exceptions; using Bit.Core.Exceptions;
using Bit.Core.Vault.Entities; using Bit.Core.Vault.Entities;
@ -9,7 +9,7 @@ using Bit.Test.Common.AutoFixture.Attributes;
using NSubstitute; using NSubstitute;
using Xunit; using Xunit;
namespace Bit.Api.Test.Vault.Validators; namespace Bit.Api.Test.KeyManagement.Validators;
[SutProviderCustomize] [SutProviderCustomize]
public class FolderRotationValidatorTests public class FolderRotationValidatorTests

View File

@ -1,5 +1,5 @@
using Bit.Api.AdminConsole.Models.Request.Organizations; using Bit.Api.AdminConsole.Models.Request.Organizations;
using Bit.Api.AdminConsole.Validators; using Bit.Api.KeyManagement.Validators;
using Bit.Core.Entities; using Bit.Core.Entities;
using Bit.Core.Exceptions; using Bit.Core.Exceptions;
using Bit.Core.Repositories; using Bit.Core.Repositories;
@ -8,7 +8,7 @@ using Bit.Test.Common.AutoFixture.Attributes;
using NSubstitute; using NSubstitute;
using Xunit; using Xunit;
namespace Bit.Api.Test.AdminConsole.Validators; namespace Bit.Api.Test.KeyManagement.Validators;
[SutProviderCustomize] [SutProviderCustomize]
public class OrganizationUserRotationValidatorTests public class OrganizationUserRotationValidatorTests

View File

@ -1,5 +1,5 @@
using Bit.Api.Auth.Models.Request.WebAuthn; using Bit.Api.Auth.Models.Request.WebAuthn;
using Bit.Api.Auth.Validators; using Bit.Api.KeyManagement.Validators;
using Bit.Core.Auth.Entities; using Bit.Core.Auth.Entities;
using Bit.Core.Auth.Repositories; using Bit.Core.Auth.Repositories;
using Bit.Core.Entities; using Bit.Core.Entities;