From 266ed976c693481c3c15f128d0f78fb7757fcb87 Mon Sep 17 00:00:00 2001 From: Thomas Rittson Date: Wed, 18 Oct 2023 14:25:19 +1000 Subject: [PATCH] Core moves --- .../Providers/CreateProviderCommand.cs | 8 +-- .../AccessPolicyAuthorizationHandler.cs | 3 +- .../Commands/Projects/CreateProjectCommand.cs | 3 +- .../CreateServiceAccountCommand.cs | 3 +- .../Queries/Projects/MaxProjectsQuery.cs | 3 +- ...ountNewServiceAccountSlotsRequiredQuery.cs | 3 +- .../Services/ProviderService.cs | 12 +++-- .../Utilities/ServiceCollectionExtensions.cs | 3 +- .../src/Scim/Context/IScimContext.cs | 4 +- .../src/Scim/Context/ScimContext.cs | 4 +- .../Scim/Controllers/v2/GroupsController.cs | 5 +- .../Scim/Controllers/v2/UsersController.cs | 7 ++- .../src/Scim/Groups/GetGroupsListQuery.cs | 4 +- .../Groups/Interfaces/IGetGroupsListQuery.cs | 3 +- .../Groups/Interfaces/IPatchGroupCommand.cs | 3 +- .../Groups/Interfaces/IPostGroupCommand.cs | 3 +- .../Groups/Interfaces/IPutGroupCommand.cs | 3 +- .../src/Scim/Groups/PatchGroupCommand.cs | 5 +- .../src/Scim/Groups/PostGroupCommand.cs | 6 ++- .../src/Scim/Groups/PutGroupCommand.cs | 6 ++- .../src/Scim/Models/ScimGroupRequestModel.cs | 3 +- .../src/Scim/Models/ScimGroupResponseModel.cs | 3 +- .../src/Scim/Models/ScimUserResponseModel.cs | 5 +- .../src/Scim/Users/GetUsersListQuery.cs | 3 +- .../Users/Interfaces/IGetUsersListQuery.cs | 2 +- .../Scim/Users/Interfaces/IPostUserCommand.cs | 2 +- .../src/Scim/Users/PatchUserCommand.cs | 8 ++- .../src/Scim/Users/PostUserCommand.cs | 4 +- .../Utilities/ApiKeyAuthenticationHandler.cs | 2 + .../Scim/Utilities/ScimContextMiddleware.cs | 3 +- .../src/Sso/Controllers/AccountController.cs | 4 ++ .../AutoFixture/ProviderUserFixtures.cs | 4 +- .../CreateProviderCommandTests.cs | 6 ++- .../AccessPolicyAuthorizationHandlerTests.cs | 2 + .../Projects/CreateProjectCommandTests.cs | 2 + .../CreateServiceAccountCommandTests.cs | 2 + .../Queries/Projects/MaxProjectsQueryTests.cs | 2 + ...ewServiceAccountSlotsRequiredQueryTests.cs | 2 + .../Services/ProviderServiceTests.cs | 15 ++++-- .../Controllers/v2/UsersControllerTests.cs | 1 + .../Factories/ScimApplicationFactory.cs | 9 ++-- .../Groups/GetGroupsListQueryTests.cs | 4 +- .../Groups/PatchGroupCommandTests.cs | 5 +- .../Scim.Test/Groups/PostGroupCommandTests.cs | 6 ++- .../Scim.Test/Groups/PutGroupCommandTests.cs | 6 ++- .../Scim.Test/Users/GetUsersListQueryTests.cs | 3 +- .../Scim.Test/Users/PatchUserCommandTests.cs | 12 +++-- .../Scim.Test/Users/PostUserCommandTests.cs | 10 ++-- .../Controllers/OrganizationsController.cs | 4 ++ src/Admin/Controllers/ProvidersController.cs | 8 +-- src/Admin/Controllers/ToolsController.cs | 7 ++- src/Admin/Models/CreateProviderModel.cs | 4 +- src/Admin/Models/OrganizationEditModel.cs | 7 +-- .../Models/OrganizationSelectableViewModel.cs | 3 +- src/Admin/Models/OrganizationViewModel.cs | 8 +-- src/Admin/Models/OrganizationsModel.cs | 3 +- src/Admin/Models/ProviderEditModel.cs | 3 +- src/Admin/Models/ProviderViewModel.cs | 5 +- src/Admin/Models/ProvidersModel.cs | 2 +- .../Organizations/_ProviderInformation.cshtml | 2 +- src/Admin/Views/Providers/Admins.cshtml | 1 + src/Admin/Views/Providers/Create.cshtml | 1 + .../Views/Providers/Organizations.cshtml | 2 + .../Views/Providers/_ViewInformation.cshtml | 1 + .../Views/Shared/_OrganizationForm.cshtml | 1 + src/Admin/Views/_ViewImports.cshtml | 1 - .../Controllers/GroupsController.cs | 4 +- .../OrganizationUsersController.cs | 15 ++++-- .../Controllers/OrganizationsController.cs | 7 ++- .../Controllers/PoliciesController.cs | 4 ++ .../ProviderOrganizationsController.cs | 2 + .../Controllers/ProviderUsersController.cs | 4 +- .../Controllers/ProvidersController.cs | 2 + .../Models/Request/GroupRequestModel.cs | 1 + .../ImportOrganizationUsersRequestModel.cs | 3 +- .../OrganizationApiKeyRequestModel.cs | 1 + .../OrganizationCreateRequestModel.cs | 1 + .../OrganizationKeysRequestModel.cs | 2 + .../OrganizationUpdateRequestModel.cs | 1 + .../OrganizationUpgradeRequestModel.cs | 1 + .../OrganizationUserRequestModels.cs | 4 +- .../Models/Request/PolicyRequestModel.cs | 2 + .../Providers/ProviderSetupRequestModel.cs | 2 +- .../Providers/ProviderUpdateRequestModel.cs | 2 +- .../Providers/ProviderUserRequestModels.cs | 4 +- .../Models/Response/GroupResponseModel.cs | 1 + ...anizationApiKeyInformationResponseModel.cs | 4 +- .../OrganizationKeysResponseModel.cs | 3 +- .../OrganizationPublicKeyResponseModel.cs | 3 +- .../OrganizationResponseModel.cs | 1 + .../OrganizationUserResponseModel.cs | 4 +- .../ProfileOrganizationResponseModel.cs | 7 +-- ...rofileProviderOrganizationResponseModel.cs | 4 +- .../Providers/ProfileProviderResponseModel.cs | 3 +- .../ProviderOrganizationResponseModel.cs | 3 +- .../Providers/ProviderResponseModel.cs | 2 +- .../Providers/ProviderUserResponseModel.cs | 5 +- .../Public/Controllers/GroupsController.cs | 3 +- .../Public/Controllers/MembersController.cs | 5 +- .../Controllers/OrganizationController.cs | 1 + .../Public/Controllers/PoliciesController.cs | 3 ++ .../Public/Models/MemberBaseModel.cs | 4 +- .../Request/GroupCreateUpdateRequestModel.cs | 1 + .../Request/MemberCreateRequestModel.cs | 1 + .../Request/MemberUpdateRequestModel.cs | 1 + .../Request/OrganizationImportRequestModel.cs | 2 + .../Request/PolicyUpdateRequestModel.cs | 1 + .../Models/Response/GroupResponseModel.cs | 1 + .../Models/Response/MemberResponseModel.cs | 4 +- .../Models/Response/PolicyResponseModel.cs | 2 + .../Controllers/EmergencyAccessController.cs | 2 + .../Auth/Controllers/TwoFactorController.cs | 2 + .../Models/Request/TwoFactorRequestModels.cs | 3 +- .../Response/OrganizationSsoResponseModel.cs | 3 +- .../TwoFactor/TwoFactorDuoResponseModel.cs | 3 +- .../TwoFactorProviderResponseModel.cs | 3 +- src/Api/Controllers/AccountsController.cs | 6 ++- src/Api/Controllers/EventsController.cs | 1 + src/Api/Controllers/LicensesController.cs | 3 +- .../OrganizationAuthRequestsController.cs | 2 +- .../OrganizationDomainController.cs | 1 + .../OrganizationSponsorshipsController.cs | 1 + ...elfHostedOrganizationLicensesController.cs | 2 + ...ostedOrganizationSponsorshipsController.cs | 1 + src/Api/Jobs/SelfHostedSponsorshipSyncJob.cs | 3 +- ...tsManagerSubscriptionUpdateRequestModel.cs | 1 + .../Models/Response/ApiKeyResponseModel.cs | 3 +- .../Models/Response/ProfileResponseModel.cs | 3 +- .../Controllers/AccessPoliciesController.cs | 2 + .../Controllers/SecretsController.cs | 1 + .../Controllers/ServiceAccountsController.cs | 1 + .../Response/PotentialGranteeResponseModel.cs | 5 +- .../Controllers/ImportCiphersController.cs | 1 + .../Vault/Controllers/CiphersController.cs | 1 + src/Api/Vault/Controllers/SyncController.cs | 5 +- .../Models/Response/SyncResponseModel.cs | 5 +- src/Billing/Controllers/BitPayController.cs | 1 + .../Controllers/FreshdeskController.cs | 1 + .../Controllers/FreshsalesController.cs | 1 + src/Billing/Controllers/PayPalController.cs | 1 + src/Billing/Controllers/StripeController.cs | 3 ++ .../Context/CurrentContextOrganization.cs | 7 +-- .../Context/CurrentContextProvider.cs | 6 +-- src/Core/{ => AdminConsole}/Entities/Group.cs | 3 +- .../{ => AdminConsole}/Entities/GroupUser.cs | 2 +- .../Entities/Organization.cs | 4 +- .../Entities/OrganizationApiKey.cs | 4 +- .../Entities/OrganizationUser.cs | 4 +- .../{ => AdminConsole}/Entities/Policy.cs | 8 +-- .../Entities/Provider/Provider.cs | 5 +- .../Entities/Provider/ProviderOrganization.cs | 5 +- .../Entities/Provider/ProviderUser.cs | 5 +- .../Enums/OrganizationApiKeyType.cs | 2 +- .../Enums/OrganizationStatusType.cs | 2 +- .../Enums/OrganizationUserStatusType.cs | 2 +- .../Enums/OrganizationUserType.cs | 2 +- .../{ => AdminConsole}/Enums/PolicyType.cs | 2 +- .../Enums/Provider/ProviderStatusType.cs | 2 +- .../Enums/Provider/ProviderType.cs | 2 +- .../Enums/Provider/ProviderUserStatusType.cs | 2 +- .../Enums/Provider/ProviderUserType.cs | 2 +- .../MasterPasswordPolicyResponseModel.cs | 5 +- .../Api/Response/PolicyResponseModel.cs | 7 +-- .../Models/Business/ImportedGroup.cs | 4 +- .../Business/ImportedOrganizationUser.cs | 2 +- .../Models/Business/OrganizationSignup.cs | 2 +- .../Models/Business/OrganizationUpgrade.cs | 3 +- .../Models/Business/OrganizationUserInvite.cs | 9 ++-- .../Business/Provider/ProviderUserInvite.cs | 4 +- .../Models/Data/GroupWithCollections.cs | 4 +- .../Data/Organizations/OrganizationAbility.cs | 4 +- .../OrganizationUserInviteData.cs | 5 +- .../OrganizationUserOrganizationDetails.cs | 11 +++-- .../OrganizationUserPolicyDetails.cs | 4 +- .../OrganizationUserPublicKey.cs | 2 +- .../OrganizationUserResetPasswordDetails.cs | 5 +- .../OrganizationUserUserDetails.cs | 8 +-- .../OrganizationUserWithCollections.cs | 4 +- .../Policies/IPolicyDataModel.cs | 5 ++ .../Policies/MasterPasswordPolicyData.cs | 2 +- .../Policies/ResetPasswordDataModel.cs | 2 +- .../Policies/SendOptionsPolicyData.cs | 2 +- .../SelfHostedOrganizationDetails.cs | 7 +-- .../Models/Data/Provider/ProviderAbility.cs | 6 +-- ...ProviderOrganizationOrganizationDetails.cs | 4 +- .../ProviderOrganizationProviderDetails.cs | 4 +- .../ProviderUserOrganizationDetails.cs | 6 +-- .../Provider/ProviderUserProviderDetails.cs | 4 +- .../Data/Provider/ProviderUserPublicKey.cs | 2 +- .../Data/Provider/ProviderUserUserDetails.cs | 4 +- .../Groups/CreateGroupCommand.cs | 12 +++-- .../Groups/DeleteGroupCommand.cs | 8 +-- .../Groups/Interfaces/ICreateGroupCommand.cs | 5 +- .../Groups/Interfaces/IDeleteGroupCommand.cs | 5 +- .../Groups/Interfaces/IUpdateGroupCommand.cs | 5 +- .../Groups/UpdateGroupCommand.cs | 12 +++-- .../CreateOrganizationApiKeyCommand.cs | 9 ++-- .../GetOrganizationApiKeyQuery.cs | 9 ++-- .../ICreateOrganizationApiKeyCommand.cs | 6 ++- .../Interfaces/IGetOrganizationApiKeyQuery.cs | 6 ++- .../IRotateOrganizationApiKeyCommand.cs | 9 ++++ .../RotateOrganizationApiKeyCommand.cs | 8 +-- .../IUpdateOrganizationAuthRequestCommand.cs | 2 +- .../UpdateOrganizationAuthRequestCommand.cs | 4 +- .../CountNewSmSeatsRequiredQuery.cs | 7 +-- .../DeleteOrganizationUserCommand.cs | 8 +-- .../ICountNewSmSeatsRequiredQuery.cs | 2 +- .../IDeleteOrganizationUserCommand.cs | 2 +- .../IUpdateOrganizationUserGroupsCommand.cs | 5 +- .../UpdateOrganizationUserGroupsCommand.cs | 9 ++-- .../Interfaces/ICreateProviderCommand.cs | 4 +- .../Repositories/IGroupRepository.cs | 5 +- .../IOrganizationApiKeyRepository.cs | 7 +-- .../Repositories/IOrganizationRepository.cs | 7 +-- .../IOrganizationUserRepository.cs | 9 ++-- .../Repositories/IPolicyRepository.cs | 7 +-- .../IProviderOrganizationRepository.cs | 7 +-- .../Repositories/IProviderRepository.cs | 7 +-- .../Repositories/IProviderUserRepository.cs | 9 ++-- .../Services/IApplicationCacheService.cs | 10 ++-- .../Services/IGroupService.cs | 4 +- .../Services/IOrganizationService.cs | 10 ++-- .../Services/IPolicyService.cs | 12 +++-- .../Services/IProviderService.cs | 10 ++-- .../Services/Implementations/GroupService.cs | 7 +-- .../InMemoryApplicationCacheService.cs | 12 ++--- ...MemoryServiceBusApplicationCacheService.cs | 6 +-- .../Implementations/OrganizationService.cs | 19 ++++--- .../Services/Implementations/PolicyService.cs | 23 +++++---- .../NoopProviderService.cs | 10 ++-- .../IOrganizationTwoFactorTokenProvider.cs | 3 +- .../OrganizationDuoWebTokenProvider.cs | 3 +- .../Business/Tokenables/SsoTokenable.cs | 3 +- .../Auth/Services/IEmergencyAccessService.cs | 3 +- src/Core/Auth/Services/ISsoConfigService.cs | 3 +- .../Implementations/AuthRequestService.cs | 1 + .../Implementations/EmergencyAccessService.cs | 6 ++- .../Implementations/SsoConfigService.cs | 8 ++- src/Core/Context/CurrentContext.cs | 6 ++- src/Core/Context/ICurrentContext.cs | 2 + .../ApplicationCacheHostedService.cs | 3 ++ .../Models/Business/OrganizationLicense.cs | 1 + .../SecretsManagerSubscriptionUpdate.cs | 3 +- .../Business/SubscriptionCreateOptions.cs | 4 +- .../Models/Business/SubscriptionUpdate.cs | 3 +- .../Policies/IPolicyDataModel.cs | 5 -- src/Core/Models/StaticStore/SponsoredPlan.cs | 4 +- .../IRotateOrganizationApiKeyCommand.cs | 8 --- .../IValidateBillingSyncKeyCommand.cs | 3 +- .../ValidateBillingSyncKeyCommand.cs | 7 ++- .../Cloud/CloudGetOrganizationLicenseQuery.cs | 3 +- .../IGetOrganizationLicenseQuery.cs | 3 +- .../IUpdateOrganizationLicenseCommand.cs | 2 + .../SelfHostedGetOrganizationLicenseQuery.cs | 3 +- .../UpdateOrganizationLicenseCommand.cs | 3 ++ ...OrganizationServiceCollectionExtensions.cs | 18 ++++--- .../CancelSponsorshipCommand.cs | 3 +- .../Cloud/CloudRevokeSponsorshipCommand.cs | 3 +- .../Cloud/CloudSyncSponsorshipsCommand.cs | 3 +- .../Cloud/RemoveSponsorshipCommand.cs | 3 +- .../Cloud/SendSponsorshipOfferCommand.cs | 4 +- .../Cloud/SetUpSponsorshipCommand.cs | 4 +- .../Cloud/ValidateSponsorshipCommand.cs | 4 +- .../CreateSponsorshipCommand.cs | 4 +- .../Interfaces/ICreateSponsorshipCommand.cs | 3 +- .../ISendSponsorshipOfferCommand.cs | 3 +- .../Interfaces/ISetUpSponsorshipCommand.cs | 3 +- .../ISyncOrganizationSponsorshipsCommand.cs | 3 +- .../SelfHostedRevokeSponsorshipCommand.cs | 3 +- .../SelfHostedSyncSponsorshipsCommand.cs | 3 +- .../AddSecretsManagerSubscriptionCommand.cs | 8 ++- .../IAddSecretsManagerSubscriptionCommand.cs | 3 +- .../IUpgradeOrganizationPlanCommand.cs | 6 ++- ...UpdateSecretsManagerSubscriptionCommand.cs | 6 ++- .../UpgradeOrganizationPlanCommand.cs | 7 ++- .../SecretsManager/Entities/AccessPolicy.cs | 1 + src/Core/Services/IEventService.cs | 5 +- src/Core/Services/ILicensingService.cs | 3 +- src/Core/Services/IMailService.cs | 5 +- src/Core/Services/IPaymentService.cs | 4 +- src/Core/Services/IUserService.cs | 2 + .../Implementations/CollectionService.cs | 6 ++- .../Services/Implementations/EventService.cs | 9 +++- .../Implementations/HandlebarsMailService.cs | 3 +- .../Implementations/LicensingService.cs | 2 + .../OrganizationDomainService.cs | 12 +++-- .../Implementations/StripePaymentService.cs | 2 + .../Services/Implementations/UserService.cs | 3 ++ .../NoopImplementations/NoopEventService.cs | 5 +- .../NoopLicensingService.cs | 3 +- .../NoopImplementations/NoopMailService.cs | 5 +- .../Services/Implementations/SendService.cs | 5 +- src/Core/Utilities/CoreHelpers.cs | 14 +++--- src/Core/Utilities/StaticStore.cs | 2 +- .../Services/Implementations/CipherService.cs | 7 ++- src/Events/Controllers/CollectController.cs | 3 +- src/Events/Startup.cs | 2 + .../IdentityServer/BaseRequestValidator.cs | 8 ++- src/Identity/IdentityServer/ClientStore.cs | 2 + .../CustomTokenRequestValidator.cs | 2 + src/Identity/IdentityServer/ProfileService.cs | 1 + .../ResourceOwnerPasswordValidator.cs | 2 + src/Infrastructure.Dapper/DapperHelpers.cs | 1 + .../DapperServiceCollectionExtensions.cs | 3 +- .../Repositories/GroupRepository.cs | 3 ++ .../OrganizationApiKeyRepository.cs | 3 ++ .../Repositories/OrganizationRepository.cs | 3 ++ .../OrganizationUserRepository.cs | 5 +- .../Repositories/PolicyRepository.cs | 3 ++ .../ProviderOrganizationRepository.cs | 4 +- .../Repositories/ProviderRepository.cs | 4 +- .../Repositories/ProviderUserRepository.cs | 6 ++- ...ityFrameworkServiceCollectionExtensions.cs | 3 +- .../Models/Group.cs | 4 +- .../Models/GroupUser.cs | 4 +- .../Models/Organization.cs | 6 ++- .../Models/OrganizationApiKey.cs | 4 +- .../Models/OrganizationUser.cs | 4 +- .../Models/Policy.cs | 4 +- .../Models/Provider/Provider.cs | 4 +- .../Models/Provider/ProviderOrganization.cs | 4 +- .../Models/Provider/ProviderUser.cs | 4 +- .../CollectionCipherRepository.cs | 1 + .../Repositories/DatabaseContextExtensions.cs | 5 +- .../Repositories/GroupRepository.cs | 31 ++++++------ .../OrganizationApiKeyRepository.cs | 3 ++ .../Repositories/OrganizationRepository.cs | 25 +++++----- .../OrganizationUserRepository.cs | 49 ++++++++++--------- .../Repositories/PolicyRepository.cs | 17 ++++--- .../ProviderOrganizationRepository.cs | 4 +- .../Repositories/ProviderRepository.cs | 4 +- .../Repositories/ProviderUserRepository.cs | 6 ++- .../CollectionCipherReadByUserIdQuery.cs | 3 +- ...izationUserOrganizationDetailsViewQuery.cs | 2 +- ...adCountByFreeOrganizationAdminUserQuery.cs | 3 +- ...dOccupiedSeatCountByOrganizationIdQuery.cs | 3 +- ...ccupiedSmSeatCountByOrganizationIdQuery.cs | 3 +- .../Queries/OrganizationUserUserViewQuery.cs | 2 +- .../Queries/PolicyReadByUserIdQuery.cs | 3 +- ...OrganizationCountByOrganizationIdsQuery.cs | 2 +- ...rganizationDetailsReadByProviderIdQuery.cs | 6 ++- .../ProviderOrganizationReadByUserIdQuery.cs | 3 +- ...roviderUserOrganizationDetailsViewQuery.cs | 3 +- ...rProviderDetailsReadByUserIdStatusQuery.cs | 3 +- ...rBumpAccountRevisionDateByCipherIdQuery.cs | 3 +- ...ccountRevisionDateByOrganizationIdQuery.cs | 3 +- .../Queries/UserCipherDetailsQuery.cs | 1 + .../Queries/UserCollectionDetailsQuery.cs | 3 +- ...serReadPublicKeysByProviderUserIdsQuery.cs | 3 +- .../Vault/Repositories/CipherRepository.cs | 1 + .../CipherReadCanEditByIdUserIdQuery.cs | 3 +- .../Utilities/ServiceCollectionExtensions.cs | 3 ++ .../Controllers/ConfigControllerTests.cs | 4 +- .../Helpers/OrganizationTestHelpers.cs | 7 ++- .../AccessPoliciesControllerTests.cs | 1 + .../Controllers/ProjectsControllerTests.cs | 2 + .../Controllers/SecretsControllerTests.cs | 1 + .../SecretsTrashControllerTests.cs | 1 + .../ServiceAccountsControllerTests.cs | 2 + .../SecretsManagerOrganizationHelper.cs | 3 ++ .../Controllers/GroupsControllerTests.cs | 4 +- ...OrganizationSponsorshipsControllerTests.cs | 3 ++ .../OrganizationUsersControllerTests.cs | 12 +++-- .../OrganizationsControllerTests.cs | 4 +- .../Controllers/GroupsControllerTests.cs | 4 +- .../Controllers/AccountsControllerTests.cs | 2 + .../Controllers/CollectionsControllerTests.cs | 1 + .../OrganizationDomainControllerTests.cs | 3 +- .../AccessPoliciesControllerTests.cs | 2 + .../ServiceAccountsControllerTests.cs | 2 + .../Vault/Controllers/SyncControllerTests.cs | 8 ++- .../Controllers/FreshdeskControllerTests.cs | 2 + .../Controllers/FreshsalesControllerTests.cs | 2 + ...dateOrganizationAuthRequestCommandTests.cs | 2 +- .../Business/Tokenables/SsoTokenableTests.cs | 1 + .../Auth/Services/AuthRequestServiceTests.cs | 4 +- .../Auth/Services/SsoConfigServiceTests.cs | 22 +++++---- .../AutoFixture/CurrentContextFixtures.cs | 1 + .../AutoFixture/OrganizationFixtures.cs | 3 ++ .../AutoFixture/OrganizationUserFixtures.cs | 2 + test/Core.Test/AutoFixture/PolicyFixtures.cs | 2 + test/Core.Test/Entities/OrganizationTests.cs | 1 + .../SecretsManagerSubscriptionUpdateTests.cs | 3 +- .../SelfHostedOrganizationDetailsTests.cs | 5 +- .../Groups/CreateGroupCommandTests.cs | 6 ++- .../Groups/DeleteGroupCommandTests.cs | 8 +-- .../Groups/UpdateGroupCommandTests.cs | 6 ++- .../CreateOrganizationApiKeyCommandTest.cs | 7 ++- .../GetOrganizationApiKeyQueryTests.cs | 7 ++- .../RotateOrganizationApiKeyCommandTests.cs | 5 +- .../ValidateBillingSyncKeyCommandTests.cs | 5 +- .../CloudGetOrganizationLicenseQueryTests.cs | 3 +- ...fHostedGetOrganizationLicenseQueryTests.cs | 1 + .../CancelSponsorshipCommandTestsBase.cs | 4 +- .../CloudSyncSponsorshipsCommandTests.cs | 3 +- .../Cloud/SendSponsorshipOfferCommandTests.cs | 4 +- .../Cloud/SetUpSponsorshipCommandTests.cs | 4 +- .../Cloud/ValidateSponsorshipCommandTests.cs | 4 +- .../CreateSponsorshipCommandTests.cs | 4 +- .../FamiliesForEnterpriseTestsBase.cs | 3 +- ...dSecretsManagerSubscriptionCommandTests.cs | 10 ++-- ...eSecretsManagerSubscriptionCommandTests.cs | 5 +- .../UpgradeOrganizationPlanCommandTests.cs | 7 ++- .../CountNewSmSeatsRequiredQueryTests.cs | 6 ++- .../DeleteOrganizationUserCommandTests.cs | 7 ++- ...pdateOrganizationUserGroupsCommandTests.cs | 7 ++- .../Services/CollectionServiceTests.cs | 5 +- test/Core.Test/Services/EventServiceTests.cs | 8 ++- test/Core.Test/Services/GroupServiceTests.cs | 5 +- .../Services/HandlebarsMailServiceTests.cs | 3 +- .../InMemoryApplicationCacheServiceTests.cs | 4 +- ...yServiceBusApplicationCacheServiceTests.cs | 4 +- .../Services/LicensingServiceTests.cs | 1 + .../Services/OrganizationServiceTests.cs | 19 ++++--- test/Core.Test/Services/PolicyServiceTests.cs | 37 ++++++++------ .../Services/StripePaymentServiceTests.cs | 4 +- test/Core.Test/Services/UserServiceTests.cs | 4 ++ .../Tools/Services/SendServiceTests.cs | 8 ++- test/Core.Test/Utilities/CoreHelpersTests.cs | 4 +- .../Vault/Services/CipherServiceTests.cs | 4 +- .../Endpoints/IdentityServerSsoTests.cs | 3 ++ .../Endpoints/IdentityServerTests.cs | 11 +++-- .../AuthRequestRepositoryTests.cs | 3 +- .../Repositories/SsoConfigRepositoryTests.cs | 3 +- .../Repositories/SsoUserRepositoryTests.cs | 3 +- .../AutoFixture/GroupFixtures.cs | 1 + .../AutoFixture/GroupUserFixtures.cs | 1 + .../AutoFixture/OrganizationFixtures.cs | 1 + .../AutoFixture/OrganizationUserFixtures.cs | 1 + .../AutoFixture/PolicyFixtures.cs | 1 + .../Repositories/CollectionRepository.cs | 3 +- .../EqualityComparers/GroupCompare.cs | 1 + .../EqualityComparers/OrganizationCompare.cs | 1 + .../OrganizationUserCompare.cs | 1 + .../OrganizationUserPolicyDetailsCompare.cs | 2 +- .../EqualityComparers/PolicyCompare.cs | 1 + .../OrganizationRepositoryTests.cs | 7 ++- .../OrganizationSponsorshipRepositoryTests.cs | 3 +- .../OrganizationUserRepositoryTests.cs | 9 ++-- .../Repositories/PolicyRepositoryTests.cs | 5 +- .../TransactionRepositoryTests.cs | 3 +- .../Repositories/UserRepositoryTests.cs | 3 +- .../Tools/Repositories/SendRepositoryTests.cs | 3 +- .../Repositories/CipherRepositoryTests.cs | 3 +- .../OrganizationUserRepositoryTests.cs | 5 +- .../Repositories/CipherRepositoryTests.cs | 3 ++ 446 files changed, 1345 insertions(+), 666 deletions(-) rename src/Core/{ => AdminConsole}/Context/CurrentContextOrganization.cs (79%) rename src/Core/{ => AdminConsole}/Context/CurrentContextProvider.cs (79%) rename src/Core/{ => AdminConsole}/Entities/Group.cs (90%) rename src/Core/{ => AdminConsole}/Entities/GroupUser.cs (71%) rename src/Core/{ => AdminConsole}/Entities/Organization.cs (98%) rename src/Core/{ => AdminConsole}/Entities/OrganizationApiKey.cs (82%) rename src/Core/{ => AdminConsole}/Entities/OrganizationUser.cs (92%) rename src/Core/{ => AdminConsole}/Entities/Policy.cs (80%) rename src/Core/{ => AdminConsole}/Entities/Provider/Provider.cs (88%) rename src/Core/{ => AdminConsole}/Entities/Provider/ProviderOrganization.cs (83%) rename src/Core/{ => AdminConsole}/Entities/Provider/ProviderUser.cs (84%) rename src/Core/{ => AdminConsole}/Enums/OrganizationApiKeyType.cs (70%) rename src/Core/{ => AdminConsole}/Enums/OrganizationStatusType.cs (65%) rename src/Core/{ => AdminConsole}/Enums/OrganizationUserStatusType.cs (74%) rename src/Core/{ => AdminConsole}/Enums/OrganizationUserType.cs (74%) rename src/Core/{ => AdminConsole}/Enums/PolicyType.cs (89%) rename src/Core/{ => AdminConsole}/Enums/Provider/ProviderStatusType.cs (60%) rename src/Core/{ => AdminConsole}/Enums/Provider/ProviderType.cs (87%) rename src/Core/{ => AdminConsole}/Enums/Provider/ProviderUserStatusType.cs (66%) rename src/Core/{ => AdminConsole}/Enums/Provider/ProviderUserType.cs (62%) rename src/Core/{ => AdminConsole}/Models/Api/Response/MasterPasswordPolicyResponseModel.cs (85%) rename src/Core/{ => AdminConsole}/Models/Api/Response/PolicyResponseModel.cs (83%) rename src/Core/{ => AdminConsole}/Models/Business/ImportedGroup.cs (58%) rename src/Core/{ => AdminConsole}/Models/Business/ImportedOrganizationUser.cs (70%) rename src/Core/{ => AdminConsole}/Models/Business/OrganizationSignup.cs (90%) rename src/Core/{ => AdminConsole}/Models/Business/OrganizationUpgrade.cs (87%) rename src/Core/{ => AdminConsole}/Models/Business/OrganizationUserInvite.cs (77%) rename src/Core/{ => AdminConsole}/Models/Business/Provider/ProviderUserInvite.cs (90%) rename src/Core/{ => AdminConsole}/Models/Data/GroupWithCollections.cs (58%) rename src/Core/{ => AdminConsole}/Models/Data/Organizations/OrganizationAbility.cs (92%) rename src/Core/{ => AdminConsole}/Models/Data/Organizations/OrganizationUsers/OrganizationUserInviteData.cs (74%) rename src/Core/{ => AdminConsole}/Models/Data/Organizations/OrganizationUsers/OrganizationUserOrganizationDetails.cs (85%) rename src/Core/{ => AdminConsole}/Models/Data/Organizations/OrganizationUsers/OrganizationUserPolicyDetails.cs (82%) rename src/Core/{ => AdminConsole}/Models/Data/Organizations/OrganizationUsers/OrganizationUserPublicKey.cs (66%) rename src/Core/{ => AdminConsole}/Models/Data/Organizations/OrganizationUsers/OrganizationUserResetPasswordDetails.cs (87%) rename src/Core/{ => AdminConsole}/Models/Data/Organizations/OrganizationUsers/OrganizationUserUserDetails.cs (91%) rename src/Core/{ => AdminConsole}/Models/Data/Organizations/OrganizationUsers/OrganizationUserWithCollections.cs (54%) create mode 100644 src/Core/AdminConsole/Models/Data/Organizations/Policies/IPolicyDataModel.cs rename src/Core/{ => AdminConsole}/Models/Data/Organizations/Policies/MasterPasswordPolicyData.cs (95%) rename src/Core/{ => AdminConsole}/Models/Data/Organizations/Policies/ResetPasswordDataModel.cs (75%) rename src/Core/{ => AdminConsole}/Models/Data/Organizations/Policies/SendOptionsPolicyData.cs (74%) rename src/Core/{ => AdminConsole}/Models/Data/Organizations/SelfHostedOrganizationDetails.cs (96%) rename src/Core/{ => AdminConsole}/Models/Data/Provider/ProviderAbility.cs (70%) rename src/Core/{ => AdminConsole}/Models/Data/Provider/ProviderOrganizationOrganizationDetails.cs (85%) rename src/Core/{ => AdminConsole}/Models/Data/Provider/ProviderOrganizationProviderDetails.cs (72%) rename src/Core/{ => AdminConsole}/Models/Data/Provider/ProviderUserOrganizationDetails.cs (89%) rename src/Core/{ => AdminConsole}/Models/Data/Provider/ProviderUserProviderDetails.cs (82%) rename src/Core/{ => AdminConsole}/Models/Data/Provider/ProviderUserPublicKey.cs (72%) rename src/Core/{ => AdminConsole}/Models/Data/Provider/ProviderUserUserDetails.cs (78%) rename src/Core/{ => AdminConsole}/OrganizationFeatures/Groups/CreateGroupCommand.cs (89%) rename src/Core/{ => AdminConsole}/OrganizationFeatures/Groups/DeleteGroupCommand.cs (89%) rename src/Core/{ => AdminConsole}/OrganizationFeatures/Groups/Interfaces/ICreateGroupCommand.cs (77%) rename src/Core/{ => AdminConsole}/OrganizationFeatures/Groups/Interfaces/IDeleteGroupCommand.cs (68%) rename src/Core/{ => AdminConsole}/OrganizationFeatures/Groups/Interfaces/IUpdateGroupCommand.cs (77%) rename src/Core/{ => AdminConsole}/OrganizationFeatures/Groups/UpdateGroupCommand.cs (89%) rename src/Core/{ => AdminConsole}/OrganizationFeatures/OrganizationApiKeys/CreateOrganizationApiKeyCommand.cs (75%) rename src/Core/{ => AdminConsole}/OrganizationFeatures/OrganizationApiKeys/GetOrganizationApiKeyQuery.cs (77%) rename src/Core/{ => AdminConsole}/OrganizationFeatures/OrganizationApiKeys/Interfaces/ICreateOrganizationApiKeyCommand.cs (50%) rename src/Core/{ => AdminConsole}/OrganizationFeatures/OrganizationApiKeys/Interfaces/IGetOrganizationApiKeyQuery.cs (51%) create mode 100644 src/Core/AdminConsole/OrganizationFeatures/OrganizationApiKeys/Interfaces/IRotateOrganizationApiKeyCommand.cs rename src/Core/{ => AdminConsole}/OrganizationFeatures/OrganizationApiKeys/RotateOrganizationApiKeyCommand.cs (74%) rename src/Core/AdminConsole/{ => OrganizationFeatures}/OrganizationAuth/Interfaces/IUpdateOrganizationAuthRequestCommand.cs (65%) rename src/Core/AdminConsole/{ => OrganizationFeatures}/OrganizationAuth/UpdateOrganizationAuthRequestCommand.cs (93%) rename src/Core/{ => AdminConsole}/OrganizationFeatures/OrganizationUsers/CountNewSmSeatsRequiredQuery.cs (87%) rename src/Core/{ => AdminConsole}/OrganizationFeatures/OrganizationUsers/DeleteOrganizationUserCommand.cs (85%) rename src/Core/{ => AdminConsole}/OrganizationFeatures/OrganizationUsers/Interfaces/ICountNewSmSeatsRequiredQuery.cs (61%) rename src/Core/{ => AdminConsole}/OrganizationFeatures/OrganizationUsers/Interfaces/IDeleteOrganizationUserCommand.cs (77%) rename src/Core/{ => AdminConsole}/OrganizationFeatures/OrganizationUsers/Interfaces/IUpdateOrganizationUserGroupsCommand.cs (54%) rename src/Core/{ => AdminConsole}/OrganizationFeatures/OrganizationUsers/UpdateOrganizationUserGroupsCommand.cs (81%) rename src/Core/{ => AdminConsole}/Providers/Interfaces/ICreateProviderCommand.cs (60%) rename src/Core/{ => AdminConsole}/Repositories/IGroupRepository.cs (90%) rename src/Core/{ => AdminConsole}/Repositories/IOrganizationApiKeyRepository.cs (60%) rename src/Core/{ => AdminConsole}/Repositories/IOrganizationRepository.cs (81%) rename src/Core/{ => AdminConsole}/Repositories/IOrganizationUserRepository.cs (93%) rename src/Core/{ => AdminConsole}/Repositories/IPolicyRepository.cs (66%) rename src/Core/{ => AdminConsole}/Repositories/IProviderOrganizationRepository.cs (76%) rename src/Core/{ => AdminConsole}/Repositories/IProviderRepository.cs (63%) rename src/Core/{ => AdminConsole}/Repositories/IProviderUserRepository.cs (85%) rename src/Core/{ => AdminConsole}/Services/IApplicationCacheService.cs (62%) rename src/Core/{ => AdminConsole}/Services/IGroupService.cs (85%) rename src/Core/{ => AdminConsole}/Services/IOrganizationService.cs (94%) rename src/Core/{ => AdminConsole}/Services/IPolicyService.cs (70%) rename src/Core/{ => AdminConsole}/Services/IProviderService.cs (87%) rename src/Core/{ => AdminConsole}/Services/Implementations/GroupService.cs (93%) rename src/Core/{ => AdminConsole}/Services/Implementations/InMemoryApplicationCacheService.cs (91%) rename src/Core/{ => AdminConsole}/Services/Implementations/InMemoryServiceBusApplicationCacheService.cs (94%) rename src/Core/{ => AdminConsole}/Services/Implementations/OrganizationService.cs (99%) rename src/Core/{ => AdminConsole}/Services/Implementations/PolicyService.cs (93%) rename src/Core/{ => AdminConsole}/Services/NoopImplementations/NoopProviderService.cs (90%) delete mode 100644 src/Core/Models/Data/Organizations/Policies/IPolicyDataModel.cs delete mode 100644 src/Core/OrganizationFeatures/OrganizationApiKeys/Interfaces/IRotateOrganizationApiKeyCommand.cs diff --git a/bitwarden_license/src/Commercial.Core/Providers/CreateProviderCommand.cs b/bitwarden_license/src/Commercial.Core/Providers/CreateProviderCommand.cs index 36b6fe85c86e..e78f9b18bd1d 100644 --- a/bitwarden_license/src/Commercial.Core/Providers/CreateProviderCommand.cs +++ b/bitwarden_license/src/Commercial.Core/Providers/CreateProviderCommand.cs @@ -1,7 +1,9 @@ -using Bit.Core.Entities.Provider; -using Bit.Core.Enums.Provider; +using Bit.Core.AdminConsole.Entities.Provider; +using Bit.Core.AdminConsole.Enums.Provider; +using Bit.Core.AdminConsole.Providers.Interfaces; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; using Bit.Core.Exceptions; -using Bit.Core.Providers.Interfaces; using Bit.Core.Repositories; using Bit.Core.Services; diff --git a/bitwarden_license/src/Commercial.Core/SecretsManager/AuthorizationHandlers/AccessPolicies/AccessPolicyAuthorizationHandler.cs b/bitwarden_license/src/Commercial.Core/SecretsManager/AuthorizationHandlers/AccessPolicies/AccessPolicyAuthorizationHandler.cs index 2915b4393067..4cb90223e39f 100644 --- a/bitwarden_license/src/Commercial.Core/SecretsManager/AuthorizationHandlers/AccessPolicies/AccessPolicyAuthorizationHandler.cs +++ b/bitwarden_license/src/Commercial.Core/SecretsManager/AuthorizationHandlers/AccessPolicies/AccessPolicyAuthorizationHandler.cs @@ -1,4 +1,5 @@ -using Bit.Core.Context; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.Context; using Bit.Core.Enums; using Bit.Core.Repositories; using Bit.Core.SecretsManager.AuthorizationRequirements; diff --git a/bitwarden_license/src/Commercial.Core/SecretsManager/Commands/Projects/CreateProjectCommand.cs b/bitwarden_license/src/Commercial.Core/SecretsManager/Commands/Projects/CreateProjectCommand.cs index ad05ffc5ec4b..58abdb63cf2a 100644 --- a/bitwarden_license/src/Commercial.Core/SecretsManager/Commands/Projects/CreateProjectCommand.cs +++ b/bitwarden_license/src/Commercial.Core/SecretsManager/Commands/Projects/CreateProjectCommand.cs @@ -1,4 +1,5 @@ -using Bit.Core.Context; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.Context; using Bit.Core.Exceptions; using Bit.Core.Identity; using Bit.Core.Repositories; diff --git a/bitwarden_license/src/Commercial.Core/SecretsManager/Commands/ServiceAccounts/CreateServiceAccountCommand.cs b/bitwarden_license/src/Commercial.Core/SecretsManager/Commands/ServiceAccounts/CreateServiceAccountCommand.cs index 687291d75a05..58a6d00bfaed 100644 --- a/bitwarden_license/src/Commercial.Core/SecretsManager/Commands/ServiceAccounts/CreateServiceAccountCommand.cs +++ b/bitwarden_license/src/Commercial.Core/SecretsManager/Commands/ServiceAccounts/CreateServiceAccountCommand.cs @@ -1,4 +1,5 @@ -using Bit.Core.Repositories; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.Repositories; using Bit.Core.SecretsManager.Commands.ServiceAccounts.Interfaces; using Bit.Core.SecretsManager.Entities; using Bit.Core.SecretsManager.Repositories; diff --git a/bitwarden_license/src/Commercial.Core/SecretsManager/Queries/Projects/MaxProjectsQuery.cs b/bitwarden_license/src/Commercial.Core/SecretsManager/Queries/Projects/MaxProjectsQuery.cs index 7afad6e82aa8..efdf2775f9a0 100644 --- a/bitwarden_license/src/Commercial.Core/SecretsManager/Queries/Projects/MaxProjectsQuery.cs +++ b/bitwarden_license/src/Commercial.Core/SecretsManager/Queries/Projects/MaxProjectsQuery.cs @@ -1,4 +1,5 @@ -using Bit.Core.Enums; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.Enums; using Bit.Core.Exceptions; using Bit.Core.Repositories; using Bit.Core.SecretsManager.Queries.Projects.Interfaces; diff --git a/bitwarden_license/src/Commercial.Core/SecretsManager/Queries/ServiceAccounts/CountNewServiceAccountSlotsRequiredQuery.cs b/bitwarden_license/src/Commercial.Core/SecretsManager/Queries/ServiceAccounts/CountNewServiceAccountSlotsRequiredQuery.cs index cbb8b98f8cbd..d123e309e969 100644 --- a/bitwarden_license/src/Commercial.Core/SecretsManager/Queries/ServiceAccounts/CountNewServiceAccountSlotsRequiredQuery.cs +++ b/bitwarden_license/src/Commercial.Core/SecretsManager/Queries/ServiceAccounts/CountNewServiceAccountSlotsRequiredQuery.cs @@ -1,4 +1,5 @@ -using Bit.Core.Exceptions; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.Exceptions; using Bit.Core.Repositories; using Bit.Core.SecretsManager.Queries.ServiceAccounts.Interfaces; using Bit.Core.SecretsManager.Repositories; diff --git a/bitwarden_license/src/Commercial.Core/Services/ProviderService.cs b/bitwarden_license/src/Commercial.Core/Services/ProviderService.cs index d186eb6d4153..dabbe6d47ff3 100644 --- a/bitwarden_license/src/Commercial.Core/Services/ProviderService.cs +++ b/bitwarden_license/src/Commercial.Core/Services/ProviderService.cs @@ -1,11 +1,15 @@ -using Bit.Core.Context; +using Bit.Core.AdminConsole.Entities.Provider; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Enums.Provider; +using Bit.Core.AdminConsole.Models.Business; +using Bit.Core.AdminConsole.Models.Business.Provider; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; +using Bit.Core.Context; using Bit.Core.Entities; -using Bit.Core.Entities.Provider; using Bit.Core.Enums; -using Bit.Core.Enums.Provider; using Bit.Core.Exceptions; using Bit.Core.Models.Business; -using Bit.Core.Models.Business.Provider; using Bit.Core.Models.Data; using Bit.Core.Repositories; using Bit.Core.Services; diff --git a/bitwarden_license/src/Commercial.Core/Utilities/ServiceCollectionExtensions.cs b/bitwarden_license/src/Commercial.Core/Utilities/ServiceCollectionExtensions.cs index b9d21915bf59..1d8bb7ce083f 100644 --- a/bitwarden_license/src/Commercial.Core/Utilities/ServiceCollectionExtensions.cs +++ b/bitwarden_license/src/Commercial.Core/Utilities/ServiceCollectionExtensions.cs @@ -1,6 +1,7 @@ using Bit.Commercial.Core.Providers; using Bit.Commercial.Core.Services; -using Bit.Core.Providers.Interfaces; +using Bit.Core.AdminConsole.Providers.Interfaces; +using Bit.Core.AdminConsole.Services; using Bit.Core.Services; using Microsoft.Extensions.DependencyInjection; diff --git a/bitwarden_license/src/Scim/Context/IScimContext.cs b/bitwarden_license/src/Scim/Context/IScimContext.cs index 79bc387b4725..091836bf7f7f 100644 --- a/bitwarden_license/src/Scim/Context/IScimContext.cs +++ b/bitwarden_license/src/Scim/Context/IScimContext.cs @@ -1,5 +1,7 @@ -using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; using Bit.Core.AdminConsole.Models.OrganizationConnectionConfigs; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Entities; using Bit.Core.Repositories; using Bit.Core.Settings; diff --git a/bitwarden_license/src/Scim/Context/ScimContext.cs b/bitwarden_license/src/Scim/Context/ScimContext.cs index e22d461f89e5..4ad70fa54612 100644 --- a/bitwarden_license/src/Scim/Context/ScimContext.cs +++ b/bitwarden_license/src/Scim/Context/ScimContext.cs @@ -1,5 +1,7 @@ -using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; using Bit.Core.AdminConsole.Models.OrganizationConnectionConfigs; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Repositories; diff --git a/bitwarden_license/src/Scim/Controllers/v2/GroupsController.cs b/bitwarden_license/src/Scim/Controllers/v2/GroupsController.cs index 68bdf8f2999f..5df0b2921644 100644 --- a/bitwarden_license/src/Scim/Controllers/v2/GroupsController.cs +++ b/bitwarden_license/src/Scim/Controllers/v2/GroupsController.cs @@ -1,6 +1,7 @@ -using Bit.Core.Enums; +using Bit.Core.AdminConsole.OrganizationFeatures.Groups.Interfaces; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.Enums; using Bit.Core.Exceptions; -using Bit.Core.OrganizationFeatures.Groups.Interfaces; using Bit.Core.Repositories; using Bit.Scim.Groups.Interfaces; using Bit.Scim.Models; diff --git a/bitwarden_license/src/Scim/Controllers/v2/UsersController.cs b/bitwarden_license/src/Scim/Controllers/v2/UsersController.cs index 22b8a22c8543..27b657cb3183 100644 --- a/bitwarden_license/src/Scim/Controllers/v2/UsersController.cs +++ b/bitwarden_license/src/Scim/Controllers/v2/UsersController.cs @@ -1,6 +1,9 @@ -using Bit.Core.Enums; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationUsers.Interfaces; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; +using Bit.Core.Enums; using Bit.Core.Exceptions; -using Bit.Core.OrganizationFeatures.OrganizationUsers.Interfaces; using Bit.Core.Repositories; using Bit.Core.Services; using Bit.Scim.Models; diff --git a/bitwarden_license/src/Scim/Groups/GetGroupsListQuery.cs b/bitwarden_license/src/Scim/Groups/GetGroupsListQuery.cs index 1afab3a0fc70..62478c646ccb 100644 --- a/bitwarden_license/src/Scim/Groups/GetGroupsListQuery.cs +++ b/bitwarden_license/src/Scim/Groups/GetGroupsListQuery.cs @@ -1,4 +1,6 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.Entities; using Bit.Core.Repositories; using Bit.Scim.Groups.Interfaces; diff --git a/bitwarden_license/src/Scim/Groups/Interfaces/IGetGroupsListQuery.cs b/bitwarden_license/src/Scim/Groups/Interfaces/IGetGroupsListQuery.cs index d2cf5ef0a21a..58e7a47a7832 100644 --- a/bitwarden_license/src/Scim/Groups/Interfaces/IGetGroupsListQuery.cs +++ b/bitwarden_license/src/Scim/Groups/Interfaces/IGetGroupsListQuery.cs @@ -1,4 +1,5 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Entities; namespace Bit.Scim.Groups.Interfaces; diff --git a/bitwarden_license/src/Scim/Groups/Interfaces/IPatchGroupCommand.cs b/bitwarden_license/src/Scim/Groups/Interfaces/IPatchGroupCommand.cs index 181f0c70ae44..ae8002333f56 100644 --- a/bitwarden_license/src/Scim/Groups/Interfaces/IPatchGroupCommand.cs +++ b/bitwarden_license/src/Scim/Groups/Interfaces/IPatchGroupCommand.cs @@ -1,4 +1,5 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Entities; using Bit.Scim.Models; namespace Bit.Scim.Groups.Interfaces; diff --git a/bitwarden_license/src/Scim/Groups/Interfaces/IPostGroupCommand.cs b/bitwarden_license/src/Scim/Groups/Interfaces/IPostGroupCommand.cs index 76e80f08dd87..011199f033ba 100644 --- a/bitwarden_license/src/Scim/Groups/Interfaces/IPostGroupCommand.cs +++ b/bitwarden_license/src/Scim/Groups/Interfaces/IPostGroupCommand.cs @@ -1,4 +1,5 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Entities; using Bit.Scim.Models; namespace Bit.Scim.Groups.Interfaces; diff --git a/bitwarden_license/src/Scim/Groups/Interfaces/IPutGroupCommand.cs b/bitwarden_license/src/Scim/Groups/Interfaces/IPutGroupCommand.cs index 052a4e554bad..8c0b9108c017 100644 --- a/bitwarden_license/src/Scim/Groups/Interfaces/IPutGroupCommand.cs +++ b/bitwarden_license/src/Scim/Groups/Interfaces/IPutGroupCommand.cs @@ -1,4 +1,5 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Entities; using Bit.Scim.Models; namespace Bit.Scim.Groups.Interfaces; diff --git a/bitwarden_license/src/Scim/Groups/PatchGroupCommand.cs b/bitwarden_license/src/Scim/Groups/PatchGroupCommand.cs index 750dcec46cda..33cec6b9b0c1 100644 --- a/bitwarden_license/src/Scim/Groups/PatchGroupCommand.cs +++ b/bitwarden_license/src/Scim/Groups/PatchGroupCommand.cs @@ -1,8 +1,11 @@ using System.Text.Json; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.OrganizationFeatures.Groups.Interfaces; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Exceptions; -using Bit.Core.OrganizationFeatures.Groups.Interfaces; using Bit.Core.Repositories; using Bit.Core.Services; using Bit.Scim.Groups.Interfaces; diff --git a/bitwarden_license/src/Scim/Groups/PostGroupCommand.cs b/bitwarden_license/src/Scim/Groups/PostGroupCommand.cs index 00da7a8d7c81..80ec5c5e3e4a 100644 --- a/bitwarden_license/src/Scim/Groups/PostGroupCommand.cs +++ b/bitwarden_license/src/Scim/Groups/PostGroupCommand.cs @@ -1,8 +1,10 @@ -using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.OrganizationFeatures.Groups.Interfaces; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Exceptions; -using Bit.Core.OrganizationFeatures.Groups.Interfaces; using Bit.Core.Repositories; using Bit.Scim.Context; using Bit.Scim.Groups.Interfaces; diff --git a/bitwarden_license/src/Scim/Groups/PutGroupCommand.cs b/bitwarden_license/src/Scim/Groups/PutGroupCommand.cs index 0310139ecbf8..29d1520874e8 100644 --- a/bitwarden_license/src/Scim/Groups/PutGroupCommand.cs +++ b/bitwarden_license/src/Scim/Groups/PutGroupCommand.cs @@ -1,8 +1,10 @@ -using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.OrganizationFeatures.Groups.Interfaces; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Exceptions; -using Bit.Core.OrganizationFeatures.Groups.Interfaces; using Bit.Core.Repositories; using Bit.Scim.Context; using Bit.Scim.Groups.Interfaces; diff --git a/bitwarden_license/src/Scim/Models/ScimGroupRequestModel.cs b/bitwarden_license/src/Scim/Models/ScimGroupRequestModel.cs index ac99eca2e9a7..998c0793a5d1 100644 --- a/bitwarden_license/src/Scim/Models/ScimGroupRequestModel.cs +++ b/bitwarden_license/src/Scim/Models/ScimGroupRequestModel.cs @@ -1,4 +1,5 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Entities; using Bit.Core.Utilities; namespace Bit.Scim.Models; diff --git a/bitwarden_license/src/Scim/Models/ScimGroupResponseModel.cs b/bitwarden_license/src/Scim/Models/ScimGroupResponseModel.cs index 7ba209df9ba4..24b7909615d0 100644 --- a/bitwarden_license/src/Scim/Models/ScimGroupResponseModel.cs +++ b/bitwarden_license/src/Scim/Models/ScimGroupResponseModel.cs @@ -1,4 +1,5 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Entities; namespace Bit.Scim.Models; diff --git a/bitwarden_license/src/Scim/Models/ScimUserResponseModel.cs b/bitwarden_license/src/Scim/Models/ScimUserResponseModel.cs index b028b8792e85..54f760cf340d 100644 --- a/bitwarden_license/src/Scim/Models/ScimUserResponseModel.cs +++ b/bitwarden_license/src/Scim/Models/ScimUserResponseModel.cs @@ -1,4 +1,5 @@ -using Bit.Core.Models.Data.Organizations.OrganizationUsers; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Models.Data.Organizations.OrganizationUsers; namespace Bit.Scim.Models; @@ -20,7 +21,7 @@ public ScimUserResponseModel(OrganizationUserUserDetails orgUser) DisplayName = orgUser.Name; Emails = new List { new EmailModel(orgUser.Email) }; Name = new NameModel(orgUser.Name); - Active = orgUser.Status != Core.Enums.OrganizationUserStatusType.Revoked; + Active = orgUser.Status != OrganizationUserStatusType.Revoked; } public Guid Id { get; set; } diff --git a/bitwarden_license/src/Scim/Users/GetUsersListQuery.cs b/bitwarden_license/src/Scim/Users/GetUsersListQuery.cs index 51250250fe92..93b3ff8e0948 100644 --- a/bitwarden_license/src/Scim/Users/GetUsersListQuery.cs +++ b/bitwarden_license/src/Scim/Users/GetUsersListQuery.cs @@ -1,4 +1,5 @@ -using Bit.Core.Models.Data.Organizations.OrganizationUsers; +using Bit.Core.AdminConsole.Models.Data.Organizations.OrganizationUsers; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Repositories; using Bit.Scim.Users.Interfaces; diff --git a/bitwarden_license/src/Scim/Users/Interfaces/IGetUsersListQuery.cs b/bitwarden_license/src/Scim/Users/Interfaces/IGetUsersListQuery.cs index 265c6a8e793d..621dc3a88eb5 100644 --- a/bitwarden_license/src/Scim/Users/Interfaces/IGetUsersListQuery.cs +++ b/bitwarden_license/src/Scim/Users/Interfaces/IGetUsersListQuery.cs @@ -1,4 +1,4 @@ -using Bit.Core.Models.Data.Organizations.OrganizationUsers; +using Bit.Core.AdminConsole.Models.Data.Organizations.OrganizationUsers; namespace Bit.Scim.Users.Interfaces; diff --git a/bitwarden_license/src/Scim/Users/Interfaces/IPostUserCommand.cs b/bitwarden_license/src/Scim/Users/Interfaces/IPostUserCommand.cs index 05dd05510c40..1f6e186fa1a4 100644 --- a/bitwarden_license/src/Scim/Users/Interfaces/IPostUserCommand.cs +++ b/bitwarden_license/src/Scim/Users/Interfaces/IPostUserCommand.cs @@ -1,4 +1,4 @@ -using Bit.Core.Models.Data.Organizations.OrganizationUsers; +using Bit.Core.AdminConsole.Models.Data.Organizations.OrganizationUsers; using Bit.Scim.Models; namespace Bit.Scim.Users.Interfaces; diff --git a/bitwarden_license/src/Scim/Users/PatchUserCommand.cs b/bitwarden_license/src/Scim/Users/PatchUserCommand.cs index 075807a58b61..cc7bf0f6fe4f 100644 --- a/bitwarden_license/src/Scim/Users/PatchUserCommand.cs +++ b/bitwarden_license/src/Scim/Users/PatchUserCommand.cs @@ -1,4 +1,8 @@ -using Bit.Core.Enums; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; +using Bit.Core.Enums; using Bit.Core.Exceptions; using Bit.Core.Repositories; using Bit.Core.Services; @@ -70,7 +74,7 @@ public async Task PatchUserAsync(Guid organizationId, Guid id, ScimPatchModel mo } } - private async Task HandleActiveOperationAsync(Core.Entities.OrganizationUser orgUser, bool active) + private async Task HandleActiveOperationAsync(OrganizationUser orgUser, bool active) { if (active && orgUser.Status == OrganizationUserStatusType.Revoked) { diff --git a/bitwarden_license/src/Scim/Users/PostUserCommand.cs b/bitwarden_license/src/Scim/Users/PostUserCommand.cs index 920ca6c77bc8..9aa01da3abb8 100644 --- a/bitwarden_license/src/Scim/Users/PostUserCommand.cs +++ b/bitwarden_license/src/Scim/Users/PostUserCommand.cs @@ -1,8 +1,10 @@ using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Models.Data.Organizations.OrganizationUsers; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; using Bit.Core.Enums; using Bit.Core.Exceptions; using Bit.Core.Models.Data; -using Bit.Core.Models.Data.Organizations.OrganizationUsers; using Bit.Core.Repositories; using Bit.Core.Services; using Bit.Core.Utilities; diff --git a/bitwarden_license/src/Scim/Utilities/ApiKeyAuthenticationHandler.cs b/bitwarden_license/src/Scim/Utilities/ApiKeyAuthenticationHandler.cs index 4e7e7ceb7aea..6446d010853b 100644 --- a/bitwarden_license/src/Scim/Utilities/ApiKeyAuthenticationHandler.cs +++ b/bitwarden_license/src/Scim/Utilities/ApiKeyAuthenticationHandler.cs @@ -1,5 +1,7 @@ using System.Security.Claims; using System.Text.Encodings.Web; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Enums; using Bit.Core.Repositories; using Bit.Scim.Context; diff --git a/bitwarden_license/src/Scim/Utilities/ScimContextMiddleware.cs b/bitwarden_license/src/Scim/Utilities/ScimContextMiddleware.cs index 6d5f3e1bf2c9..48d25e6c53d1 100644 --- a/bitwarden_license/src/Scim/Utilities/ScimContextMiddleware.cs +++ b/bitwarden_license/src/Scim/Utilities/ScimContextMiddleware.cs @@ -1,4 +1,5 @@ -using Bit.Core.Repositories; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.Repositories; using Bit.Core.Settings; using Bit.Scim.Context; diff --git a/bitwarden_license/src/Sso/Controllers/AccountController.cs b/bitwarden_license/src/Sso/Controllers/AccountController.cs index 40d4d1f42a0d..71a9b4271706 100644 --- a/bitwarden_license/src/Sso/Controllers/AccountController.cs +++ b/bitwarden_license/src/Sso/Controllers/AccountController.cs @@ -1,5 +1,9 @@ using System.Security.Claims; using Bit.Core; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; using Bit.Core.Auth.Entities; using Bit.Core.Auth.Enums; using Bit.Core.Auth.Models; diff --git a/bitwarden_license/test/Commercial.Core.Test/AutoFixture/ProviderUserFixtures.cs b/bitwarden_license/test/Commercial.Core.Test/AutoFixture/ProviderUserFixtures.cs index 48f70c335066..4f28e705e61f 100644 --- a/bitwarden_license/test/Commercial.Core.Test/AutoFixture/ProviderUserFixtures.cs +++ b/bitwarden_license/test/Commercial.Core.Test/AutoFixture/ProviderUserFixtures.cs @@ -1,7 +1,7 @@ using System.Reflection; using AutoFixture; using AutoFixture.Xunit2; -using Bit.Core.Enums.Provider; +using Bit.Core.AdminConsole.Enums.Provider; namespace Bit.Commercial.Core.Test.AutoFixture; @@ -18,7 +18,7 @@ public ProviderUser(ProviderUserStatusType status, ProviderUserType type) public void Customize(IFixture fixture) { - fixture.Customize(composer => composer + fixture.Customize(composer => composer .With(o => o.Type, Type) .With(o => o.Status, Status)); } diff --git a/bitwarden_license/test/Commercial.Core.Test/ProviderFeatures/CreateProviderCommandTests.cs b/bitwarden_license/test/Commercial.Core.Test/ProviderFeatures/CreateProviderCommandTests.cs index 721ed24d9c2a..c8b7c71ef72a 100644 --- a/bitwarden_license/test/Commercial.Core.Test/ProviderFeatures/CreateProviderCommandTests.cs +++ b/bitwarden_license/test/Commercial.Core.Test/ProviderFeatures/CreateProviderCommandTests.cs @@ -1,7 +1,9 @@ using Bit.Commercial.Core.Providers; +using Bit.Core.AdminConsole.Entities.Provider; +using Bit.Core.AdminConsole.Enums.Provider; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; using Bit.Core.Entities; -using Bit.Core.Entities.Provider; -using Bit.Core.Enums.Provider; using Bit.Core.Exceptions; using Bit.Core.Repositories; using Bit.Core.Services; diff --git a/bitwarden_license/test/Commercial.Core.Test/SecretsManager/AuthorizationHandlers/AccessPolicies/AccessPolicyAuthorizationHandlerTests.cs b/bitwarden_license/test/Commercial.Core.Test/SecretsManager/AuthorizationHandlers/AccessPolicies/AccessPolicyAuthorizationHandlerTests.cs index 6f95f3c45118..b6779394c1d4 100644 --- a/bitwarden_license/test/Commercial.Core.Test/SecretsManager/AuthorizationHandlers/AccessPolicies/AccessPolicyAuthorizationHandlerTests.cs +++ b/bitwarden_license/test/Commercial.Core.Test/SecretsManager/AuthorizationHandlers/AccessPolicies/AccessPolicyAuthorizationHandlerTests.cs @@ -2,6 +2,8 @@ using System.Security.Claims; using Bit.Commercial.Core.SecretsManager.AuthorizationHandlers.AccessPolicies; using Bit.Commercial.Core.Test.SecretsManager.Enums; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Context; using Bit.Core.Entities; using Bit.Core.Enums; diff --git a/bitwarden_license/test/Commercial.Core.Test/SecretsManager/Commands/Projects/CreateProjectCommandTests.cs b/bitwarden_license/test/Commercial.Core.Test/SecretsManager/Commands/Projects/CreateProjectCommandTests.cs index 9f9fbf35e425..01793cbe3990 100644 --- a/bitwarden_license/test/Commercial.Core.Test/SecretsManager/Commands/Projects/CreateProjectCommandTests.cs +++ b/bitwarden_license/test/Commercial.Core.Test/SecretsManager/Commands/Projects/CreateProjectCommandTests.cs @@ -1,4 +1,6 @@ using Bit.Commercial.Core.SecretsManager.Commands.Projects; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Context; using Bit.Core.Entities; using Bit.Core.Repositories; diff --git a/bitwarden_license/test/Commercial.Core.Test/SecretsManager/Commands/ServiceAccounts/CreateServiceAccountCommandTests.cs b/bitwarden_license/test/Commercial.Core.Test/SecretsManager/Commands/ServiceAccounts/CreateServiceAccountCommandTests.cs index 85a347ff2b33..f04478d7fc1a 100644 --- a/bitwarden_license/test/Commercial.Core.Test/SecretsManager/Commands/ServiceAccounts/CreateServiceAccountCommandTests.cs +++ b/bitwarden_license/test/Commercial.Core.Test/SecretsManager/Commands/ServiceAccounts/CreateServiceAccountCommandTests.cs @@ -1,4 +1,6 @@ using Bit.Commercial.Core.SecretsManager.Commands.ServiceAccounts; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Entities; using Bit.Core.Repositories; using Bit.Core.SecretsManager.Entities; diff --git a/bitwarden_license/test/Commercial.Core.Test/SecretsManager/Queries/Projects/MaxProjectsQueryTests.cs b/bitwarden_license/test/Commercial.Core.Test/SecretsManager/Queries/Projects/MaxProjectsQueryTests.cs index 79ffb421e1b3..ad20d54edf5b 100644 --- a/bitwarden_license/test/Commercial.Core.Test/SecretsManager/Queries/Projects/MaxProjectsQueryTests.cs +++ b/bitwarden_license/test/Commercial.Core.Test/SecretsManager/Queries/Projects/MaxProjectsQueryTests.cs @@ -1,4 +1,6 @@ using Bit.Commercial.Core.SecretsManager.Queries.Projects; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Exceptions; diff --git a/bitwarden_license/test/Commercial.Core.Test/SecretsManager/Queries/ServiceAccounts/CountNewServiceAccountSlotsRequiredQueryTests.cs b/bitwarden_license/test/Commercial.Core.Test/SecretsManager/Queries/ServiceAccounts/CountNewServiceAccountSlotsRequiredQueryTests.cs index 21c91920a9dc..a6470e03a662 100644 --- a/bitwarden_license/test/Commercial.Core.Test/SecretsManager/Queries/ServiceAccounts/CountNewServiceAccountSlotsRequiredQueryTests.cs +++ b/bitwarden_license/test/Commercial.Core.Test/SecretsManager/Queries/ServiceAccounts/CountNewServiceAccountSlotsRequiredQueryTests.cs @@ -1,4 +1,6 @@ using Bit.Commercial.Core.SecretsManager.Queries.ServiceAccounts; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Entities; using Bit.Core.Exceptions; using Bit.Core.Repositories; diff --git a/bitwarden_license/test/Commercial.Core.Test/Services/ProviderServiceTests.cs b/bitwarden_license/test/Commercial.Core.Test/Services/ProviderServiceTests.cs index 2a6e68bfb422..2bbdc58c69a4 100644 --- a/bitwarden_license/test/Commercial.Core.Test/Services/ProviderServiceTests.cs +++ b/bitwarden_license/test/Commercial.Core.Test/Services/ProviderServiceTests.cs @@ -1,13 +1,18 @@ using Bit.Commercial.Core.Services; using Bit.Commercial.Core.Test.AutoFixture; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Entities.Provider; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Enums.Provider; +using Bit.Core.AdminConsole.Models.Business; +using Bit.Core.AdminConsole.Models.Business.Provider; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; using Bit.Core.Context; using Bit.Core.Entities; -using Bit.Core.Entities.Provider; using Bit.Core.Enums; -using Bit.Core.Enums.Provider; using Bit.Core.Exceptions; using Bit.Core.Models.Business; -using Bit.Core.Models.Business.Provider; using Bit.Core.Repositories; using Bit.Core.Services; using Bit.Core.Utilities; @@ -17,8 +22,8 @@ using NSubstitute; using NSubstitute.ReturnsExtensions; using Xunit; -using Provider = Bit.Core.Entities.Provider.Provider; -using ProviderUser = Bit.Core.Entities.Provider.ProviderUser; +using Provider = Bit.Core.AdminConsole.Entities.Provider.Provider; +using ProviderUser = Bit.Core.AdminConsole.Entities.Provider.ProviderUser; namespace Bit.Commercial.Core.Test.Services; diff --git a/bitwarden_license/test/Scim.IntegrationTest/Controllers/v2/UsersControllerTests.cs b/bitwarden_license/test/Scim.IntegrationTest/Controllers/v2/UsersControllerTests.cs index 5a025a2c8c0b..717fff3d8d92 100644 --- a/bitwarden_license/test/Scim.IntegrationTest/Controllers/v2/UsersControllerTests.cs +++ b/bitwarden_license/test/Scim.IntegrationTest/Controllers/v2/UsersControllerTests.cs @@ -1,4 +1,5 @@ using System.Text.Json; +using Bit.Core.AdminConsole.Enums; using Bit.Core.Enums; using Bit.Scim.IntegrationTest.Factories; using Bit.Scim.Models; diff --git a/bitwarden_license/test/Scim.IntegrationTest/Factories/ScimApplicationFactory.cs b/bitwarden_license/test/Scim.IntegrationTest/Factories/ScimApplicationFactory.cs index d88dc728d520..9b21e48405b0 100644 --- a/bitwarden_license/test/Scim.IntegrationTest/Factories/ScimApplicationFactory.cs +++ b/bitwarden_license/test/Scim.IntegrationTest/Factories/ScimApplicationFactory.cs @@ -3,6 +3,7 @@ using System.Text; using System.Text.Encodings.Web; using System.Text.Json; +using Bit.Core.AdminConsole.Enums; using Bit.Core.Services; using Bit.Infrastructure.EntityFramework.Repositories; using Bit.IntegrationTestCommon.Factories; @@ -208,10 +209,10 @@ public void ReinitializeDbForTests(DatabaseContext databaseContext) { return new List() { - new Infrastructure.EntityFramework.Models.OrganizationUser { Id = TestOrganizationUserId1, OrganizationId = TestOrganizationId1, UserId = TestUserId1, Status = Core.Enums.OrganizationUserStatusType.Confirmed, ExternalId = "UA", Email = "user1@example.com" }, - new Infrastructure.EntityFramework.Models.OrganizationUser { Id = TestOrganizationUserId2, OrganizationId = TestOrganizationId1, UserId = TestUserId2, Status = Core.Enums.OrganizationUserStatusType.Confirmed, ExternalId = "UB", Email = "user2@example.com" }, - new Infrastructure.EntityFramework.Models.OrganizationUser { Id = TestOrganizationUserId3, OrganizationId = TestOrganizationId1, UserId = TestUserId3, Status = Core.Enums.OrganizationUserStatusType.Revoked, ExternalId = "UC", Email = "user3@example.com" }, - new Infrastructure.EntityFramework.Models.OrganizationUser { Id = TestOrganizationUserId4, OrganizationId = TestOrganizationId1, UserId = TestUserId4, Status = Core.Enums.OrganizationUserStatusType.Confirmed, ExternalId = "UD", Email = "user4@example.com" }, + new Infrastructure.EntityFramework.Models.OrganizationUser { Id = TestOrganizationUserId1, OrganizationId = TestOrganizationId1, UserId = TestUserId1, Status = OrganizationUserStatusType.Confirmed, ExternalId = "UA", Email = "user1@example.com" }, + new Infrastructure.EntityFramework.Models.OrganizationUser { Id = TestOrganizationUserId2, OrganizationId = TestOrganizationId1, UserId = TestUserId2, Status = OrganizationUserStatusType.Confirmed, ExternalId = "UB", Email = "user2@example.com" }, + new Infrastructure.EntityFramework.Models.OrganizationUser { Id = TestOrganizationUserId3, OrganizationId = TestOrganizationId1, UserId = TestUserId3, Status = OrganizationUserStatusType.Revoked, ExternalId = "UC", Email = "user3@example.com" }, + new Infrastructure.EntityFramework.Models.OrganizationUser { Id = TestOrganizationUserId4, OrganizationId = TestOrganizationId1, UserId = TestUserId4, Status = OrganizationUserStatusType.Confirmed, ExternalId = "UD", Email = "user4@example.com" }, }; } diff --git a/bitwarden_license/test/Scim.Test/Groups/GetGroupsListQueryTests.cs b/bitwarden_license/test/Scim.Test/Groups/GetGroupsListQueryTests.cs index fa8997580c33..9a3a9dfb3507 100644 --- a/bitwarden_license/test/Scim.Test/Groups/GetGroupsListQueryTests.cs +++ b/bitwarden_license/test/Scim.Test/Groups/GetGroupsListQueryTests.cs @@ -1,4 +1,6 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.Entities; using Bit.Core.Repositories; using Bit.Scim.Groups; using Bit.Test.Common.AutoFixture; diff --git a/bitwarden_license/test/Scim.Test/Groups/PatchGroupCommandTests.cs b/bitwarden_license/test/Scim.Test/Groups/PatchGroupCommandTests.cs index 505a67f570ff..7bf6da311520 100644 --- a/bitwarden_license/test/Scim.Test/Groups/PatchGroupCommandTests.cs +++ b/bitwarden_license/test/Scim.Test/Groups/PatchGroupCommandTests.cs @@ -1,8 +1,11 @@ using System.Text.Json; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.OrganizationFeatures.Groups.Interfaces; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Exceptions; -using Bit.Core.OrganizationFeatures.Groups.Interfaces; using Bit.Core.Repositories; using Bit.Core.Services; using Bit.Scim.Groups; diff --git a/bitwarden_license/test/Scim.Test/Groups/PostGroupCommandTests.cs b/bitwarden_license/test/Scim.Test/Groups/PostGroupCommandTests.cs index 40281e4d1b32..86846607c3e8 100644 --- a/bitwarden_license/test/Scim.Test/Groups/PostGroupCommandTests.cs +++ b/bitwarden_license/test/Scim.Test/Groups/PostGroupCommandTests.cs @@ -1,8 +1,10 @@ -using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.OrganizationFeatures.Groups.Interfaces; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Exceptions; -using Bit.Core.OrganizationFeatures.Groups.Interfaces; using Bit.Core.Repositories; using Bit.Scim.Context; using Bit.Scim.Groups; diff --git a/bitwarden_license/test/Scim.Test/Groups/PutGroupCommandTests.cs b/bitwarden_license/test/Scim.Test/Groups/PutGroupCommandTests.cs index ecf77d563b9b..9aee0dee1d4a 100644 --- a/bitwarden_license/test/Scim.Test/Groups/PutGroupCommandTests.cs +++ b/bitwarden_license/test/Scim.Test/Groups/PutGroupCommandTests.cs @@ -1,8 +1,10 @@ -using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.OrganizationFeatures.Groups.Interfaces; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Exceptions; -using Bit.Core.OrganizationFeatures.Groups.Interfaces; using Bit.Core.Repositories; using Bit.Scim.Context; using Bit.Scim.Groups; diff --git a/bitwarden_license/test/Scim.Test/Users/GetUsersListQueryTests.cs b/bitwarden_license/test/Scim.Test/Users/GetUsersListQueryTests.cs index b7497e281d7f..cd53eaa305c8 100644 --- a/bitwarden_license/test/Scim.Test/Users/GetUsersListQueryTests.cs +++ b/bitwarden_license/test/Scim.Test/Users/GetUsersListQueryTests.cs @@ -1,4 +1,5 @@ -using Bit.Core.Models.Data.Organizations.OrganizationUsers; +using Bit.Core.AdminConsole.Models.Data.Organizations.OrganizationUsers; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Repositories; using Bit.Scim.Users; using Bit.Test.Common.AutoFixture; diff --git a/bitwarden_license/test/Scim.Test/Users/PatchUserCommandTests.cs b/bitwarden_license/test/Scim.Test/Users/PatchUserCommandTests.cs index 977011b35de2..9c1f1efec8f5 100644 --- a/bitwarden_license/test/Scim.Test/Users/PatchUserCommandTests.cs +++ b/bitwarden_license/test/Scim.Test/Users/PatchUserCommandTests.cs @@ -1,4 +1,8 @@ using System.Text.Json; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Exceptions; @@ -21,7 +25,7 @@ public class PatchUserCommandTests [BitAutoData] public async Task PatchUser_RestorePath_Success(SutProvider sutProvider, OrganizationUser organizationUser) { - organizationUser.Status = Core.Enums.OrganizationUserStatusType.Revoked; + organizationUser.Status = OrganizationUserStatusType.Revoked; sutProvider.GetDependency() .GetByIdAsync(organizationUser.Id) @@ -50,7 +54,7 @@ public async Task PatchUser_RestorePath_Success(SutProvider su [BitAutoData] public async Task PatchUser_RestoreValue_Success(SutProvider sutProvider, OrganizationUser organizationUser) { - organizationUser.Status = Core.Enums.OrganizationUserStatusType.Revoked; + organizationUser.Status = OrganizationUserStatusType.Revoked; sutProvider.GetDependency() .GetByIdAsync(organizationUser.Id) @@ -78,7 +82,7 @@ public async Task PatchUser_RestoreValue_Success(SutProvider s [BitAutoData] public async Task PatchUser_RevokePath_Success(SutProvider sutProvider, OrganizationUser organizationUser) { - organizationUser.Status = Core.Enums.OrganizationUserStatusType.Confirmed; + organizationUser.Status = OrganizationUserStatusType.Confirmed; sutProvider.GetDependency() .GetByIdAsync(organizationUser.Id) @@ -107,7 +111,7 @@ public async Task PatchUser_RevokePath_Success(SutProvider sut [BitAutoData] public async Task PatchUser_RevokeValue_Success(SutProvider sutProvider, OrganizationUser organizationUser) { - organizationUser.Status = Core.Enums.OrganizationUserStatusType.Confirmed; + organizationUser.Status = OrganizationUserStatusType.Confirmed; sutProvider.GetDependency() .GetByIdAsync(organizationUser.Id) diff --git a/bitwarden_license/test/Scim.Test/Users/PostUserCommandTests.cs b/bitwarden_license/test/Scim.Test/Users/PostUserCommandTests.cs index 304a29070927..47d251cbfd78 100644 --- a/bitwarden_license/test/Scim.Test/Users/PostUserCommandTests.cs +++ b/bitwarden_license/test/Scim.Test/Users/PostUserCommandTests.cs @@ -1,7 +1,11 @@ -using Bit.Core.Enums; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Models.Data.Organizations.OrganizationUsers; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; +using Bit.Core.Enums; using Bit.Core.Exceptions; using Bit.Core.Models.Data; -using Bit.Core.Models.Data.Organizations.OrganizationUsers; using Bit.Core.Repositories; using Bit.Core.Services; using Bit.Scim.Models; @@ -19,7 +23,7 @@ public class PostUserCommandTests { [Theory] [BitAutoData] - public async Task PostUser_Success(SutProvider sutProvider, string externalId, Guid organizationId, List emails, ICollection organizationUsers, Core.Entities.OrganizationUser newUser) + public async Task PostUser_Success(SutProvider sutProvider, string externalId, Guid organizationId, List emails, ICollection organizationUsers, OrganizationUser newUser) { var scimUserRequestModel = new ScimUserRequestModel { diff --git a/src/Admin/Controllers/OrganizationsController.cs b/src/Admin/Controllers/OrganizationsController.cs index 7c296dd3c6ab..2d2d4a6df87f 100644 --- a/src/Admin/Controllers/OrganizationsController.cs +++ b/src/Admin/Controllers/OrganizationsController.cs @@ -2,6 +2,10 @@ using Bit.Admin.Models; using Bit.Admin.Services; using Bit.Admin.Utilities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; using Bit.Core.Context; using Bit.Core.Entities; using Bit.Core.Enums; diff --git a/src/Admin/Controllers/ProvidersController.cs b/src/Admin/Controllers/ProvidersController.cs index 3dbf1ca53bb3..8fa02e9b329f 100644 --- a/src/Admin/Controllers/ProvidersController.cs +++ b/src/Admin/Controllers/ProvidersController.cs @@ -1,9 +1,11 @@ using Bit.Admin.Enums; using Bit.Admin.Models; using Bit.Admin.Utilities; -using Bit.Core.Entities.Provider; -using Bit.Core.Enums.Provider; -using Bit.Core.Providers.Interfaces; +using Bit.Core.AdminConsole.Entities.Provider; +using Bit.Core.AdminConsole.Enums.Provider; +using Bit.Core.AdminConsole.Providers.Interfaces; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; using Bit.Core.Repositories; using Bit.Core.Services; using Bit.Core.Settings; diff --git a/src/Admin/Controllers/ToolsController.cs b/src/Admin/Controllers/ToolsController.cs index d3d5b1783c17..b151a98a6552 100644 --- a/src/Admin/Controllers/ToolsController.cs +++ b/src/Admin/Controllers/ToolsController.cs @@ -3,6 +3,9 @@ using Bit.Admin.Enums; using Bit.Admin.Models; using Bit.Admin.Utilities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Entities; using Bit.Core.Models.BitStripe; using Bit.Core.OrganizationFeatures.OrganizationLicenses.Interfaces; @@ -203,7 +206,7 @@ public async Task PromoteAdmin(PromoteAdminModel model) { ModelState.AddModelError(nameof(model.UserId), "User Id not found in this organization."); } - else if (user.Type != Core.Enums.OrganizationUserType.Admin) + else if (user.Type != OrganizationUserType.Admin) { ModelState.AddModelError(nameof(model.UserId), "User is not an admin of this organization."); } @@ -213,7 +216,7 @@ public async Task PromoteAdmin(PromoteAdminModel model) return View(model); } - user.Type = Core.Enums.OrganizationUserType.Owner; + user.Type = OrganizationUserType.Owner; await _organizationUserRepository.ReplaceAsync(user); return RedirectToAction("Edit", "Organizations", new { id = model.OrganizationId.Value }); } diff --git a/src/Admin/Models/CreateProviderModel.cs b/src/Admin/Models/CreateProviderModel.cs index 9dcd218fa625..8eddd014cd5c 100644 --- a/src/Admin/Models/CreateProviderModel.cs +++ b/src/Admin/Models/CreateProviderModel.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -using Bit.Core.Entities.Provider; -using Bit.Core.Enums.Provider; +using Bit.Core.AdminConsole.Entities.Provider; +using Bit.Core.AdminConsole.Enums.Provider; using Bit.SharedWeb.Utilities; namespace Bit.Admin.Models; diff --git a/src/Admin/Models/OrganizationEditModel.cs b/src/Admin/Models/OrganizationEditModel.cs index 4e90f5bdeb55..cf8615cabb41 100644 --- a/src/Admin/Models/OrganizationEditModel.cs +++ b/src/Admin/Models/OrganizationEditModel.cs @@ -1,10 +1,11 @@ using System.ComponentModel.DataAnnotations; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Entities.Provider; +using Bit.Core.AdminConsole.Enums.Provider; +using Bit.Core.AdminConsole.Models.Data.Organizations.OrganizationUsers; using Bit.Core.Entities; -using Bit.Core.Entities.Provider; using Bit.Core.Enums; -using Bit.Core.Enums.Provider; using Bit.Core.Models.Business; -using Bit.Core.Models.Data.Organizations.OrganizationUsers; using Bit.Core.Settings; using Bit.Core.Utilities; using Bit.Core.Vault.Entities; diff --git a/src/Admin/Models/OrganizationSelectableViewModel.cs b/src/Admin/Models/OrganizationSelectableViewModel.cs index 0daa5fda8804..b43b9eef4e12 100644 --- a/src/Admin/Models/OrganizationSelectableViewModel.cs +++ b/src/Admin/Models/OrganizationSelectableViewModel.cs @@ -1,4 +1,5 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Entities; namespace Bit.Admin.Models; diff --git a/src/Admin/Models/OrganizationViewModel.cs b/src/Admin/Models/OrganizationViewModel.cs index 7320b8594d7c..058c324283af 100644 --- a/src/Admin/Models/OrganizationViewModel.cs +++ b/src/Admin/Models/OrganizationViewModel.cs @@ -1,7 +1,9 @@ -using Bit.Core.Entities; -using Bit.Core.Entities.Provider; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Entities.Provider; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Models.Data.Organizations.OrganizationUsers; +using Bit.Core.Entities; using Bit.Core.Enums; -using Bit.Core.Models.Data.Organizations.OrganizationUsers; using Bit.Core.Vault.Entities; namespace Bit.Admin.Models; diff --git a/src/Admin/Models/OrganizationsModel.cs b/src/Admin/Models/OrganizationsModel.cs index 706377f8e2d5..85f813f71cc5 100644 --- a/src/Admin/Models/OrganizationsModel.cs +++ b/src/Admin/Models/OrganizationsModel.cs @@ -1,4 +1,5 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Entities; namespace Bit.Admin.Models; diff --git a/src/Admin/Models/ProviderEditModel.cs b/src/Admin/Models/ProviderEditModel.cs index 38fdb742a85a..6dd0c6639ffb 100644 --- a/src/Admin/Models/ProviderEditModel.cs +++ b/src/Admin/Models/ProviderEditModel.cs @@ -1,5 +1,6 @@ using System.ComponentModel.DataAnnotations; -using Bit.Core.Entities.Provider; +using Bit.Core.AdminConsole.Entities.Provider; +using Bit.Core.AdminConsole.Models.Data.Provider; using Bit.Core.Models.Data; namespace Bit.Admin.Models; diff --git a/src/Admin/Models/ProviderViewModel.cs b/src/Admin/Models/ProviderViewModel.cs index 766101e884b9..689e8e8349c0 100644 --- a/src/Admin/Models/ProviderViewModel.cs +++ b/src/Admin/Models/ProviderViewModel.cs @@ -1,5 +1,6 @@ -using Bit.Core.Entities.Provider; -using Bit.Core.Enums.Provider; +using Bit.Core.AdminConsole.Entities.Provider; +using Bit.Core.AdminConsole.Enums.Provider; +using Bit.Core.AdminConsole.Models.Data.Provider; using Bit.Core.Models.Data; namespace Bit.Admin.Models; diff --git a/src/Admin/Models/ProvidersModel.cs b/src/Admin/Models/ProvidersModel.cs index dccf4a4d7610..5fb8e8dfab16 100644 --- a/src/Admin/Models/ProvidersModel.cs +++ b/src/Admin/Models/ProvidersModel.cs @@ -1,4 +1,4 @@ -using Bit.Core.Entities.Provider; +using Bit.Core.AdminConsole.Entities.Provider; namespace Bit.Admin.Models; diff --git a/src/Admin/Views/Organizations/_ProviderInformation.cshtml b/src/Admin/Views/Organizations/_ProviderInformation.cshtml index 217f9951b0c3..4bd2118ea0a3 100644 --- a/src/Admin/Views/Organizations/_ProviderInformation.cshtml +++ b/src/Admin/Views/Organizations/_ProviderInformation.cshtml @@ -1,5 +1,5 @@ @using Bit.SharedWeb.Utilities -@model Bit.Core.Entities.Provider.Provider +@model Bit.Core.AdminConsole.Entities.Provider.Provider
Provider Name
@Model.Name
diff --git a/src/Admin/Views/Providers/Admins.cshtml b/src/Admin/Views/Providers/Admins.cshtml index 533cb3034ea2..4d110aca5bcc 100644 --- a/src/Admin/Views/Providers/Admins.cshtml +++ b/src/Admin/Views/Providers/Admins.cshtml @@ -1,4 +1,5 @@ @using Bit.Admin.Enums; +@using Bit.Core.AdminConsole.Enums.Provider @inject Bit.Admin.Services.IAccessControlService AccessControlService @model ProviderViewModel diff --git a/src/Admin/Views/Providers/Create.cshtml b/src/Admin/Views/Providers/Create.cshtml index 107e93150b41..2e69da3ad7b3 100644 --- a/src/Admin/Views/Providers/Create.cshtml +++ b/src/Admin/Views/Providers/Create.cshtml @@ -1,4 +1,5 @@ @using Bit.SharedWeb.Utilities +@using Bit.Core.AdminConsole.Enums.Provider @model CreateProviderModel @{ ViewData["Title"] = "Create Provider"; diff --git a/src/Admin/Views/Providers/Organizations.cshtml b/src/Admin/Views/Providers/Organizations.cshtml index 06fc490bcc0d..11ae06659ca9 100644 --- a/src/Admin/Views/Providers/Organizations.cshtml +++ b/src/Admin/Views/Providers/Organizations.cshtml @@ -1,3 +1,5 @@ +@using Bit.Core.AdminConsole.Enums.Provider +@using Bit.Core.AdminConsole.Enums @model ProviderViewModel @await Html.PartialAsync("_ProviderScripts") diff --git a/src/Admin/Views/Providers/_ViewInformation.cshtml b/src/Admin/Views/Providers/_ViewInformation.cshtml index ff4a2e8106ac..b01502e6d668 100644 --- a/src/Admin/Views/Providers/_ViewInformation.cshtml +++ b/src/Admin/Views/Providers/_ViewInformation.cshtml @@ -1,4 +1,5 @@ @using Bit.SharedWeb.Utilities +@using Bit.Core.AdminConsole.Enums.Provider @model ProviderViewModel
Id
diff --git a/src/Admin/Views/Shared/_OrganizationForm.cshtml b/src/Admin/Views/Shared/_OrganizationForm.cshtml index 697d3ef9435a..d0530849acbd 100644 --- a/src/Admin/Views/Shared/_OrganizationForm.cshtml +++ b/src/Admin/Views/Shared/_OrganizationForm.cshtml @@ -1,5 +1,6 @@ @using Bit.SharedWeb.Utilities @using Bit.Admin.Enums; +@using Bit.Core.AdminConsole.Enums.Provider @inject Bit.Admin.Services.IAccessControlService AccessControlService; @model OrganizationEditModel diff --git a/src/Admin/Views/_ViewImports.cshtml b/src/Admin/Views/_ViewImports.cshtml index b3dac997e284..073a922f5e45 100644 --- a/src/Admin/Views/_ViewImports.cshtml +++ b/src/Admin/Views/_ViewImports.cshtml @@ -1,7 +1,6 @@ @using Microsoft.AspNetCore.Identity @using Bit.Admin @using Bit.Admin.Models -@using Bit.Core.Enums.Provider @using Bit.Core.Enums @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper "*, Admin" diff --git a/src/Api/AdminConsole/Controllers/GroupsController.cs b/src/Api/AdminConsole/Controllers/GroupsController.cs index 95c3263261f5..8d4a372d03d1 100644 --- a/src/Api/AdminConsole/Controllers/GroupsController.cs +++ b/src/Api/AdminConsole/Controllers/GroupsController.cs @@ -1,9 +1,11 @@ using Bit.Api.AdminConsole.Models.Response; using Bit.Api.AdminConsole.Models.Request; using Bit.Api.Models.Response; +using Bit.Core.AdminConsole.OrganizationFeatures.Groups.Interfaces; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; using Bit.Core.Context; using Bit.Core.Exceptions; -using Bit.Core.OrganizationFeatures.Groups.Interfaces; using Bit.Core.Repositories; using Bit.Core.Services; using Microsoft.AspNetCore.Authorization; diff --git a/src/Api/AdminConsole/Controllers/OrganizationUsersController.cs b/src/Api/AdminConsole/Controllers/OrganizationUsersController.cs index 6de174ae7cec..2c6ddc2e4932 100644 --- a/src/Api/AdminConsole/Controllers/OrganizationUsersController.cs +++ b/src/Api/AdminConsole/Controllers/OrganizationUsersController.cs @@ -2,14 +2,19 @@ using Bit.Api.AdminConsole.Models.Response.Organizations; using Bit.Api.Models.Request.Organizations; using Bit.Api.Models.Response; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Models.Business; +using Bit.Core.AdminConsole.Models.Data.Organizations.OrganizationUsers; +using Bit.Core.AdminConsole.Models.Data.Organizations.Policies; +using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationUsers.Interfaces; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; using Bit.Core.Context; using Bit.Core.Enums; using Bit.Core.Exceptions; using Bit.Core.Models.Business; -using Bit.Core.Models.Data.Organizations.OrganizationUsers; -using Bit.Core.Models.Data.Organizations.Policies; using Bit.Core.OrganizationFeatures.OrganizationSubscriptions.Interface; -using Bit.Core.OrganizationFeatures.OrganizationUsers.Interfaces; using Bit.Core.Repositories; using Bit.Core.Services; using Microsoft.AspNetCore.Authorization; @@ -467,7 +472,7 @@ public async Task BulkEnableSecretsManagerAsync(Guid orgId, private async Task RestoreOrRevokeUserAsync( Guid orgId, Guid id, - Func statusAction) + Func statusAction) { if (!await _currentContext.ManageUsers(orgId)) { @@ -487,7 +492,7 @@ private async Task RestoreOrRevokeUserAsync( private async Task> RestoreOrRevokeUsersAsync( Guid orgId, OrganizationUserBulkRequestModel model, - Func, Guid?, Task>>> statusAction) + Func, Guid?, Task>>> statusAction) { if (!await _currentContext.ManageUsers(orgId)) { diff --git a/src/Api/AdminConsole/Controllers/OrganizationsController.cs b/src/Api/AdminConsole/Controllers/OrganizationsController.cs index b8746c59afbb..6c231730cc89 100644 --- a/src/Api/AdminConsole/Controllers/OrganizationsController.cs +++ b/src/Api/AdminConsole/Controllers/OrganizationsController.cs @@ -11,6 +11,11 @@ using Bit.Api.Models.Request.Organizations; using Bit.Api.Models.Response; using Bit.Core; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Models.Data.Organizations.Policies; +using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationApiKeys.Interfaces; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; using Bit.Core.Auth.Enums; using Bit.Core.Auth.Repositories; using Bit.Core.Auth.Services; @@ -18,8 +23,6 @@ using Bit.Core.Enums; using Bit.Core.Exceptions; using Bit.Core.Models.Business; -using Bit.Core.Models.Data.Organizations.Policies; -using Bit.Core.OrganizationFeatures.OrganizationApiKeys.Interfaces; using Bit.Core.OrganizationFeatures.OrganizationLicenses.Interfaces; using Bit.Core.OrganizationFeatures.OrganizationSubscriptions.Interface; using Bit.Core.Repositories; diff --git a/src/Api/AdminConsole/Controllers/PoliciesController.cs b/src/Api/AdminConsole/Controllers/PoliciesController.cs index 6f93c22def17..1a6d95bbb78b 100644 --- a/src/Api/AdminConsole/Controllers/PoliciesController.cs +++ b/src/Api/AdminConsole/Controllers/PoliciesController.cs @@ -1,5 +1,9 @@ using Bit.Api.AdminConsole.Models.Request; using Bit.Api.Models.Response; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Models.Api.Response; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; using Bit.Core.Context; using Bit.Core.Enums; using Bit.Core.Exceptions; diff --git a/src/Api/AdminConsole/Controllers/ProviderOrganizationsController.cs b/src/Api/AdminConsole/Controllers/ProviderOrganizationsController.cs index 1420311d4ba4..bb6de40b4ffc 100644 --- a/src/Api/AdminConsole/Controllers/ProviderOrganizationsController.cs +++ b/src/Api/AdminConsole/Controllers/ProviderOrganizationsController.cs @@ -1,6 +1,8 @@ using Bit.Api.AdminConsole.Models.Request.Providers; using Bit.Api.AdminConsole.Models.Response.Providers; using Bit.Api.Models.Response; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; using Bit.Core.Context; using Bit.Core.Exceptions; using Bit.Core.Repositories; diff --git a/src/Api/AdminConsole/Controllers/ProviderUsersController.cs b/src/Api/AdminConsole/Controllers/ProviderUsersController.cs index c955e062fa67..03e90f467cf7 100644 --- a/src/Api/AdminConsole/Controllers/ProviderUsersController.cs +++ b/src/Api/AdminConsole/Controllers/ProviderUsersController.cs @@ -1,9 +1,11 @@ using Bit.Api.AdminConsole.Models.Request.Providers; using Bit.Api.AdminConsole.Models.Response.Providers; using Bit.Api.Models.Response; +using Bit.Core.AdminConsole.Models.Business.Provider; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; using Bit.Core.Context; using Bit.Core.Exceptions; -using Bit.Core.Models.Business.Provider; using Bit.Core.Repositories; using Bit.Core.Services; using Microsoft.AspNetCore.Authorization; diff --git a/src/Api/AdminConsole/Controllers/ProvidersController.cs b/src/Api/AdminConsole/Controllers/ProvidersController.cs index b61a6d419861..c533fa2670ca 100644 --- a/src/Api/AdminConsole/Controllers/ProvidersController.cs +++ b/src/Api/AdminConsole/Controllers/ProvidersController.cs @@ -1,5 +1,7 @@ using Bit.Api.AdminConsole.Models.Request.Providers; using Bit.Api.AdminConsole.Models.Response.Providers; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; using Bit.Core.Context; using Bit.Core.Exceptions; using Bit.Core.Repositories; diff --git a/src/Api/AdminConsole/Models/Request/GroupRequestModel.cs b/src/Api/AdminConsole/Models/Request/GroupRequestModel.cs index e15aef7ac355..d73f524bc1e9 100644 --- a/src/Api/AdminConsole/Models/Request/GroupRequestModel.cs +++ b/src/Api/AdminConsole/Models/Request/GroupRequestModel.cs @@ -1,5 +1,6 @@ using System.ComponentModel.DataAnnotations; using Bit.Api.Models.Request; +using Bit.Core.AdminConsole.Entities; using Bit.Core.Entities; namespace Bit.Api.AdminConsole.Models.Request; diff --git a/src/Api/AdminConsole/Models/Request/ImportOrganizationUsersRequestModel.cs b/src/Api/AdminConsole/Models/Request/ImportOrganizationUsersRequestModel.cs index decb6d64063e..48d34c1710b4 100644 --- a/src/Api/AdminConsole/Models/Request/ImportOrganizationUsersRequestModel.cs +++ b/src/Api/AdminConsole/Models/Request/ImportOrganizationUsersRequestModel.cs @@ -1,4 +1,5 @@ using System.ComponentModel.DataAnnotations; +using Bit.Core.AdminConsole.Models.Business; using Bit.Core.Models.Business; namespace Bit.Api.AdminConsole.Models.Request; @@ -24,7 +25,7 @@ public ImportedGroup ToImportedGroup(Guid organizationId) { var importedGroup = new ImportedGroup { - Group = new Core.Entities.Group + Group = new Core.AdminConsole.Entities.Group { OrganizationId = organizationId, Name = Name, diff --git a/src/Api/AdminConsole/Models/Request/Organizations/OrganizationApiKeyRequestModel.cs b/src/Api/AdminConsole/Models/Request/Organizations/OrganizationApiKeyRequestModel.cs index af5c4e19d04d..76f4fe03fb66 100644 --- a/src/Api/AdminConsole/Models/Request/Organizations/OrganizationApiKeyRequestModel.cs +++ b/src/Api/AdminConsole/Models/Request/Organizations/OrganizationApiKeyRequestModel.cs @@ -1,4 +1,5 @@ using Bit.Api.Auth.Models.Request.Accounts; +using Bit.Core.AdminConsole.Enums; using Bit.Core.Enums; namespace Bit.Api.AdminConsole.Models.Request.Organizations; diff --git a/src/Api/AdminConsole/Models/Request/Organizations/OrganizationCreateRequestModel.cs b/src/Api/AdminConsole/Models/Request/Organizations/OrganizationCreateRequestModel.cs index 2ea4e8b84eea..82406652414e 100644 --- a/src/Api/AdminConsole/Models/Request/Organizations/OrganizationCreateRequestModel.cs +++ b/src/Api/AdminConsole/Models/Request/Organizations/OrganizationCreateRequestModel.cs @@ -1,4 +1,5 @@ using System.ComponentModel.DataAnnotations; +using Bit.Core.AdminConsole.Models.Business; using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Models.Business; diff --git a/src/Api/AdminConsole/Models/Request/Organizations/OrganizationKeysRequestModel.cs b/src/Api/AdminConsole/Models/Request/Organizations/OrganizationKeysRequestModel.cs index 3a343caa21a1..48a06458d376 100644 --- a/src/Api/AdminConsole/Models/Request/Organizations/OrganizationKeysRequestModel.cs +++ b/src/Api/AdminConsole/Models/Request/Organizations/OrganizationKeysRequestModel.cs @@ -1,4 +1,6 @@ using System.ComponentModel.DataAnnotations; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Models.Business; using Bit.Core.Entities; using Bit.Core.Models.Business; diff --git a/src/Api/AdminConsole/Models/Request/Organizations/OrganizationUpdateRequestModel.cs b/src/Api/AdminConsole/Models/Request/Organizations/OrganizationUpdateRequestModel.cs index be526ee6ccb7..b2241db11e39 100644 --- a/src/Api/AdminConsole/Models/Request/Organizations/OrganizationUpdateRequestModel.cs +++ b/src/Api/AdminConsole/Models/Request/Organizations/OrganizationUpdateRequestModel.cs @@ -1,4 +1,5 @@ using System.ComponentModel.DataAnnotations; +using Bit.Core.AdminConsole.Entities; using Bit.Core.Entities; using Bit.Core.Models.Data; using Bit.Core.Settings; diff --git a/src/Api/AdminConsole/Models/Request/Organizations/OrganizationUpgradeRequestModel.cs b/src/Api/AdminConsole/Models/Request/Organizations/OrganizationUpgradeRequestModel.cs index dae1b1d4293d..86ac74e443c9 100644 --- a/src/Api/AdminConsole/Models/Request/Organizations/OrganizationUpgradeRequestModel.cs +++ b/src/Api/AdminConsole/Models/Request/Organizations/OrganizationUpgradeRequestModel.cs @@ -1,4 +1,5 @@ using System.ComponentModel.DataAnnotations; +using Bit.Core.AdminConsole.Models.Business; using Bit.Core.Enums; using Bit.Core.Models.Business; diff --git a/src/Api/AdminConsole/Models/Request/Organizations/OrganizationUserRequestModels.cs b/src/Api/AdminConsole/Models/Request/Organizations/OrganizationUserRequestModels.cs index bf10d85c0b89..db7ddfdfe0b0 100644 --- a/src/Api/AdminConsole/Models/Request/Organizations/OrganizationUserRequestModels.cs +++ b/src/Api/AdminConsole/Models/Request/Organizations/OrganizationUserRequestModels.cs @@ -1,9 +1,11 @@ using System.ComponentModel.DataAnnotations; using Bit.Api.Models.Request; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Models.Data.Organizations.OrganizationUsers; using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Models.Data; -using Bit.Core.Models.Data.Organizations.OrganizationUsers; using Bit.Core.Utilities; namespace Bit.Api.AdminConsole.Models.Request.Organizations; diff --git a/src/Api/AdminConsole/Models/Request/PolicyRequestModel.cs b/src/Api/AdminConsole/Models/Request/PolicyRequestModel.cs index b3ba3a6bca97..c912e4ce7333 100644 --- a/src/Api/AdminConsole/Models/Request/PolicyRequestModel.cs +++ b/src/Api/AdminConsole/Models/Request/PolicyRequestModel.cs @@ -1,5 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.Text.Json; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; using Bit.Core.Entities; using Bit.Core.Enums; diff --git a/src/Api/AdminConsole/Models/Request/Providers/ProviderSetupRequestModel.cs b/src/Api/AdminConsole/Models/Request/Providers/ProviderSetupRequestModel.cs index 2c5e4c65bb39..e091a55632e5 100644 --- a/src/Api/AdminConsole/Models/Request/Providers/ProviderSetupRequestModel.cs +++ b/src/Api/AdminConsole/Models/Request/Providers/ProviderSetupRequestModel.cs @@ -1,5 +1,5 @@ using System.ComponentModel.DataAnnotations; -using Bit.Core.Entities.Provider; +using Bit.Core.AdminConsole.Entities.Provider; namespace Bit.Api.AdminConsole.Models.Request.Providers; diff --git a/src/Api/AdminConsole/Models/Request/Providers/ProviderUpdateRequestModel.cs b/src/Api/AdminConsole/Models/Request/Providers/ProviderUpdateRequestModel.cs index 58b4fc0f5149..90bdb1e048a9 100644 --- a/src/Api/AdminConsole/Models/Request/Providers/ProviderUpdateRequestModel.cs +++ b/src/Api/AdminConsole/Models/Request/Providers/ProviderUpdateRequestModel.cs @@ -1,5 +1,5 @@ using System.ComponentModel.DataAnnotations; -using Bit.Core.Entities.Provider; +using Bit.Core.AdminConsole.Entities.Provider; using Bit.Core.Settings; namespace Bit.Api.AdminConsole.Models.Request.Providers; diff --git a/src/Api/AdminConsole/Models/Request/Providers/ProviderUserRequestModels.cs b/src/Api/AdminConsole/Models/Request/Providers/ProviderUserRequestModels.cs index ec112edc4ad7..dd225309164f 100644 --- a/src/Api/AdminConsole/Models/Request/Providers/ProviderUserRequestModels.cs +++ b/src/Api/AdminConsole/Models/Request/Providers/ProviderUserRequestModels.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -using Bit.Core.Entities.Provider; -using Bit.Core.Enums.Provider; +using Bit.Core.AdminConsole.Entities.Provider; +using Bit.Core.AdminConsole.Enums.Provider; using Bit.Core.Utilities; namespace Bit.Api.AdminConsole.Models.Request.Providers; diff --git a/src/Api/AdminConsole/Models/Response/GroupResponseModel.cs b/src/Api/AdminConsole/Models/Response/GroupResponseModel.cs index a4d53438cba5..0bf2e7eb0595 100644 --- a/src/Api/AdminConsole/Models/Response/GroupResponseModel.cs +++ b/src/Api/AdminConsole/Models/Response/GroupResponseModel.cs @@ -1,4 +1,5 @@ using Bit.Api.Models.Response; +using Bit.Core.AdminConsole.Entities; using Bit.Core.Entities; using Bit.Core.Models.Api; using Bit.Core.Models.Data; diff --git a/src/Api/AdminConsole/Models/Response/Organizations/OrganizationApiKeyInformationResponseModel.cs b/src/Api/AdminConsole/Models/Response/Organizations/OrganizationApiKeyInformationResponseModel.cs index ba1b290db788..7f2d7ca732c3 100644 --- a/src/Api/AdminConsole/Models/Response/Organizations/OrganizationApiKeyInformationResponseModel.cs +++ b/src/Api/AdminConsole/Models/Response/Organizations/OrganizationApiKeyInformationResponseModel.cs @@ -1,4 +1,6 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Models.Api; diff --git a/src/Api/AdminConsole/Models/Response/Organizations/OrganizationKeysResponseModel.cs b/src/Api/AdminConsole/Models/Response/Organizations/OrganizationKeysResponseModel.cs index a2e4fe058d0b..6b5754b3b27c 100644 --- a/src/Api/AdminConsole/Models/Response/Organizations/OrganizationKeysResponseModel.cs +++ b/src/Api/AdminConsole/Models/Response/Organizations/OrganizationKeysResponseModel.cs @@ -1,4 +1,5 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Entities; using Bit.Core.Models.Api; namespace Bit.Api.AdminConsole.Models.Response.Organizations; diff --git a/src/Api/AdminConsole/Models/Response/Organizations/OrganizationPublicKeyResponseModel.cs b/src/Api/AdminConsole/Models/Response/Organizations/OrganizationPublicKeyResponseModel.cs index dc124796188e..0bb602531b3c 100644 --- a/src/Api/AdminConsole/Models/Response/Organizations/OrganizationPublicKeyResponseModel.cs +++ b/src/Api/AdminConsole/Models/Response/Organizations/OrganizationPublicKeyResponseModel.cs @@ -1,4 +1,5 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Entities; using Bit.Core.Models.Api; namespace Bit.Api.AdminConsole.Models.Response.Organizations; diff --git a/src/Api/AdminConsole/Models/Response/Organizations/OrganizationResponseModel.cs b/src/Api/AdminConsole/Models/Response/Organizations/OrganizationResponseModel.cs index 1d83f79e1b55..70a33bde94b7 100644 --- a/src/Api/AdminConsole/Models/Response/Organizations/OrganizationResponseModel.cs +++ b/src/Api/AdminConsole/Models/Response/Organizations/OrganizationResponseModel.cs @@ -1,4 +1,5 @@ using Bit.Api.Models.Response; +using Bit.Core.AdminConsole.Entities; using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Models.Api; diff --git a/src/Api/AdminConsole/Models/Response/Organizations/OrganizationUserResponseModel.cs b/src/Api/AdminConsole/Models/Response/Organizations/OrganizationUserResponseModel.cs index ee1d790fa66d..136a84156e9f 100644 --- a/src/Api/AdminConsole/Models/Response/Organizations/OrganizationUserResponseModel.cs +++ b/src/Api/AdminConsole/Models/Response/Organizations/OrganizationUserResponseModel.cs @@ -1,10 +1,12 @@ using System.Text.Json.Serialization; using Bit.Api.Models.Response; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Models.Data.Organizations.OrganizationUsers; using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Models.Api; using Bit.Core.Models.Data; -using Bit.Core.Models.Data.Organizations.OrganizationUsers; using Bit.Core.Utilities; namespace Bit.Api.AdminConsole.Models.Response.Organizations; diff --git a/src/Api/AdminConsole/Models/Response/ProfileOrganizationResponseModel.cs b/src/Api/AdminConsole/Models/Response/ProfileOrganizationResponseModel.cs index 04b3f7602123..be98c717ca81 100644 --- a/src/Api/AdminConsole/Models/Response/ProfileOrganizationResponseModel.cs +++ b/src/Api/AdminConsole/Models/Response/ProfileOrganizationResponseModel.cs @@ -1,10 +1,11 @@ -using Bit.Core.Auth.Enums; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Enums.Provider; +using Bit.Core.AdminConsole.Models.Data.Organizations.OrganizationUsers; +using Bit.Core.Auth.Enums; using Bit.Core.Auth.Models.Data; using Bit.Core.Enums; -using Bit.Core.Enums.Provider; using Bit.Core.Models.Api; using Bit.Core.Models.Data; -using Bit.Core.Models.Data.Organizations.OrganizationUsers; using Bit.Core.Utilities; namespace Bit.Api.AdminConsole.Models.Response; diff --git a/src/Api/AdminConsole/Models/Response/ProfileProviderOrganizationResponseModel.cs b/src/Api/AdminConsole/Models/Response/ProfileProviderOrganizationResponseModel.cs index b79a32560104..f7d844f81c9a 100644 --- a/src/Api/AdminConsole/Models/Response/ProfileProviderOrganizationResponseModel.cs +++ b/src/Api/AdminConsole/Models/Response/ProfileProviderOrganizationResponseModel.cs @@ -1,4 +1,6 @@ -using Bit.Core.Enums; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Models.Data.Provider; +using Bit.Core.Enums; using Bit.Core.Models.Data; using Bit.Core.Utilities; diff --git a/src/Api/AdminConsole/Models/Response/Providers/ProfileProviderResponseModel.cs b/src/Api/AdminConsole/Models/Response/Providers/ProfileProviderResponseModel.cs index ac725618b5e7..66e0acae0cdd 100644 --- a/src/Api/AdminConsole/Models/Response/Providers/ProfileProviderResponseModel.cs +++ b/src/Api/AdminConsole/Models/Response/Providers/ProfileProviderResponseModel.cs @@ -1,4 +1,5 @@ -using Bit.Core.Enums.Provider; +using Bit.Core.AdminConsole.Enums.Provider; +using Bit.Core.AdminConsole.Models.Data.Provider; using Bit.Core.Models.Api; using Bit.Core.Models.Data; using Bit.Core.Utilities; diff --git a/src/Api/AdminConsole/Models/Response/Providers/ProviderOrganizationResponseModel.cs b/src/Api/AdminConsole/Models/Response/Providers/ProviderOrganizationResponseModel.cs index a2e9d9f4a233..1592b122f1ef 100644 --- a/src/Api/AdminConsole/Models/Response/Providers/ProviderOrganizationResponseModel.cs +++ b/src/Api/AdminConsole/Models/Response/Providers/ProviderOrganizationResponseModel.cs @@ -1,4 +1,5 @@ -using Bit.Core.Entities.Provider; +using Bit.Core.AdminConsole.Entities.Provider; +using Bit.Core.AdminConsole.Models.Data.Provider; using Bit.Core.Models.Api; using Bit.Core.Models.Data; diff --git a/src/Api/AdminConsole/Models/Response/Providers/ProviderResponseModel.cs b/src/Api/AdminConsole/Models/Response/Providers/ProviderResponseModel.cs index 5e26d1d4be0b..bc55093a03bd 100644 --- a/src/Api/AdminConsole/Models/Response/Providers/ProviderResponseModel.cs +++ b/src/Api/AdminConsole/Models/Response/Providers/ProviderResponseModel.cs @@ -1,4 +1,4 @@ -using Bit.Core.Entities.Provider; +using Bit.Core.AdminConsole.Entities.Provider; using Bit.Core.Models.Api; namespace Bit.Api.AdminConsole.Models.Response.Providers; diff --git a/src/Api/AdminConsole/Models/Response/Providers/ProviderUserResponseModel.cs b/src/Api/AdminConsole/Models/Response/Providers/ProviderUserResponseModel.cs index 10080228856e..1eaeb8e0bd9e 100644 --- a/src/Api/AdminConsole/Models/Response/Providers/ProviderUserResponseModel.cs +++ b/src/Api/AdminConsole/Models/Response/Providers/ProviderUserResponseModel.cs @@ -1,5 +1,6 @@ -using Bit.Core.Entities.Provider; -using Bit.Core.Enums.Provider; +using Bit.Core.AdminConsole.Entities.Provider; +using Bit.Core.AdminConsole.Enums.Provider; +using Bit.Core.AdminConsole.Models.Data.Provider; using Bit.Core.Models.Api; using Bit.Core.Models.Data; using Bit.Core.Utilities; diff --git a/src/Api/AdminConsole/Public/Controllers/GroupsController.cs b/src/Api/AdminConsole/Public/Controllers/GroupsController.cs index c87d0c2d3856..01c38a084f51 100644 --- a/src/Api/AdminConsole/Public/Controllers/GroupsController.cs +++ b/src/Api/AdminConsole/Public/Controllers/GroupsController.cs @@ -2,8 +2,9 @@ using Bit.Api.AdminConsole.Public.Models.Request; using Bit.Api.AdminConsole.Public.Models.Response; using Bit.Api.Models.Public.Response; +using Bit.Core.AdminConsole.OrganizationFeatures.Groups.Interfaces; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Context; -using Bit.Core.OrganizationFeatures.Groups.Interfaces; using Bit.Core.Repositories; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; diff --git a/src/Api/AdminConsole/Public/Controllers/MembersController.cs b/src/Api/AdminConsole/Public/Controllers/MembersController.cs index cefed4a5a0cb..6f492da00a37 100644 --- a/src/Api/AdminConsole/Public/Controllers/MembersController.cs +++ b/src/Api/AdminConsole/Public/Controllers/MembersController.cs @@ -2,9 +2,12 @@ using Bit.Api.AdminConsole.Public.Models.Request; using Bit.Api.AdminConsole.Public.Models.Response; using Bit.Api.Models.Public.Response; +using Bit.Core.AdminConsole.Models.Business; +using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationUsers.Interfaces; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; using Bit.Core.Context; using Bit.Core.Models.Business; -using Bit.Core.OrganizationFeatures.OrganizationUsers.Interfaces; using Bit.Core.Repositories; using Bit.Core.Services; using Microsoft.AspNetCore.Authorization; diff --git a/src/Api/AdminConsole/Public/Controllers/OrganizationController.cs b/src/Api/AdminConsole/Public/Controllers/OrganizationController.cs index 65dc15e77199..0edf48c84d75 100644 --- a/src/Api/AdminConsole/Public/Controllers/OrganizationController.cs +++ b/src/Api/AdminConsole/Public/Controllers/OrganizationController.cs @@ -2,6 +2,7 @@ using Bit.Api.AdminConsole.Public.Models.Request; using Bit.Api.AdminConsole.Public.Models.Response; using Bit.Api.Models.Public.Response; +using Bit.Core.AdminConsole.Services; using Bit.Core.Context; using Bit.Core.Exceptions; using Bit.Core.Services; diff --git a/src/Api/AdminConsole/Public/Controllers/PoliciesController.cs b/src/Api/AdminConsole/Public/Controllers/PoliciesController.cs index bcabb969c6ba..afe83f9151a5 100644 --- a/src/Api/AdminConsole/Public/Controllers/PoliciesController.cs +++ b/src/Api/AdminConsole/Public/Controllers/PoliciesController.cs @@ -2,6 +2,9 @@ using Bit.Api.AdminConsole.Public.Models.Request; using Bit.Api.AdminConsole.Public.Models.Response; using Bit.Api.Models.Public.Response; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; using Bit.Core.Context; using Bit.Core.Enums; using Bit.Core.Repositories; diff --git a/src/Api/AdminConsole/Public/Models/MemberBaseModel.cs b/src/Api/AdminConsole/Public/Models/MemberBaseModel.cs index d7eaf98509f4..93d63b9b090c 100644 --- a/src/Api/AdminConsole/Public/Models/MemberBaseModel.cs +++ b/src/Api/AdminConsole/Public/Models/MemberBaseModel.cs @@ -1,7 +1,9 @@ using System.ComponentModel.DataAnnotations; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Models.Data.Organizations.OrganizationUsers; using Bit.Core.Entities; using Bit.Core.Enums; -using Bit.Core.Models.Data.Organizations.OrganizationUsers; namespace Bit.Api.AdminConsole.Public.Models; diff --git a/src/Api/AdminConsole/Public/Models/Request/GroupCreateUpdateRequestModel.cs b/src/Api/AdminConsole/Public/Models/Request/GroupCreateUpdateRequestModel.cs index d99165cc6c32..0917d6b0717f 100644 --- a/src/Api/AdminConsole/Public/Models/Request/GroupCreateUpdateRequestModel.cs +++ b/src/Api/AdminConsole/Public/Models/Request/GroupCreateUpdateRequestModel.cs @@ -1,4 +1,5 @@ using Bit.Api.Auth.Models.Public.Request; +using Bit.Core.AdminConsole.Entities; using Bit.Core.Entities; namespace Bit.Api.AdminConsole.Public.Models.Request; diff --git a/src/Api/AdminConsole/Public/Models/Request/MemberCreateRequestModel.cs b/src/Api/AdminConsole/Public/Models/Request/MemberCreateRequestModel.cs index cdbc99d0d192..e300a20b16cb 100644 --- a/src/Api/AdminConsole/Public/Models/Request/MemberCreateRequestModel.cs +++ b/src/Api/AdminConsole/Public/Models/Request/MemberCreateRequestModel.cs @@ -1,4 +1,5 @@ using System.ComponentModel.DataAnnotations; +using Bit.Core.AdminConsole.Entities; using Bit.Core.Entities; using Bit.Core.Utilities; diff --git a/src/Api/AdminConsole/Public/Models/Request/MemberUpdateRequestModel.cs b/src/Api/AdminConsole/Public/Models/Request/MemberUpdateRequestModel.cs index 18aced43718b..a6768d07b6f5 100644 --- a/src/Api/AdminConsole/Public/Models/Request/MemberUpdateRequestModel.cs +++ b/src/Api/AdminConsole/Public/Models/Request/MemberUpdateRequestModel.cs @@ -1,4 +1,5 @@ using Bit.Api.Auth.Models.Public.Request; +using Bit.Core.AdminConsole.Entities; using Bit.Core.Entities; namespace Bit.Api.AdminConsole.Public.Models.Request; diff --git a/src/Api/AdminConsole/Public/Models/Request/OrganizationImportRequestModel.cs b/src/Api/AdminConsole/Public/Models/Request/OrganizationImportRequestModel.cs index eeb972d7ab05..5dcd14875732 100644 --- a/src/Api/AdminConsole/Public/Models/Request/OrganizationImportRequestModel.cs +++ b/src/Api/AdminConsole/Public/Models/Request/OrganizationImportRequestModel.cs @@ -1,5 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Models.Business; using Bit.Core.Entities; using Bit.Core.Models.Business; using Bit.Core.Utilities; diff --git a/src/Api/AdminConsole/Public/Models/Request/PolicyUpdateRequestModel.cs b/src/Api/AdminConsole/Public/Models/Request/PolicyUpdateRequestModel.cs index 1866da6ecad9..fd082821a66a 100644 --- a/src/Api/AdminConsole/Public/Models/Request/PolicyUpdateRequestModel.cs +++ b/src/Api/AdminConsole/Public/Models/Request/PolicyUpdateRequestModel.cs @@ -1,4 +1,5 @@ using System.Text.Json; +using Bit.Core.AdminConsole.Entities; using Bit.Core.Entities; namespace Bit.Api.AdminConsole.Public.Models.Request; diff --git a/src/Api/AdminConsole/Public/Models/Response/GroupResponseModel.cs b/src/Api/AdminConsole/Public/Models/Response/GroupResponseModel.cs index ca252ec0eddc..36abcd2a290b 100644 --- a/src/Api/AdminConsole/Public/Models/Response/GroupResponseModel.cs +++ b/src/Api/AdminConsole/Public/Models/Response/GroupResponseModel.cs @@ -1,6 +1,7 @@ using System.ComponentModel.DataAnnotations; using Bit.Api.Auth.Models.Public.Response; using Bit.Api.Models.Public.Response; +using Bit.Core.AdminConsole.Entities; using Bit.Core.Entities; using Bit.Core.Models.Data; diff --git a/src/Api/AdminConsole/Public/Models/Response/MemberResponseModel.cs b/src/Api/AdminConsole/Public/Models/Response/MemberResponseModel.cs index 4f2ff1c17840..78ba44884489 100644 --- a/src/Api/AdminConsole/Public/Models/Response/MemberResponseModel.cs +++ b/src/Api/AdminConsole/Public/Models/Response/MemberResponseModel.cs @@ -1,10 +1,12 @@ using System.ComponentModel.DataAnnotations; using Bit.Api.Auth.Models.Public.Response; using Bit.Api.Models.Public.Response; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Models.Data.Organizations.OrganizationUsers; using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Models.Data; -using Bit.Core.Models.Data.Organizations.OrganizationUsers; namespace Bit.Api.AdminConsole.Public.Models.Response; diff --git a/src/Api/AdminConsole/Public/Models/Response/PolicyResponseModel.cs b/src/Api/AdminConsole/Public/Models/Response/PolicyResponseModel.cs index 3b196874d575..39b87e1309aa 100644 --- a/src/Api/AdminConsole/Public/Models/Response/PolicyResponseModel.cs +++ b/src/Api/AdminConsole/Public/Models/Response/PolicyResponseModel.cs @@ -1,6 +1,8 @@ using System.ComponentModel.DataAnnotations; using System.Text.Json; using Bit.Api.Models.Public.Response; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; using Bit.Core.Entities; using Bit.Core.Enums; diff --git a/src/Api/Auth/Controllers/EmergencyAccessController.cs b/src/Api/Auth/Controllers/EmergencyAccessController.cs index 8f2d1dbd2128..116ec7fcbbbc 100644 --- a/src/Api/Auth/Controllers/EmergencyAccessController.cs +++ b/src/Api/Auth/Controllers/EmergencyAccessController.cs @@ -5,6 +5,8 @@ using Bit.Api.Models.Request.Organizations; using Bit.Api.Models.Response; using Bit.Api.Vault.Models.Response; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Models.Api.Response; using Bit.Core.Auth.Services; using Bit.Core.Entities; using Bit.Core.Exceptions; diff --git a/src/Api/Auth/Controllers/TwoFactorController.cs b/src/Api/Auth/Controllers/TwoFactorController.cs index 884f2939ba8a..b22c8566bb27 100644 --- a/src/Api/Auth/Controllers/TwoFactorController.cs +++ b/src/Api/Auth/Controllers/TwoFactorController.cs @@ -3,6 +3,8 @@ using Bit.Api.Auth.Models.Response.TwoFactor; using Bit.Api.Models.Request; using Bit.Api.Models.Response; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; using Bit.Core.Auth.Enums; using Bit.Core.Auth.LoginFeatures.PasswordlessLogin.Interfaces; using Bit.Core.Auth.Models.Business.Tokenables; diff --git a/src/Api/Auth/Models/Request/TwoFactorRequestModels.cs b/src/Api/Auth/Models/Request/TwoFactorRequestModels.cs index d946f098408a..3bd8c5506f8d 100644 --- a/src/Api/Auth/Models/Request/TwoFactorRequestModels.cs +++ b/src/Api/Auth/Models/Request/TwoFactorRequestModels.cs @@ -1,5 +1,6 @@ using System.ComponentModel.DataAnnotations; using Bit.Api.Auth.Models.Request.Accounts; +using Bit.Core.AdminConsole.Entities; using Bit.Core.Auth.Enums; using Bit.Core.Auth.Models; using Bit.Core.Auth.Utilities; @@ -203,7 +204,7 @@ public class TwoFactorEmailRequestModel : SecretVerificationRequestModel [StringLength(256)] public string Email { get; set; } public string AuthRequestId { get; set; } - // An auth session token used for obtaining email and as an authN factor for the sending of emailed 2FA OTPs. + // An auth session token used for obtaining email and as an authN factor for the sending of emailed 2FA OTPs. public string SsoEmail2FaSessionToken { get; set; } public User ToUser(User existingUser) { diff --git a/src/Api/Auth/Models/Response/OrganizationSsoResponseModel.cs b/src/Api/Auth/Models/Response/OrganizationSsoResponseModel.cs index b2643a2f5fa8..025430a8c1ca 100644 --- a/src/Api/Auth/Models/Response/OrganizationSsoResponseModel.cs +++ b/src/Api/Auth/Models/Response/OrganizationSsoResponseModel.cs @@ -1,4 +1,5 @@ -using Bit.Core.Auth.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Auth.Entities; using Bit.Core.Auth.Models.Data; using Bit.Core.Entities; using Bit.Core.Models.Api; diff --git a/src/Api/Auth/Models/Response/TwoFactor/TwoFactorDuoResponseModel.cs b/src/Api/Auth/Models/Response/TwoFactor/TwoFactorDuoResponseModel.cs index 775c367a2839..1537c1b93ef9 100644 --- a/src/Api/Auth/Models/Response/TwoFactor/TwoFactorDuoResponseModel.cs +++ b/src/Api/Auth/Models/Response/TwoFactor/TwoFactorDuoResponseModel.cs @@ -1,4 +1,5 @@ -using Bit.Core.Auth.Enums; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Auth.Enums; using Bit.Core.Auth.Models; using Bit.Core.Entities; using Bit.Core.Models.Api; diff --git a/src/Api/Auth/Models/Response/TwoFactor/TwoFactorProviderResponseModel.cs b/src/Api/Auth/Models/Response/TwoFactor/TwoFactorProviderResponseModel.cs index 66e41e80e15b..760fddc1fb75 100644 --- a/src/Api/Auth/Models/Response/TwoFactor/TwoFactorProviderResponseModel.cs +++ b/src/Api/Auth/Models/Response/TwoFactor/TwoFactorProviderResponseModel.cs @@ -1,4 +1,5 @@ -using Bit.Core.Auth.Enums; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Auth.Enums; using Bit.Core.Auth.Models; using Bit.Core.Entities; using Bit.Core.Models.Api; diff --git a/src/Api/Controllers/AccountsController.cs b/src/Api/Controllers/AccountsController.cs index 7c36838461f3..a38b2349f4e2 100644 --- a/src/Api/Controllers/AccountsController.cs +++ b/src/Api/Controllers/AccountsController.cs @@ -5,12 +5,16 @@ using Bit.Api.Models.Response; using Bit.Api.Utilities; using Bit.Core; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Enums.Provider; +using Bit.Core.AdminConsole.Models.Api.Response; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; using Bit.Core.Auth.Models.Api.Request.Accounts; using Bit.Core.Auth.Models.Api.Response.Accounts; using Bit.Core.Auth.Services; using Bit.Core.Auth.Utilities; using Bit.Core.Enums; -using Bit.Core.Enums.Provider; using Bit.Core.Exceptions; using Bit.Core.Models.Api.Response; using Bit.Core.Models.Business; diff --git a/src/Api/Controllers/EventsController.cs b/src/Api/Controllers/EventsController.cs index 585568db61b4..82522e9e1d35 100644 --- a/src/Api/Controllers/EventsController.cs +++ b/src/Api/Controllers/EventsController.cs @@ -1,4 +1,5 @@ using Bit.Api.Models.Response; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Context; using Bit.Core.Exceptions; using Bit.Core.Models.Data; diff --git a/src/Api/Controllers/LicensesController.cs b/src/Api/Controllers/LicensesController.cs index f5391fddc2e1..6d307106f567 100644 --- a/src/Api/Controllers/LicensesController.cs +++ b/src/Api/Controllers/LicensesController.cs @@ -1,4 +1,5 @@ -using Bit.Core.Context; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.Context; using Bit.Core.Exceptions; using Bit.Core.Models.Api.OrganizationLicenses; using Bit.Core.Models.Business; diff --git a/src/Api/Controllers/OrganizationAuthRequestsController.cs b/src/Api/Controllers/OrganizationAuthRequestsController.cs index 5435b44d9681..350fcabc477a 100644 --- a/src/Api/Controllers/OrganizationAuthRequestsController.cs +++ b/src/Api/Controllers/OrganizationAuthRequestsController.cs @@ -2,7 +2,7 @@ using Bit.Api.Auth.Models.Response; using Bit.Api.Models.Response; using Bit.Core; -using Bit.Core.AdminConsole.OrganizationAuth.Interfaces; +using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationAuth.Interfaces; using Bit.Core.Auth.Models.Api.Request.AuthRequest; using Bit.Core.Auth.Services; using Bit.Core.Context; diff --git a/src/Api/Controllers/OrganizationDomainController.cs b/src/Api/Controllers/OrganizationDomainController.cs index 23e4f51bc70e..db07fb0345f8 100644 --- a/src/Api/Controllers/OrganizationDomainController.cs +++ b/src/Api/Controllers/OrganizationDomainController.cs @@ -2,6 +2,7 @@ using Bit.Api.Models.Request.Organizations; using Bit.Api.Models.Response; using Bit.Api.Models.Response.Organizations; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Context; using Bit.Core.Entities; using Bit.Core.Exceptions; diff --git a/src/Api/Controllers/OrganizationSponsorshipsController.cs b/src/Api/Controllers/OrganizationSponsorshipsController.cs index d9715d07c382..7a87c65f1c3b 100644 --- a/src/Api/Controllers/OrganizationSponsorshipsController.cs +++ b/src/Api/Controllers/OrganizationSponsorshipsController.cs @@ -1,5 +1,6 @@ using Bit.Api.Models.Request.Organizations; using Bit.Api.Models.Response.Organizations; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Context; using Bit.Core.Entities; using Bit.Core.Exceptions; diff --git a/src/Api/Controllers/SelfHosted/SelfHostedOrganizationLicensesController.cs b/src/Api/Controllers/SelfHosted/SelfHostedOrganizationLicensesController.cs index acc37692f1ad..ff558743629f 100644 --- a/src/Api/Controllers/SelfHosted/SelfHostedOrganizationLicensesController.cs +++ b/src/Api/Controllers/SelfHosted/SelfHostedOrganizationLicensesController.cs @@ -4,6 +4,8 @@ using Bit.Api.Models.Request.Organizations; using Bit.Api.Models.Response.Organizations; using Bit.Api.Utilities; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; using Bit.Core.Context; using Bit.Core.Enums; using Bit.Core.Exceptions; diff --git a/src/Api/Controllers/SelfHosted/SelfHostedOrganizationSponsorshipsController.cs b/src/Api/Controllers/SelfHosted/SelfHostedOrganizationSponsorshipsController.cs index ffb5c7bb98b5..5853e1771fb4 100644 --- a/src/Api/Controllers/SelfHosted/SelfHostedOrganizationSponsorshipsController.cs +++ b/src/Api/Controllers/SelfHosted/SelfHostedOrganizationSponsorshipsController.cs @@ -1,4 +1,5 @@ using Bit.Api.Models.Request.Organizations; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Context; using Bit.Core.Exceptions; using Bit.Core.OrganizationFeatures.OrganizationSponsorships.FamiliesForEnterprise.Interfaces; diff --git a/src/Api/Jobs/SelfHostedSponsorshipSyncJob.cs b/src/Api/Jobs/SelfHostedSponsorshipSyncJob.cs index d2175982425f..c0eaf216caf4 100644 --- a/src/Api/Jobs/SelfHostedSponsorshipSyncJob.cs +++ b/src/Api/Jobs/SelfHostedSponsorshipSyncJob.cs @@ -1,4 +1,5 @@ -using Bit.Core.Enums; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.Enums; using Bit.Core.Jobs; using Bit.Core.Models.OrganizationConnectionConfigs; using Bit.Core.OrganizationFeatures.OrganizationSponsorships.FamiliesForEnterprise.Interfaces; diff --git a/src/Api/Models/Request/Organizations/SecretsManagerSubscriptionUpdateRequestModel.cs b/src/Api/Models/Request/Organizations/SecretsManagerSubscriptionUpdateRequestModel.cs index 96e9603fc3ef..cb1e2e3789ef 100644 --- a/src/Api/Models/Request/Organizations/SecretsManagerSubscriptionUpdateRequestModel.cs +++ b/src/Api/Models/Request/Organizations/SecretsManagerSubscriptionUpdateRequestModel.cs @@ -1,4 +1,5 @@ using System.ComponentModel.DataAnnotations; +using Bit.Core.AdminConsole.Entities; using Bit.Core.Entities; using Bit.Core.Models.Business; diff --git a/src/Api/Models/Response/ApiKeyResponseModel.cs b/src/Api/Models/Response/ApiKeyResponseModel.cs index 0661b17bc569..6248779e06d7 100644 --- a/src/Api/Models/Response/ApiKeyResponseModel.cs +++ b/src/Api/Models/Response/ApiKeyResponseModel.cs @@ -1,4 +1,5 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Entities; using Bit.Core.Models.Api; namespace Bit.Api.Models.Response; diff --git a/src/Api/Models/Response/ProfileResponseModel.cs b/src/Api/Models/Response/ProfileResponseModel.cs index 312e7ed7e557..9081334a701d 100644 --- a/src/Api/Models/Response/ProfileResponseModel.cs +++ b/src/Api/Models/Response/ProfileResponseModel.cs @@ -1,9 +1,10 @@ using Bit.Api.AdminConsole.Models.Response; using Bit.Api.AdminConsole.Models.Response.Providers; +using Bit.Core.AdminConsole.Models.Data.Organizations.OrganizationUsers; +using Bit.Core.AdminConsole.Models.Data.Provider; using Bit.Core.Entities; using Bit.Core.Models.Api; using Bit.Core.Models.Data; -using Bit.Core.Models.Data.Organizations.OrganizationUsers; namespace Bit.Api.Models.Response; diff --git a/src/Api/SecretsManager/Controllers/AccessPoliciesController.cs b/src/Api/SecretsManager/Controllers/AccessPoliciesController.cs index 3e07d505d030..fe99e94c66d8 100644 --- a/src/Api/SecretsManager/Controllers/AccessPoliciesController.cs +++ b/src/Api/SecretsManager/Controllers/AccessPoliciesController.cs @@ -1,6 +1,8 @@ using Bit.Api.Models.Response; using Bit.Api.SecretsManager.Models.Request; using Bit.Api.SecretsManager.Models.Response; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Context; using Bit.Core.Enums; using Bit.Core.Exceptions; diff --git a/src/Api/SecretsManager/Controllers/SecretsController.cs b/src/Api/SecretsManager/Controllers/SecretsController.cs index d8e09fe17b0d..6a43428ccf04 100644 --- a/src/Api/SecretsManager/Controllers/SecretsController.cs +++ b/src/Api/SecretsManager/Controllers/SecretsController.cs @@ -1,6 +1,7 @@ using Bit.Api.Models.Response; using Bit.Api.SecretsManager.Models.Request; using Bit.Api.SecretsManager.Models.Response; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Context; using Bit.Core.Enums; using Bit.Core.Exceptions; diff --git a/src/Api/SecretsManager/Controllers/ServiceAccountsController.cs b/src/Api/SecretsManager/Controllers/ServiceAccountsController.cs index 28fb9671064c..398654bd0897 100644 --- a/src/Api/SecretsManager/Controllers/ServiceAccountsController.cs +++ b/src/Api/SecretsManager/Controllers/ServiceAccountsController.cs @@ -1,6 +1,7 @@ using Bit.Api.Models.Response; using Bit.Api.SecretsManager.Models.Request; using Bit.Api.SecretsManager.Models.Response; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Context; using Bit.Core.Enums; using Bit.Core.Exceptions; diff --git a/src/Api/SecretsManager/Models/Response/PotentialGranteeResponseModel.cs b/src/Api/SecretsManager/Models/Response/PotentialGranteeResponseModel.cs index e62437083026..f25bc43a8680 100644 --- a/src/Api/SecretsManager/Models/Response/PotentialGranteeResponseModel.cs +++ b/src/Api/SecretsManager/Models/Response/PotentialGranteeResponseModel.cs @@ -1,6 +1,7 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Models.Data.Organizations.OrganizationUsers; +using Bit.Core.Entities; using Bit.Core.Models.Api; -using Bit.Core.Models.Data.Organizations.OrganizationUsers; using Bit.Core.SecretsManager.Entities; namespace Bit.Api.SecretsManager.Models.Response; diff --git a/src/Api/Tools/Controllers/ImportCiphersController.cs b/src/Api/Tools/Controllers/ImportCiphersController.cs index d3ed7444f3b7..b921bd1a70b2 100644 --- a/src/Api/Tools/Controllers/ImportCiphersController.cs +++ b/src/Api/Tools/Controllers/ImportCiphersController.cs @@ -1,5 +1,6 @@ using Bit.Api.Tools.Models.Request.Accounts; using Bit.Api.Tools.Models.Request.Organizations; +using Bit.Core.AdminConsole.Services; using Bit.Core.Context; using Bit.Core.Exceptions; using Bit.Core.Repositories; diff --git a/src/Api/Vault/Controllers/CiphersController.cs b/src/Api/Vault/Controllers/CiphersController.cs index 6a7de61f9d8f..ad0db8f6b3b5 100644 --- a/src/Api/Vault/Controllers/CiphersController.cs +++ b/src/Api/Vault/Controllers/CiphersController.cs @@ -6,6 +6,7 @@ using Bit.Api.Vault.Models.Request; using Bit.Api.Vault.Models.Response; using Bit.Core; +using Bit.Core.AdminConsole.Services; using Bit.Core.Context; using Bit.Core.Entities; using Bit.Core.Exceptions; diff --git a/src/Api/Vault/Controllers/SyncController.cs b/src/Api/Vault/Controllers/SyncController.cs index ec9ab4f96dd8..c2afbf244635 100644 --- a/src/Api/Vault/Controllers/SyncController.cs +++ b/src/Api/Vault/Controllers/SyncController.cs @@ -1,7 +1,10 @@ using Bit.Api.Vault.Models.Response; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Enums.Provider; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Entities; using Bit.Core.Enums; -using Bit.Core.Enums.Provider; using Bit.Core.Exceptions; using Bit.Core.Models.Data; using Bit.Core.Repositories; diff --git a/src/Api/Vault/Models/Response/SyncResponseModel.cs b/src/Api/Vault/Models/Response/SyncResponseModel.cs index 386b7445be74..bda3a7296c41 100644 --- a/src/Api/Vault/Models/Response/SyncResponseModel.cs +++ b/src/Api/Vault/Models/Response/SyncResponseModel.cs @@ -1,10 +1,13 @@ using Bit.Api.Models.Response; using Bit.Api.Tools.Models.Response; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Models.Api.Response; +using Bit.Core.AdminConsole.Models.Data.Organizations.OrganizationUsers; +using Bit.Core.AdminConsole.Models.Data.Provider; using Bit.Core.Entities; using Bit.Core.Models.Api; using Bit.Core.Models.Api.Response; using Bit.Core.Models.Data; -using Bit.Core.Models.Data.Organizations.OrganizationUsers; using Bit.Core.Settings; using Bit.Core.Tools.Entities; using Bit.Core.Vault.Entities; diff --git a/src/Billing/Controllers/BitPayController.cs b/src/Billing/Controllers/BitPayController.cs index bf90a8851934..ffb826ba60f2 100644 --- a/src/Billing/Controllers/BitPayController.cs +++ b/src/Billing/Controllers/BitPayController.cs @@ -1,5 +1,6 @@ using System.Globalization; using Bit.Billing.Models; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Repositories; diff --git a/src/Billing/Controllers/FreshdeskController.cs b/src/Billing/Controllers/FreshdeskController.cs index 1b6ddea4296e..e8f5f890b290 100644 --- a/src/Billing/Controllers/FreshdeskController.cs +++ b/src/Billing/Controllers/FreshdeskController.cs @@ -3,6 +3,7 @@ using System.Text; using System.Web; using Bit.Billing.Models; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Repositories; using Bit.Core.Settings; using Bit.Core.Utilities; diff --git a/src/Billing/Controllers/FreshsalesController.cs b/src/Billing/Controllers/FreshsalesController.cs index 95b9e2506511..63bed9482c5b 100644 --- a/src/Billing/Controllers/FreshsalesController.cs +++ b/src/Billing/Controllers/FreshsalesController.cs @@ -1,5 +1,6 @@ using System.Net.Http.Headers; using System.Text.Json.Serialization; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Enums; using Bit.Core.Repositories; using Bit.Core.Settings; diff --git a/src/Billing/Controllers/PayPalController.cs b/src/Billing/Controllers/PayPalController.cs index c0d3a2700a89..68c41d006880 100644 --- a/src/Billing/Controllers/PayPalController.cs +++ b/src/Billing/Controllers/PayPalController.cs @@ -1,5 +1,6 @@ using System.Text; using Bit.Billing.Utilities; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Repositories; diff --git a/src/Billing/Controllers/StripeController.cs b/src/Billing/Controllers/StripeController.cs index fb63e1993e36..932c86f30d10 100644 --- a/src/Billing/Controllers/StripeController.cs +++ b/src/Billing/Controllers/StripeController.cs @@ -1,5 +1,8 @@ using Bit.Billing.Constants; using Bit.Billing.Services; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; using Bit.Core.Context; using Bit.Core.Entities; using Bit.Core.Enums; diff --git a/src/Core/Context/CurrentContextOrganization.cs b/src/Core/AdminConsole/Context/CurrentContextOrganization.cs similarity index 79% rename from src/Core/Context/CurrentContextOrganization.cs rename to src/Core/AdminConsole/Context/CurrentContextOrganization.cs index fbef49c5aa65..000c622c9882 100644 --- a/src/Core/Context/CurrentContextOrganization.cs +++ b/src/Core/AdminConsole/Context/CurrentContextOrganization.cs @@ -1,9 +1,10 @@ -using Bit.Core.Enums; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Models.Data.Organizations.OrganizationUsers; +using Bit.Core.Enums; using Bit.Core.Models.Data; -using Bit.Core.Models.Data.Organizations.OrganizationUsers; using Bit.Core.Utilities; -namespace Bit.Core.Context; +namespace Bit.Core.AdminConsole.Context; public class CurrentContextOrganization { diff --git a/src/Core/Context/CurrentContextProvider.cs b/src/Core/AdminConsole/Context/CurrentContextProvider.cs similarity index 79% rename from src/Core/Context/CurrentContextProvider.cs rename to src/Core/AdminConsole/Context/CurrentContextProvider.cs index 57792840cc4f..78a5565e80ca 100644 --- a/src/Core/Context/CurrentContextProvider.cs +++ b/src/Core/AdminConsole/Context/CurrentContextProvider.cs @@ -1,9 +1,9 @@ -using Bit.Core.Entities.Provider; -using Bit.Core.Enums.Provider; +using Bit.Core.AdminConsole.Entities.Provider; +using Bit.Core.AdminConsole.Enums.Provider; using Bit.Core.Models.Data; using Bit.Core.Utilities; -namespace Bit.Core.Context; +namespace Bit.Core.AdminConsole.Context; public class CurrentContextProvider { diff --git a/src/Core/Entities/Group.cs b/src/Core/AdminConsole/Entities/Group.cs similarity index 90% rename from src/Core/Entities/Group.cs rename to src/Core/AdminConsole/Entities/Group.cs index 3c15380fa48a..19b9b6d005f9 100644 --- a/src/Core/Entities/Group.cs +++ b/src/Core/AdminConsole/Entities/Group.cs @@ -1,8 +1,9 @@ using System.ComponentModel.DataAnnotations; +using Bit.Core.Entities; using Bit.Core.Models; using Bit.Core.Utilities; -namespace Bit.Core.Entities; +namespace Bit.Core.AdminConsole.Entities; public class Group : ITableObject, IExternal { diff --git a/src/Core/Entities/GroupUser.cs b/src/Core/AdminConsole/Entities/GroupUser.cs similarity index 71% rename from src/Core/Entities/GroupUser.cs rename to src/Core/AdminConsole/Entities/GroupUser.cs index 3497c2c74458..ad889c93ca49 100644 --- a/src/Core/Entities/GroupUser.cs +++ b/src/Core/AdminConsole/Entities/GroupUser.cs @@ -1,4 +1,4 @@ -namespace Bit.Core.Entities; +namespace Bit.Core.AdminConsole.Entities; public class GroupUser { diff --git a/src/Core/Entities/Organization.cs b/src/Core/AdminConsole/Entities/Organization.cs similarity index 98% rename from src/Core/Entities/Organization.cs rename to src/Core/AdminConsole/Entities/Organization.cs index 7deab3299ed6..f57f179e944c 100644 --- a/src/Core/Entities/Organization.cs +++ b/src/Core/AdminConsole/Entities/Organization.cs @@ -1,13 +1,15 @@ using System.ComponentModel.DataAnnotations; using System.Text.Json; +using Bit.Core.AdminConsole.Enums; using Bit.Core.Auth.Enums; using Bit.Core.Auth.Models; +using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Models.Business; using Bit.Core.Tools.Entities; using Bit.Core.Utilities; -namespace Bit.Core.Entities; +namespace Bit.Core.AdminConsole.Entities; public class Organization : ITableObject, ISubscriber, IStorable, IStorableSubscriber, IRevisable, IReferenceable { diff --git a/src/Core/Entities/OrganizationApiKey.cs b/src/Core/AdminConsole/Entities/OrganizationApiKey.cs similarity index 82% rename from src/Core/Entities/OrganizationApiKey.cs rename to src/Core/AdminConsole/Entities/OrganizationApiKey.cs index af9f3c91227a..ea181c976704 100644 --- a/src/Core/Entities/OrganizationApiKey.cs +++ b/src/Core/AdminConsole/Entities/OrganizationApiKey.cs @@ -1,8 +1,10 @@ using System.ComponentModel.DataAnnotations; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Utilities; -namespace Bit.Core.Entities; +namespace Bit.Core.AdminConsole.Entities; public class OrganizationApiKey : ITableObject { diff --git a/src/Core/Entities/OrganizationUser.cs b/src/Core/AdminConsole/Entities/OrganizationUser.cs similarity index 92% rename from src/Core/Entities/OrganizationUser.cs rename to src/Core/AdminConsole/Entities/OrganizationUser.cs index c5bd39658e12..ef97e63a04b2 100644 --- a/src/Core/Entities/OrganizationUser.cs +++ b/src/Core/AdminConsole/Entities/OrganizationUser.cs @@ -1,10 +1,12 @@ using System.ComponentModel.DataAnnotations; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Models; using Bit.Core.Models.Data; using Bit.Core.Utilities; -namespace Bit.Core.Entities; +namespace Bit.Core.AdminConsole.Entities; public class OrganizationUser : ITableObject, IExternal { diff --git a/src/Core/Entities/Policy.cs b/src/Core/AdminConsole/Entities/Policy.cs similarity index 80% rename from src/Core/Entities/Policy.cs rename to src/Core/AdminConsole/Entities/Policy.cs index 4863b8ccc80c..684e9360014b 100644 --- a/src/Core/Entities/Policy.cs +++ b/src/Core/AdminConsole/Entities/Policy.cs @@ -1,8 +1,10 @@ -using Bit.Core.Enums; -using Bit.Core.Models.Data.Organizations.Policies; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Models.Data.Organizations.Policies; +using Bit.Core.Entities; +using Bit.Core.Enums; using Bit.Core.Utilities; -namespace Bit.Core.Entities; +namespace Bit.Core.AdminConsole.Entities; public class Policy : ITableObject { diff --git a/src/Core/Entities/Provider/Provider.cs b/src/Core/AdminConsole/Entities/Provider/Provider.cs similarity index 88% rename from src/Core/Entities/Provider/Provider.cs rename to src/Core/AdminConsole/Entities/Provider/Provider.cs index 82b1f727e437..7aeb422cf3e3 100644 --- a/src/Core/Entities/Provider/Provider.cs +++ b/src/Core/AdminConsole/Entities/Provider/Provider.cs @@ -1,7 +1,8 @@ -using Bit.Core.Enums.Provider; +using Bit.Core.AdminConsole.Enums.Provider; +using Bit.Core.Entities; using Bit.Core.Utilities; -namespace Bit.Core.Entities.Provider; +namespace Bit.Core.AdminConsole.Entities.Provider; public class Provider : ITableObject { diff --git a/src/Core/Entities/Provider/ProviderOrganization.cs b/src/Core/AdminConsole/Entities/Provider/ProviderOrganization.cs similarity index 83% rename from src/Core/Entities/Provider/ProviderOrganization.cs rename to src/Core/AdminConsole/Entities/Provider/ProviderOrganization.cs index 6cafef67b7b1..8396846ad45d 100644 --- a/src/Core/Entities/Provider/ProviderOrganization.cs +++ b/src/Core/AdminConsole/Entities/Provider/ProviderOrganization.cs @@ -1,6 +1,7 @@ -using Bit.Core.Utilities; +using Bit.Core.Entities; +using Bit.Core.Utilities; -namespace Bit.Core.Entities.Provider; +namespace Bit.Core.AdminConsole.Entities.Provider; public class ProviderOrganization : ITableObject { diff --git a/src/Core/Entities/Provider/ProviderUser.cs b/src/Core/AdminConsole/Entities/Provider/ProviderUser.cs similarity index 84% rename from src/Core/Entities/Provider/ProviderUser.cs rename to src/Core/AdminConsole/Entities/Provider/ProviderUser.cs index 9b86d591c98d..6e5b12934b59 100644 --- a/src/Core/Entities/Provider/ProviderUser.cs +++ b/src/Core/AdminConsole/Entities/Provider/ProviderUser.cs @@ -1,7 +1,8 @@ -using Bit.Core.Enums.Provider; +using Bit.Core.AdminConsole.Enums.Provider; +using Bit.Core.Entities; using Bit.Core.Utilities; -namespace Bit.Core.Entities.Provider; +namespace Bit.Core.AdminConsole.Entities.Provider; public class ProviderUser : ITableObject { diff --git a/src/Core/Enums/OrganizationApiKeyType.cs b/src/Core/AdminConsole/Enums/OrganizationApiKeyType.cs similarity index 70% rename from src/Core/Enums/OrganizationApiKeyType.cs rename to src/Core/AdminConsole/Enums/OrganizationApiKeyType.cs index 8fdbf931aadf..42168eb1b30a 100644 --- a/src/Core/Enums/OrganizationApiKeyType.cs +++ b/src/Core/AdminConsole/Enums/OrganizationApiKeyType.cs @@ -1,4 +1,4 @@ -namespace Bit.Core.Enums; +namespace Bit.Core.AdminConsole.Enums; public enum OrganizationApiKeyType : byte { diff --git a/src/Core/Enums/OrganizationStatusType.cs b/src/Core/AdminConsole/Enums/OrganizationStatusType.cs similarity index 65% rename from src/Core/Enums/OrganizationStatusType.cs rename to src/Core/AdminConsole/Enums/OrganizationStatusType.cs index 1f6fb8d39678..1758d3e18641 100644 --- a/src/Core/Enums/OrganizationStatusType.cs +++ b/src/Core/AdminConsole/Enums/OrganizationStatusType.cs @@ -1,4 +1,4 @@ -namespace Bit.Core.Enums; +namespace Bit.Core.AdminConsole.Enums; public enum OrganizationStatusType : byte { diff --git a/src/Core/Enums/OrganizationUserStatusType.cs b/src/Core/AdminConsole/Enums/OrganizationUserStatusType.cs similarity index 74% rename from src/Core/Enums/OrganizationUserStatusType.cs rename to src/Core/AdminConsole/Enums/OrganizationUserStatusType.cs index 576e98ea741a..a43890584b1b 100644 --- a/src/Core/Enums/OrganizationUserStatusType.cs +++ b/src/Core/AdminConsole/Enums/OrganizationUserStatusType.cs @@ -1,4 +1,4 @@ -namespace Bit.Core.Enums; +namespace Bit.Core.AdminConsole.Enums; public enum OrganizationUserStatusType : short { diff --git a/src/Core/Enums/OrganizationUserType.cs b/src/Core/AdminConsole/Enums/OrganizationUserType.cs similarity index 74% rename from src/Core/Enums/OrganizationUserType.cs rename to src/Core/AdminConsole/Enums/OrganizationUserType.cs index 620eaeb330b0..6ffd62bfab4d 100644 --- a/src/Core/Enums/OrganizationUserType.cs +++ b/src/Core/AdminConsole/Enums/OrganizationUserType.cs @@ -1,4 +1,4 @@ -namespace Bit.Core.Enums; +namespace Bit.Core.AdminConsole.Enums; public enum OrganizationUserType : byte { diff --git a/src/Core/Enums/PolicyType.cs b/src/Core/AdminConsole/Enums/PolicyType.cs similarity index 89% rename from src/Core/Enums/PolicyType.cs rename to src/Core/AdminConsole/Enums/PolicyType.cs index 30dac3d91776..583d1187e8e2 100644 --- a/src/Core/Enums/PolicyType.cs +++ b/src/Core/AdminConsole/Enums/PolicyType.cs @@ -1,4 +1,4 @@ -namespace Bit.Core.Enums; +namespace Bit.Core.AdminConsole.Enums; public enum PolicyType : byte { diff --git a/src/Core/Enums/Provider/ProviderStatusType.cs b/src/Core/AdminConsole/Enums/Provider/ProviderStatusType.cs similarity index 60% rename from src/Core/Enums/Provider/ProviderStatusType.cs rename to src/Core/AdminConsole/Enums/Provider/ProviderStatusType.cs index bcb1f8cd2d50..794bd36bf54a 100644 --- a/src/Core/Enums/Provider/ProviderStatusType.cs +++ b/src/Core/AdminConsole/Enums/Provider/ProviderStatusType.cs @@ -1,4 +1,4 @@ -namespace Bit.Core.Enums.Provider; +namespace Bit.Core.AdminConsole.Enums.Provider; public enum ProviderStatusType : byte { diff --git a/src/Core/Enums/Provider/ProviderType.cs b/src/Core/AdminConsole/Enums/Provider/ProviderType.cs similarity index 87% rename from src/Core/Enums/Provider/ProviderType.cs rename to src/Core/AdminConsole/Enums/Provider/ProviderType.cs index 020f39eba1e3..a159fe2b6b74 100644 --- a/src/Core/Enums/Provider/ProviderType.cs +++ b/src/Core/AdminConsole/Enums/Provider/ProviderType.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace Bit.Core.Enums.Provider; +namespace Bit.Core.AdminConsole.Enums.Provider; public enum ProviderType : byte { diff --git a/src/Core/Enums/Provider/ProviderUserStatusType.cs b/src/Core/AdminConsole/Enums/Provider/ProviderUserStatusType.cs similarity index 66% rename from src/Core/Enums/Provider/ProviderUserStatusType.cs rename to src/Core/AdminConsole/Enums/Provider/ProviderUserStatusType.cs index 60571386d734..bb7b1022f768 100644 --- a/src/Core/Enums/Provider/ProviderUserStatusType.cs +++ b/src/Core/AdminConsole/Enums/Provider/ProviderUserStatusType.cs @@ -1,4 +1,4 @@ -namespace Bit.Core.Enums.Provider; +namespace Bit.Core.AdminConsole.Enums.Provider; public enum ProviderUserStatusType : byte { diff --git a/src/Core/Enums/Provider/ProviderUserType.cs b/src/Core/AdminConsole/Enums/Provider/ProviderUserType.cs similarity index 62% rename from src/Core/Enums/Provider/ProviderUserType.cs rename to src/Core/AdminConsole/Enums/Provider/ProviderUserType.cs index d13591290dce..a903d28a2173 100644 --- a/src/Core/Enums/Provider/ProviderUserType.cs +++ b/src/Core/AdminConsole/Enums/Provider/ProviderUserType.cs @@ -1,4 +1,4 @@ -namespace Bit.Core.Enums.Provider; +namespace Bit.Core.AdminConsole.Enums.Provider; public enum ProviderUserType : byte { diff --git a/src/Core/Models/Api/Response/MasterPasswordPolicyResponseModel.cs b/src/Core/AdminConsole/Models/Api/Response/MasterPasswordPolicyResponseModel.cs similarity index 85% rename from src/Core/Models/Api/Response/MasterPasswordPolicyResponseModel.cs rename to src/Core/AdminConsole/Models/Api/Response/MasterPasswordPolicyResponseModel.cs index 6a2753e76981..3b42e6f6d2e4 100644 --- a/src/Core/Models/Api/Response/MasterPasswordPolicyResponseModel.cs +++ b/src/Core/AdminConsole/Models/Api/Response/MasterPasswordPolicyResponseModel.cs @@ -1,6 +1,7 @@ -using Bit.Core.Models.Data.Organizations.Policies; +using Bit.Core.AdminConsole.Models.Data.Organizations.Policies; +using Bit.Core.Models.Api; -namespace Bit.Core.Models.Api.Response; +namespace Bit.Core.AdminConsole.Models.Api.Response; public class MasterPasswordPolicyResponseModel : ResponseModel { diff --git a/src/Core/Models/Api/Response/PolicyResponseModel.cs b/src/Core/AdminConsole/Models/Api/Response/PolicyResponseModel.cs similarity index 83% rename from src/Core/Models/Api/Response/PolicyResponseModel.cs rename to src/Core/AdminConsole/Models/Api/Response/PolicyResponseModel.cs index 997e918d09be..7ef6b15737fd 100644 --- a/src/Core/Models/Api/Response/PolicyResponseModel.cs +++ b/src/Core/AdminConsole/Models/Api/Response/PolicyResponseModel.cs @@ -1,8 +1,9 @@ using System.Text.Json; -using Bit.Core.Entities; -using Bit.Core.Enums; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.Models.Api; -namespace Bit.Core.Models.Api.Response; +namespace Bit.Core.AdminConsole.Models.Api.Response; public class PolicyResponseModel : ResponseModel { diff --git a/src/Core/Models/Business/ImportedGroup.cs b/src/Core/AdminConsole/Models/Business/ImportedGroup.cs similarity index 58% rename from src/Core/Models/Business/ImportedGroup.cs rename to src/Core/AdminConsole/Models/Business/ImportedGroup.cs index bd0e38933989..bd4e81bf5b57 100644 --- a/src/Core/Models/Business/ImportedGroup.cs +++ b/src/Core/AdminConsole/Models/Business/ImportedGroup.cs @@ -1,6 +1,6 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; -namespace Bit.Core.Models.Business; +namespace Bit.Core.AdminConsole.Models.Business; public class ImportedGroup { diff --git a/src/Core/Models/Business/ImportedOrganizationUser.cs b/src/Core/AdminConsole/Models/Business/ImportedOrganizationUser.cs similarity index 70% rename from src/Core/Models/Business/ImportedOrganizationUser.cs rename to src/Core/AdminConsole/Models/Business/ImportedOrganizationUser.cs index 967cdf253d9d..b516d2327f01 100644 --- a/src/Core/Models/Business/ImportedOrganizationUser.cs +++ b/src/Core/AdminConsole/Models/Business/ImportedOrganizationUser.cs @@ -1,4 +1,4 @@ -namespace Bit.Core.Models.Business; +namespace Bit.Core.AdminConsole.Models.Business; public class ImportedOrganizationUser { diff --git a/src/Core/Models/Business/OrganizationSignup.cs b/src/Core/AdminConsole/Models/Business/OrganizationSignup.cs similarity index 90% rename from src/Core/Models/Business/OrganizationSignup.cs rename to src/Core/AdminConsole/Models/Business/OrganizationSignup.cs index 970ede9afcd6..a1b4d3a13168 100644 --- a/src/Core/Models/Business/OrganizationSignup.cs +++ b/src/Core/AdminConsole/Models/Business/OrganizationSignup.cs @@ -1,7 +1,7 @@ using Bit.Core.Entities; using Bit.Core.Enums; -namespace Bit.Core.Models.Business; +namespace Bit.Core.AdminConsole.Models.Business; public class OrganizationSignup : OrganizationUpgrade { diff --git a/src/Core/Models/Business/OrganizationUpgrade.cs b/src/Core/AdminConsole/Models/Business/OrganizationUpgrade.cs similarity index 87% rename from src/Core/Models/Business/OrganizationUpgrade.cs rename to src/Core/AdminConsole/Models/Business/OrganizationUpgrade.cs index 173502a24fa1..2d8293964857 100644 --- a/src/Core/Models/Business/OrganizationUpgrade.cs +++ b/src/Core/AdminConsole/Models/Business/OrganizationUpgrade.cs @@ -1,6 +1,7 @@ using Bit.Core.Enums; +using Bit.Core.Models.Business; -namespace Bit.Core.Models.Business; +namespace Bit.Core.AdminConsole.Models.Business; public class OrganizationUpgrade { diff --git a/src/Core/Models/Business/OrganizationUserInvite.cs b/src/Core/AdminConsole/Models/Business/OrganizationUserInvite.cs similarity index 77% rename from src/Core/Models/Business/OrganizationUserInvite.cs rename to src/Core/AdminConsole/Models/Business/OrganizationUserInvite.cs index 7102a5f9ef30..efb85f2b77f4 100644 --- a/src/Core/Models/Business/OrganizationUserInvite.cs +++ b/src/Core/AdminConsole/Models/Business/OrganizationUserInvite.cs @@ -1,12 +1,13 @@ -using Bit.Core.Models.Data; -using Bit.Core.Models.Data.Organizations.OrganizationUsers; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Models.Data.Organizations.OrganizationUsers; +using Bit.Core.Models.Data; -namespace Bit.Core.Models.Business; +namespace Bit.Core.AdminConsole.Models.Business; public class OrganizationUserInvite { public IEnumerable Emails { get; set; } - public Enums.OrganizationUserType? Type { get; set; } + public OrganizationUserType? Type { get; set; } public bool AccessAll { get; set; } public bool AccessSecretsManager { get; set; } public Permissions Permissions { get; set; } diff --git a/src/Core/Models/Business/Provider/ProviderUserInvite.cs b/src/Core/AdminConsole/Models/Business/Provider/ProviderUserInvite.cs similarity index 90% rename from src/Core/Models/Business/Provider/ProviderUserInvite.cs rename to src/Core/AdminConsole/Models/Business/Provider/ProviderUserInvite.cs index 0fbe3d87c2ab..53cdefb3f96a 100644 --- a/src/Core/Models/Business/Provider/ProviderUserInvite.cs +++ b/src/Core/AdminConsole/Models/Business/Provider/ProviderUserInvite.cs @@ -1,6 +1,6 @@ -using Bit.Core.Enums.Provider; +using Bit.Core.AdminConsole.Enums.Provider; -namespace Bit.Core.Models.Business.Provider; +namespace Bit.Core.AdminConsole.Models.Business.Provider; public class ProviderUserInvite { diff --git a/src/Core/Models/Data/GroupWithCollections.cs b/src/Core/AdminConsole/Models/Data/GroupWithCollections.cs similarity index 58% rename from src/Core/Models/Data/GroupWithCollections.cs rename to src/Core/AdminConsole/Models/Data/GroupWithCollections.cs index 3fa08bc45b84..e9ba5125740a 100644 --- a/src/Core/Models/Data/GroupWithCollections.cs +++ b/src/Core/AdminConsole/Models/Data/GroupWithCollections.cs @@ -1,7 +1,7 @@ using System.Data; -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; -namespace Bit.Core.Models.Data; +namespace Bit.Core.AdminConsole.Models.Data; public class GroupWithCollections : Group { diff --git a/src/Core/Models/Data/Organizations/OrganizationAbility.cs b/src/Core/AdminConsole/Models/Data/Organizations/OrganizationAbility.cs similarity index 92% rename from src/Core/Models/Data/Organizations/OrganizationAbility.cs rename to src/Core/AdminConsole/Models/Data/Organizations/OrganizationAbility.cs index 22bf4008eb36..9b09fb1c51da 100644 --- a/src/Core/Models/Data/Organizations/OrganizationAbility.cs +++ b/src/Core/AdminConsole/Models/Data/Organizations/OrganizationAbility.cs @@ -1,6 +1,6 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; -namespace Bit.Core.Models.Data.Organizations; +namespace Bit.Core.AdminConsole.Models.Data.Organizations; public class OrganizationAbility { diff --git a/src/Core/Models/Data/Organizations/OrganizationUsers/OrganizationUserInviteData.cs b/src/Core/AdminConsole/Models/Data/Organizations/OrganizationUsers/OrganizationUserInviteData.cs similarity index 74% rename from src/Core/Models/Data/Organizations/OrganizationUsers/OrganizationUserInviteData.cs rename to src/Core/AdminConsole/Models/Data/Organizations/OrganizationUsers/OrganizationUserInviteData.cs index f8789fe5d5d6..2c2999fe688a 100644 --- a/src/Core/Models/Data/Organizations/OrganizationUsers/OrganizationUserInviteData.cs +++ b/src/Core/AdminConsole/Models/Data/Organizations/OrganizationUsers/OrganizationUserInviteData.cs @@ -1,6 +1,7 @@ -using Bit.Core.Enums; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.Models.Data; -namespace Bit.Core.Models.Data.Organizations.OrganizationUsers; +namespace Bit.Core.AdminConsole.Models.Data.Organizations.OrganizationUsers; public class OrganizationUserInviteData { diff --git a/src/Core/Models/Data/Organizations/OrganizationUsers/OrganizationUserOrganizationDetails.cs b/src/Core/AdminConsole/Models/Data/Organizations/OrganizationUsers/OrganizationUserOrganizationDetails.cs similarity index 85% rename from src/Core/Models/Data/Organizations/OrganizationUsers/OrganizationUserOrganizationDetails.cs rename to src/Core/AdminConsole/Models/Data/Organizations/OrganizationUsers/OrganizationUserOrganizationDetails.cs index 0470d5ebc3b3..97749148882b 100644 --- a/src/Core/Models/Data/Organizations/OrganizationUsers/OrganizationUserOrganizationDetails.cs +++ b/src/Core/AdminConsole/Models/Data/Organizations/OrganizationUsers/OrganizationUserOrganizationDetails.cs @@ -1,6 +1,7 @@ -using Bit.Core.Enums.Provider; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Enums.Provider; -namespace Bit.Core.Models.Data.Organizations.OrganizationUsers; +namespace Bit.Core.AdminConsole.Models.Data.Organizations.OrganizationUsers; public class OrganizationUserOrganizationDetails { @@ -26,10 +27,10 @@ public class OrganizationUserOrganizationDetails public short? MaxCollections { get; set; } public short? MaxStorageGb { get; set; } public string Key { get; set; } - public Enums.OrganizationUserStatusType Status { get; set; } - public Enums.OrganizationUserType Type { get; set; } + public OrganizationUserStatusType Status { get; set; } + public OrganizationUserType Type { get; set; } public bool Enabled { get; set; } - public Enums.PlanType PlanType { get; set; } + public Core.Enums.PlanType PlanType { get; set; } public string SsoExternalId { get; set; } public string Identifier { get; set; } public string Permissions { get; set; } diff --git a/src/Core/Models/Data/Organizations/OrganizationUsers/OrganizationUserPolicyDetails.cs b/src/Core/AdminConsole/Models/Data/Organizations/OrganizationUsers/OrganizationUserPolicyDetails.cs similarity index 82% rename from src/Core/Models/Data/Organizations/OrganizationUsers/OrganizationUserPolicyDetails.cs rename to src/Core/AdminConsole/Models/Data/Organizations/OrganizationUsers/OrganizationUserPolicyDetails.cs index 1ae93ccf5321..05656d8f2fb7 100644 --- a/src/Core/Models/Data/Organizations/OrganizationUsers/OrganizationUserPolicyDetails.cs +++ b/src/Core/AdminConsole/Models/Data/Organizations/OrganizationUsers/OrganizationUserPolicyDetails.cs @@ -1,6 +1,6 @@ -using Bit.Core.Enums; +using Bit.Core.AdminConsole.Enums; -namespace Bit.Core.Models.Data.Organizations.OrganizationUsers; +namespace Bit.Core.AdminConsole.Models.Data.Organizations.OrganizationUsers; public class OrganizationUserPolicyDetails { diff --git a/src/Core/Models/Data/Organizations/OrganizationUsers/OrganizationUserPublicKey.cs b/src/Core/AdminConsole/Models/Data/Organizations/OrganizationUsers/OrganizationUserPublicKey.cs similarity index 66% rename from src/Core/Models/Data/Organizations/OrganizationUsers/OrganizationUserPublicKey.cs rename to src/Core/AdminConsole/Models/Data/Organizations/OrganizationUsers/OrganizationUserPublicKey.cs index 7c04967872f1..5a47d9ea971f 100644 --- a/src/Core/Models/Data/Organizations/OrganizationUsers/OrganizationUserPublicKey.cs +++ b/src/Core/AdminConsole/Models/Data/Organizations/OrganizationUsers/OrganizationUserPublicKey.cs @@ -1,4 +1,4 @@ -namespace Bit.Core.Models.Data.Organizations.OrganizationUsers; +namespace Bit.Core.AdminConsole.Models.Data.Organizations.OrganizationUsers; public class OrganizationUserPublicKey { diff --git a/src/Core/Models/Data/Organizations/OrganizationUsers/OrganizationUserResetPasswordDetails.cs b/src/Core/AdminConsole/Models/Data/Organizations/OrganizationUsers/OrganizationUserResetPasswordDetails.cs similarity index 87% rename from src/Core/Models/Data/Organizations/OrganizationUsers/OrganizationUserResetPasswordDetails.cs rename to src/Core/AdminConsole/Models/Data/Organizations/OrganizationUsers/OrganizationUserResetPasswordDetails.cs index 6edba19d9998..6a1ba7569a67 100644 --- a/src/Core/Models/Data/Organizations/OrganizationUsers/OrganizationUserResetPasswordDetails.cs +++ b/src/Core/AdminConsole/Models/Data/Organizations/OrganizationUsers/OrganizationUserResetPasswordDetails.cs @@ -1,7 +1,8 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Entities; using Bit.Core.Enums; -namespace Bit.Core.Models.Data.Organizations.OrganizationUsers; +namespace Bit.Core.AdminConsole.Models.Data.Organizations.OrganizationUsers; public class OrganizationUserResetPasswordDetails { diff --git a/src/Core/Models/Data/Organizations/OrganizationUsers/OrganizationUserUserDetails.cs b/src/Core/AdminConsole/Models/Data/Organizations/OrganizationUsers/OrganizationUserUserDetails.cs similarity index 91% rename from src/Core/Models/Data/Organizations/OrganizationUsers/OrganizationUserUserDetails.cs rename to src/Core/AdminConsole/Models/Data/Organizations/OrganizationUsers/OrganizationUserUserDetails.cs index 0da749cad5d5..ccede98052c0 100644 --- a/src/Core/Models/Data/Organizations/OrganizationUsers/OrganizationUserUserDetails.cs +++ b/src/Core/AdminConsole/Models/Data/Organizations/OrganizationUsers/OrganizationUserUserDetails.cs @@ -1,9 +1,11 @@ -using Bit.Core.Auth.Enums; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.Auth.Enums; using Bit.Core.Auth.Models; -using Bit.Core.Enums; +using Bit.Core.Models; +using Bit.Core.Models.Data; using Bit.Core.Utilities; -namespace Bit.Core.Models.Data.Organizations.OrganizationUsers; +namespace Bit.Core.AdminConsole.Models.Data.Organizations.OrganizationUsers; public class OrganizationUserUserDetails : IExternal, ITwoFactorProvidersUser { diff --git a/src/Core/Models/Data/Organizations/OrganizationUsers/OrganizationUserWithCollections.cs b/src/Core/AdminConsole/Models/Data/Organizations/OrganizationUsers/OrganizationUserWithCollections.cs similarity index 54% rename from src/Core/Models/Data/Organizations/OrganizationUsers/OrganizationUserWithCollections.cs rename to src/Core/AdminConsole/Models/Data/Organizations/OrganizationUsers/OrganizationUserWithCollections.cs index d86c6c158101..7bd3a754a437 100644 --- a/src/Core/Models/Data/Organizations/OrganizationUsers/OrganizationUserWithCollections.cs +++ b/src/Core/AdminConsole/Models/Data/Organizations/OrganizationUsers/OrganizationUserWithCollections.cs @@ -1,7 +1,7 @@ using System.Data; -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; -namespace Bit.Core.Models.Data.Organizations.OrganizationUsers; +namespace Bit.Core.AdminConsole.Models.Data.Organizations.OrganizationUsers; public class OrganizationUserWithCollections : OrganizationUser { diff --git a/src/Core/AdminConsole/Models/Data/Organizations/Policies/IPolicyDataModel.cs b/src/Core/AdminConsole/Models/Data/Organizations/Policies/IPolicyDataModel.cs new file mode 100644 index 000000000000..9e666f5a10f3 --- /dev/null +++ b/src/Core/AdminConsole/Models/Data/Organizations/Policies/IPolicyDataModel.cs @@ -0,0 +1,5 @@ +namespace Bit.Core.AdminConsole.Models.Data.Organizations.Policies; + +public interface IPolicyDataModel +{ +} diff --git a/src/Core/Models/Data/Organizations/Policies/MasterPasswordPolicyData.cs b/src/Core/AdminConsole/Models/Data/Organizations/Policies/MasterPasswordPolicyData.cs similarity index 95% rename from src/Core/Models/Data/Organizations/Policies/MasterPasswordPolicyData.cs rename to src/Core/AdminConsole/Models/Data/Organizations/Policies/MasterPasswordPolicyData.cs index 30294620bf55..f2f275b7088b 100644 --- a/src/Core/Models/Data/Organizations/Policies/MasterPasswordPolicyData.cs +++ b/src/Core/AdminConsole/Models/Data/Organizations/Policies/MasterPasswordPolicyData.cs @@ -1,4 +1,4 @@ -namespace Bit.Core.Models.Data.Organizations.Policies; +namespace Bit.Core.AdminConsole.Models.Data.Organizations.Policies; public class MasterPasswordPolicyData : IPolicyDataModel { diff --git a/src/Core/Models/Data/Organizations/Policies/ResetPasswordDataModel.cs b/src/Core/AdminConsole/Models/Data/Organizations/Policies/ResetPasswordDataModel.cs similarity index 75% rename from src/Core/Models/Data/Organizations/Policies/ResetPasswordDataModel.cs rename to src/Core/AdminConsole/Models/Data/Organizations/Policies/ResetPasswordDataModel.cs index 1931cc5b7995..62c8473612e9 100644 --- a/src/Core/Models/Data/Organizations/Policies/ResetPasswordDataModel.cs +++ b/src/Core/AdminConsole/Models/Data/Organizations/Policies/ResetPasswordDataModel.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace Bit.Core.Models.Data.Organizations.Policies; +namespace Bit.Core.AdminConsole.Models.Data.Organizations.Policies; public class ResetPasswordDataModel : IPolicyDataModel { diff --git a/src/Core/Models/Data/Organizations/Policies/SendOptionsPolicyData.cs b/src/Core/AdminConsole/Models/Data/Organizations/Policies/SendOptionsPolicyData.cs similarity index 74% rename from src/Core/Models/Data/Organizations/Policies/SendOptionsPolicyData.cs rename to src/Core/AdminConsole/Models/Data/Organizations/Policies/SendOptionsPolicyData.cs index aa9f6516655c..57a8544b40b0 100644 --- a/src/Core/Models/Data/Organizations/Policies/SendOptionsPolicyData.cs +++ b/src/Core/AdminConsole/Models/Data/Organizations/Policies/SendOptionsPolicyData.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace Bit.Core.Models.Data.Organizations.Policies; +namespace Bit.Core.AdminConsole.Models.Data.Organizations.Policies; public class SendOptionsPolicyData : IPolicyDataModel { diff --git a/src/Core/Models/Data/Organizations/SelfHostedOrganizationDetails.cs b/src/Core/AdminConsole/Models/Data/Organizations/SelfHostedOrganizationDetails.cs similarity index 96% rename from src/Core/Models/Data/Organizations/SelfHostedOrganizationDetails.cs rename to src/Core/AdminConsole/Models/Data/Organizations/SelfHostedOrganizationDetails.cs index b503476a1db8..16a0a8597c41 100644 --- a/src/Core/Models/Data/Organizations/SelfHostedOrganizationDetails.cs +++ b/src/Core/AdminConsole/Models/Data/Organizations/SelfHostedOrganizationDetails.cs @@ -1,11 +1,12 @@ -using Bit.Core.AdminConsole.Models.OrganizationConnectionConfigs; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Models.OrganizationConnectionConfigs; using Bit.Core.Auth.Entities; using Bit.Core.Auth.Enums; using Bit.Core.Entities; -using Bit.Core.Enums; using Bit.Core.Models.Business; -namespace Bit.Core.Models.Data.Organizations; +namespace Bit.Core.AdminConsole.Models.Data.Organizations; public class SelfHostedOrganizationDetails : Organization { diff --git a/src/Core/Models/Data/Provider/ProviderAbility.cs b/src/Core/AdminConsole/Models/Data/Provider/ProviderAbility.cs similarity index 70% rename from src/Core/Models/Data/Provider/ProviderAbility.cs rename to src/Core/AdminConsole/Models/Data/Provider/ProviderAbility.cs index b7e45eaed476..459981681b9d 100644 --- a/src/Core/Models/Data/Provider/ProviderAbility.cs +++ b/src/Core/AdminConsole/Models/Data/Provider/ProviderAbility.cs @@ -1,12 +1,10 @@ -using Bit.Core.Entities.Provider; - -namespace Bit.Core.Models.Data; +namespace Bit.Core.AdminConsole.Models.Data.Provider; public class ProviderAbility { public ProviderAbility() { } - public ProviderAbility(Provider provider) + public ProviderAbility(Entities.Provider.Provider provider) { Id = provider.Id; UseEvents = provider.UseEvents; diff --git a/src/Core/Models/Data/Provider/ProviderOrganizationOrganizationDetails.cs b/src/Core/AdminConsole/Models/Data/Provider/ProviderOrganizationOrganizationDetails.cs similarity index 85% rename from src/Core/Models/Data/Provider/ProviderOrganizationOrganizationDetails.cs rename to src/Core/AdminConsole/Models/Data/Provider/ProviderOrganizationOrganizationDetails.cs index cf4f11b00131..ba44b483667c 100644 --- a/src/Core/Models/Data/Provider/ProviderOrganizationOrganizationDetails.cs +++ b/src/Core/AdminConsole/Models/Data/Provider/ProviderOrganizationOrganizationDetails.cs @@ -1,6 +1,6 @@ -using Bit.Core.Enums; +using Bit.Core.AdminConsole.Enums; -namespace Bit.Core.Models.Data; +namespace Bit.Core.AdminConsole.Models.Data.Provider; public class ProviderOrganizationOrganizationDetails { diff --git a/src/Core/Models/Data/Provider/ProviderOrganizationProviderDetails.cs b/src/Core/AdminConsole/Models/Data/Provider/ProviderOrganizationProviderDetails.cs similarity index 72% rename from src/Core/Models/Data/Provider/ProviderOrganizationProviderDetails.cs rename to src/Core/AdminConsole/Models/Data/Provider/ProviderOrganizationProviderDetails.cs index 8ae9559c8637..e0a6faabbf12 100644 --- a/src/Core/Models/Data/Provider/ProviderOrganizationProviderDetails.cs +++ b/src/Core/AdminConsole/Models/Data/Provider/ProviderOrganizationProviderDetails.cs @@ -1,6 +1,6 @@ -using Bit.Core.Enums.Provider; +using Bit.Core.AdminConsole.Enums.Provider; -namespace Bit.Core.Models.Data; +namespace Bit.Core.AdminConsole.Models.Data.Provider; public class ProviderOrganizationProviderDetails { diff --git a/src/Core/Models/Data/Provider/ProviderUserOrganizationDetails.cs b/src/Core/AdminConsole/Models/Data/Provider/ProviderUserOrganizationDetails.cs similarity index 89% rename from src/Core/Models/Data/Provider/ProviderUserOrganizationDetails.cs rename to src/Core/AdminConsole/Models/Data/Provider/ProviderUserOrganizationDetails.cs index 2d06fc429691..92f420a5b554 100644 --- a/src/Core/Models/Data/Provider/ProviderUserOrganizationDetails.cs +++ b/src/Core/AdminConsole/Models/Data/Provider/ProviderUserOrganizationDetails.cs @@ -1,6 +1,6 @@ -using Bit.Core.Enums.Provider; +using Bit.Core.AdminConsole.Enums.Provider; -namespace Bit.Core.Models.Data; +namespace Bit.Core.AdminConsole.Models.Data.Provider; public class ProviderUserOrganizationDetails { @@ -34,5 +34,5 @@ public class ProviderUserOrganizationDetails public Guid? ProviderId { get; set; } public Guid? ProviderUserId { get; set; } public string ProviderName { get; set; } - public Enums.PlanType PlanType { get; set; } + public Core.Enums.PlanType PlanType { get; set; } } diff --git a/src/Core/Models/Data/Provider/ProviderUserProviderDetails.cs b/src/Core/AdminConsole/Models/Data/Provider/ProviderUserProviderDetails.cs similarity index 82% rename from src/Core/Models/Data/Provider/ProviderUserProviderDetails.cs rename to src/Core/AdminConsole/Models/Data/Provider/ProviderUserProviderDetails.cs index 16f2e1dda574..2b7d240a5c35 100644 --- a/src/Core/Models/Data/Provider/ProviderUserProviderDetails.cs +++ b/src/Core/AdminConsole/Models/Data/Provider/ProviderUserProviderDetails.cs @@ -1,6 +1,6 @@ -using Bit.Core.Enums.Provider; +using Bit.Core.AdminConsole.Enums.Provider; -namespace Bit.Core.Models.Data; +namespace Bit.Core.AdminConsole.Models.Data.Provider; public class ProviderUserProviderDetails { diff --git a/src/Core/Models/Data/Provider/ProviderUserPublicKey.cs b/src/Core/AdminConsole/Models/Data/Provider/ProviderUserPublicKey.cs similarity index 72% rename from src/Core/Models/Data/Provider/ProviderUserPublicKey.cs rename to src/Core/AdminConsole/Models/Data/Provider/ProviderUserPublicKey.cs index 0b161fd860de..a9b37b20502a 100644 --- a/src/Core/Models/Data/Provider/ProviderUserPublicKey.cs +++ b/src/Core/AdminConsole/Models/Data/Provider/ProviderUserPublicKey.cs @@ -1,4 +1,4 @@ -namespace Bit.Core.Models.Data; +namespace Bit.Core.AdminConsole.Models.Data.Provider; public class ProviderUserPublicKey { diff --git a/src/Core/Models/Data/Provider/ProviderUserUserDetails.cs b/src/Core/AdminConsole/Models/Data/Provider/ProviderUserUserDetails.cs similarity index 78% rename from src/Core/Models/Data/Provider/ProviderUserUserDetails.cs rename to src/Core/AdminConsole/Models/Data/Provider/ProviderUserUserDetails.cs index 51df1d44ef56..94aa3fa0f33b 100644 --- a/src/Core/Models/Data/Provider/ProviderUserUserDetails.cs +++ b/src/Core/AdminConsole/Models/Data/Provider/ProviderUserUserDetails.cs @@ -1,6 +1,6 @@ -using Bit.Core.Enums.Provider; +using Bit.Core.AdminConsole.Enums.Provider; -namespace Bit.Core.Models.Data; +namespace Bit.Core.AdminConsole.Models.Data.Provider; public class ProviderUserUserDetails { diff --git a/src/Core/OrganizationFeatures/Groups/CreateGroupCommand.cs b/src/Core/AdminConsole/OrganizationFeatures/Groups/CreateGroupCommand.cs similarity index 89% rename from src/Core/OrganizationFeatures/Groups/CreateGroupCommand.cs rename to src/Core/AdminConsole/OrganizationFeatures/Groups/CreateGroupCommand.cs index 10633a7e961b..94e03afd8c10 100644 --- a/src/Core/OrganizationFeatures/Groups/CreateGroupCommand.cs +++ b/src/Core/AdminConsole/OrganizationFeatures/Groups/CreateGroupCommand.cs @@ -1,16 +1,18 @@ -using Bit.Core.Context; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.OrganizationFeatures.Groups.Interfaces; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.Context; using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Exceptions; using Bit.Core.Models.Data; -using Bit.Core.OrganizationFeatures.Groups.Interfaces; using Bit.Core.Repositories; using Bit.Core.Services; using Bit.Core.Tools.Enums; using Bit.Core.Tools.Models.Business; using Bit.Core.Tools.Services; -namespace Bit.Core.OrganizationFeatures.Groups; +namespace Bit.Core.AdminConsole.OrganizationFeatures.Groups; public class CreateGroupCommand : ICreateGroupCommand { @@ -46,7 +48,7 @@ public async Task CreateGroupAsync(Group group, Organization organization, await GroupRepositoryUpdateUsersAsync(group, users); } - await _eventService.LogGroupEventAsync(group, Enums.EventType.Group_Created); + await _eventService.LogGroupEventAsync(group, Core.Enums.EventType.Group_Created); } public async Task CreateGroupAsync(Group group, Organization organization, EventSystemUser systemUser, @@ -61,7 +63,7 @@ public async Task CreateGroupAsync(Group group, Organization organization, Event await GroupRepositoryUpdateUsersAsync(group, users, systemUser); } - await _eventService.LogGroupEventAsync(group, Enums.EventType.Group_Created, systemUser); + await _eventService.LogGroupEventAsync(group, Core.Enums.EventType.Group_Created, systemUser); } private async Task GroupRepositoryCreateGroupAsync(Group group, Organization organization, IEnumerable collections = null) diff --git a/src/Core/OrganizationFeatures/Groups/DeleteGroupCommand.cs b/src/Core/AdminConsole/OrganizationFeatures/Groups/DeleteGroupCommand.cs similarity index 89% rename from src/Core/OrganizationFeatures/Groups/DeleteGroupCommand.cs rename to src/Core/AdminConsole/OrganizationFeatures/Groups/DeleteGroupCommand.cs index 86fb615f82ba..9fbc33f33ab3 100644 --- a/src/Core/OrganizationFeatures/Groups/DeleteGroupCommand.cs +++ b/src/Core/AdminConsole/OrganizationFeatures/Groups/DeleteGroupCommand.cs @@ -1,11 +1,13 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.OrganizationFeatures.Groups.Interfaces; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Exceptions; -using Bit.Core.OrganizationFeatures.Groups.Interfaces; using Bit.Core.Repositories; using Bit.Core.Services; -namespace Bit.Core.OrganizationFeatures.Groups; +namespace Bit.Core.AdminConsole.OrganizationFeatures.Groups; public class DeleteGroupCommand : IDeleteGroupCommand { diff --git a/src/Core/OrganizationFeatures/Groups/Interfaces/ICreateGroupCommand.cs b/src/Core/AdminConsole/OrganizationFeatures/Groups/Interfaces/ICreateGroupCommand.cs similarity index 77% rename from src/Core/OrganizationFeatures/Groups/Interfaces/ICreateGroupCommand.cs rename to src/Core/AdminConsole/OrganizationFeatures/Groups/Interfaces/ICreateGroupCommand.cs index d8da08e8f2ca..54f5bc2ec22b 100644 --- a/src/Core/OrganizationFeatures/Groups/Interfaces/ICreateGroupCommand.cs +++ b/src/Core/AdminConsole/OrganizationFeatures/Groups/Interfaces/ICreateGroupCommand.cs @@ -1,8 +1,9 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Models.Data; -namespace Bit.Core.OrganizationFeatures.Groups.Interfaces; +namespace Bit.Core.AdminConsole.OrganizationFeatures.Groups.Interfaces; public interface ICreateGroupCommand { diff --git a/src/Core/OrganizationFeatures/Groups/Interfaces/IDeleteGroupCommand.cs b/src/Core/AdminConsole/OrganizationFeatures/Groups/Interfaces/IDeleteGroupCommand.cs similarity index 68% rename from src/Core/OrganizationFeatures/Groups/Interfaces/IDeleteGroupCommand.cs rename to src/Core/AdminConsole/OrganizationFeatures/Groups/Interfaces/IDeleteGroupCommand.cs index 6dc9d01f997c..955057c853d1 100644 --- a/src/Core/OrganizationFeatures/Groups/Interfaces/IDeleteGroupCommand.cs +++ b/src/Core/AdminConsole/OrganizationFeatures/Groups/Interfaces/IDeleteGroupCommand.cs @@ -1,7 +1,8 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Entities; using Bit.Core.Enums; -namespace Bit.Core.OrganizationFeatures.Groups.Interfaces; +namespace Bit.Core.AdminConsole.OrganizationFeatures.Groups.Interfaces; public interface IDeleteGroupCommand { diff --git a/src/Core/OrganizationFeatures/Groups/Interfaces/IUpdateGroupCommand.cs b/src/Core/AdminConsole/OrganizationFeatures/Groups/Interfaces/IUpdateGroupCommand.cs similarity index 77% rename from src/Core/OrganizationFeatures/Groups/Interfaces/IUpdateGroupCommand.cs rename to src/Core/AdminConsole/OrganizationFeatures/Groups/Interfaces/IUpdateGroupCommand.cs index 7abb012fad26..97b32fd950bd 100644 --- a/src/Core/OrganizationFeatures/Groups/Interfaces/IUpdateGroupCommand.cs +++ b/src/Core/AdminConsole/OrganizationFeatures/Groups/Interfaces/IUpdateGroupCommand.cs @@ -1,8 +1,9 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Models.Data; -namespace Bit.Core.OrganizationFeatures.Groups.Interfaces; +namespace Bit.Core.AdminConsole.OrganizationFeatures.Groups.Interfaces; public interface IUpdateGroupCommand { diff --git a/src/Core/OrganizationFeatures/Groups/UpdateGroupCommand.cs b/src/Core/AdminConsole/OrganizationFeatures/Groups/UpdateGroupCommand.cs similarity index 89% rename from src/Core/OrganizationFeatures/Groups/UpdateGroupCommand.cs rename to src/Core/AdminConsole/OrganizationFeatures/Groups/UpdateGroupCommand.cs index 857adcc8c0b3..3deb6994ac53 100644 --- a/src/Core/OrganizationFeatures/Groups/UpdateGroupCommand.cs +++ b/src/Core/AdminConsole/OrganizationFeatures/Groups/UpdateGroupCommand.cs @@ -1,12 +1,14 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.OrganizationFeatures.Groups.Interfaces; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Exceptions; using Bit.Core.Models.Data; -using Bit.Core.OrganizationFeatures.Groups.Interfaces; using Bit.Core.Repositories; using Bit.Core.Services; -namespace Bit.Core.OrganizationFeatures.Groups; +namespace Bit.Core.AdminConsole.OrganizationFeatures.Groups; public class UpdateGroupCommand : IUpdateGroupCommand { @@ -36,7 +38,7 @@ public async Task UpdateGroupAsync(Group group, Organization organization, await GroupRepositoryUpdateUsersAsync(group, userIds); } - await _eventService.LogGroupEventAsync(group, Enums.EventType.Group_Updated); + await _eventService.LogGroupEventAsync(group, Core.Enums.EventType.Group_Updated); } public async Task UpdateGroupAsync(Group group, Organization organization, EventSystemUser systemUser, @@ -51,7 +53,7 @@ public async Task UpdateGroupAsync(Group group, Organization organization, Event await GroupRepositoryUpdateUsersAsync(group, userIds, systemUser); } - await _eventService.LogGroupEventAsync(group, Enums.EventType.Group_Updated, systemUser); + await _eventService.LogGroupEventAsync(group, Core.Enums.EventType.Group_Updated, systemUser); } private async Task GroupRepositoryUpdateGroupAsync(Group group, IEnumerable collections = null) diff --git a/src/Core/OrganizationFeatures/OrganizationApiKeys/CreateOrganizationApiKeyCommand.cs b/src/Core/AdminConsole/OrganizationFeatures/OrganizationApiKeys/CreateOrganizationApiKeyCommand.cs similarity index 75% rename from src/Core/OrganizationFeatures/OrganizationApiKeys/CreateOrganizationApiKeyCommand.cs rename to src/Core/AdminConsole/OrganizationFeatures/OrganizationApiKeys/CreateOrganizationApiKeyCommand.cs index d76725c70d31..594637c02db3 100644 --- a/src/Core/OrganizationFeatures/OrganizationApiKeys/CreateOrganizationApiKeyCommand.cs +++ b/src/Core/AdminConsole/OrganizationFeatures/OrganizationApiKeys/CreateOrganizationApiKeyCommand.cs @@ -1,10 +1,13 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationApiKeys.Interfaces; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.Entities; using Bit.Core.Enums; -using Bit.Core.OrganizationFeatures.OrganizationApiKeys.Interfaces; using Bit.Core.Repositories; using Bit.Core.Utilities; -namespace Bit.Core.OrganizationFeatures.OrganizationApiKeys; +namespace Bit.Core.AdminConsole.OrganizationFeatures.OrganizationApiKeys; public class CreateOrganizationApiKeyCommand : ICreateOrganizationApiKeyCommand { diff --git a/src/Core/OrganizationFeatures/OrganizationApiKeys/GetOrganizationApiKeyQuery.cs b/src/Core/AdminConsole/OrganizationFeatures/OrganizationApiKeys/GetOrganizationApiKeyQuery.cs similarity index 77% rename from src/Core/OrganizationFeatures/OrganizationApiKeys/GetOrganizationApiKeyQuery.cs rename to src/Core/AdminConsole/OrganizationFeatures/OrganizationApiKeys/GetOrganizationApiKeyQuery.cs index 6e4a9f5d5d05..084891fabe53 100644 --- a/src/Core/OrganizationFeatures/OrganizationApiKeys/GetOrganizationApiKeyQuery.cs +++ b/src/Core/AdminConsole/OrganizationFeatures/OrganizationApiKeys/GetOrganizationApiKeyQuery.cs @@ -1,9 +1,12 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationApiKeys.Interfaces; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.Entities; using Bit.Core.Enums; -using Bit.Core.OrganizationFeatures.OrganizationApiKeys.Interfaces; using Bit.Core.Repositories; -namespace Bit.Core.OrganizationFeatures.OrganizationApiKeys; +namespace Bit.Core.AdminConsole.OrganizationFeatures.OrganizationApiKeys; public class GetOrganizationApiKeyQuery : IGetOrganizationApiKeyQuery { diff --git a/src/Core/OrganizationFeatures/OrganizationApiKeys/Interfaces/ICreateOrganizationApiKeyCommand.cs b/src/Core/AdminConsole/OrganizationFeatures/OrganizationApiKeys/Interfaces/ICreateOrganizationApiKeyCommand.cs similarity index 50% rename from src/Core/OrganizationFeatures/OrganizationApiKeys/Interfaces/ICreateOrganizationApiKeyCommand.cs rename to src/Core/AdminConsole/OrganizationFeatures/OrganizationApiKeys/Interfaces/ICreateOrganizationApiKeyCommand.cs index a2ce7326de5c..9085873baad3 100644 --- a/src/Core/OrganizationFeatures/OrganizationApiKeys/Interfaces/ICreateOrganizationApiKeyCommand.cs +++ b/src/Core/AdminConsole/OrganizationFeatures/OrganizationApiKeys/Interfaces/ICreateOrganizationApiKeyCommand.cs @@ -1,7 +1,9 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.Entities; using Bit.Core.Enums; -namespace Bit.Core.OrganizationFeatures.OrganizationApiKeys.Interfaces; +namespace Bit.Core.AdminConsole.OrganizationFeatures.OrganizationApiKeys.Interfaces; public interface ICreateOrganizationApiKeyCommand { diff --git a/src/Core/OrganizationFeatures/OrganizationApiKeys/Interfaces/IGetOrganizationApiKeyQuery.cs b/src/Core/AdminConsole/OrganizationFeatures/OrganizationApiKeys/Interfaces/IGetOrganizationApiKeyQuery.cs similarity index 51% rename from src/Core/OrganizationFeatures/OrganizationApiKeys/Interfaces/IGetOrganizationApiKeyQuery.cs rename to src/Core/AdminConsole/OrganizationFeatures/OrganizationApiKeys/Interfaces/IGetOrganizationApiKeyQuery.cs index 699b13adb95f..eb5f006a0b18 100644 --- a/src/Core/OrganizationFeatures/OrganizationApiKeys/Interfaces/IGetOrganizationApiKeyQuery.cs +++ b/src/Core/AdminConsole/OrganizationFeatures/OrganizationApiKeys/Interfaces/IGetOrganizationApiKeyQuery.cs @@ -1,7 +1,9 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.Entities; using Bit.Core.Enums; -namespace Bit.Core.OrganizationFeatures.OrganizationApiKeys.Interfaces; +namespace Bit.Core.AdminConsole.OrganizationFeatures.OrganizationApiKeys.Interfaces; public interface IGetOrganizationApiKeyQuery { diff --git a/src/Core/AdminConsole/OrganizationFeatures/OrganizationApiKeys/Interfaces/IRotateOrganizationApiKeyCommand.cs b/src/Core/AdminConsole/OrganizationFeatures/OrganizationApiKeys/Interfaces/IRotateOrganizationApiKeyCommand.cs new file mode 100644 index 000000000000..f55f885b85b7 --- /dev/null +++ b/src/Core/AdminConsole/OrganizationFeatures/OrganizationApiKeys/Interfaces/IRotateOrganizationApiKeyCommand.cs @@ -0,0 +1,9 @@ +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Entities; + +namespace Bit.Core.AdminConsole.OrganizationFeatures.OrganizationApiKeys.Interfaces; + +public interface IRotateOrganizationApiKeyCommand +{ + Task RotateApiKeyAsync(OrganizationApiKey organizationApiKey); +} diff --git a/src/Core/OrganizationFeatures/OrganizationApiKeys/RotateOrganizationApiKeyCommand.cs b/src/Core/AdminConsole/OrganizationFeatures/OrganizationApiKeys/RotateOrganizationApiKeyCommand.cs similarity index 74% rename from src/Core/OrganizationFeatures/OrganizationApiKeys/RotateOrganizationApiKeyCommand.cs rename to src/Core/AdminConsole/OrganizationFeatures/OrganizationApiKeys/RotateOrganizationApiKeyCommand.cs index f43aaa5f341c..02438984ff56 100644 --- a/src/Core/OrganizationFeatures/OrganizationApiKeys/RotateOrganizationApiKeyCommand.cs +++ b/src/Core/AdminConsole/OrganizationFeatures/OrganizationApiKeys/RotateOrganizationApiKeyCommand.cs @@ -1,9 +1,11 @@ -using Bit.Core.Entities; -using Bit.Core.OrganizationFeatures.OrganizationApiKeys.Interfaces; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationApiKeys.Interfaces; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.Entities; using Bit.Core.Repositories; using Bit.Core.Utilities; -namespace Bit.Core.OrganizationFeatures.OrganizationApiKeys; +namespace Bit.Core.AdminConsole.OrganizationFeatures.OrganizationApiKeys; public class RotateOrganizationApiKeyCommand : IRotateOrganizationApiKeyCommand { diff --git a/src/Core/AdminConsole/OrganizationAuth/Interfaces/IUpdateOrganizationAuthRequestCommand.cs b/src/Core/AdminConsole/OrganizationFeatures/OrganizationAuth/Interfaces/IUpdateOrganizationAuthRequestCommand.cs similarity index 65% rename from src/Core/AdminConsole/OrganizationAuth/Interfaces/IUpdateOrganizationAuthRequestCommand.cs rename to src/Core/AdminConsole/OrganizationFeatures/OrganizationAuth/Interfaces/IUpdateOrganizationAuthRequestCommand.cs index 4b119d1e8f92..2dfa7c90dced 100644 --- a/src/Core/AdminConsole/OrganizationAuth/Interfaces/IUpdateOrganizationAuthRequestCommand.cs +++ b/src/Core/AdminConsole/OrganizationFeatures/OrganizationAuth/Interfaces/IUpdateOrganizationAuthRequestCommand.cs @@ -1,4 +1,4 @@ -namespace Bit.Core.AdminConsole.OrganizationAuth.Interfaces; +namespace Bit.Core.AdminConsole.OrganizationFeatures.OrganizationAuth.Interfaces; public interface IUpdateOrganizationAuthRequestCommand { diff --git a/src/Core/AdminConsole/OrganizationAuth/UpdateOrganizationAuthRequestCommand.cs b/src/Core/AdminConsole/OrganizationFeatures/OrganizationAuth/UpdateOrganizationAuthRequestCommand.cs similarity index 93% rename from src/Core/AdminConsole/OrganizationAuth/UpdateOrganizationAuthRequestCommand.cs rename to src/Core/AdminConsole/OrganizationFeatures/OrganizationAuth/UpdateOrganizationAuthRequestCommand.cs index 79d2d70e8a67..1ce95665e67b 100644 --- a/src/Core/AdminConsole/OrganizationAuth/UpdateOrganizationAuthRequestCommand.cs +++ b/src/Core/AdminConsole/OrganizationFeatures/OrganizationAuth/UpdateOrganizationAuthRequestCommand.cs @@ -1,13 +1,13 @@ using System.ComponentModel.DataAnnotations; using System.Reflection; -using Bit.Core.AdminConsole.OrganizationAuth.Interfaces; +using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationAuth.Interfaces; using Bit.Core.Auth.Models.Api.Request.AuthRequest; using Bit.Core.Auth.Services; using Bit.Core.Repositories; using Bit.Core.Services; using Microsoft.Extensions.Logging; -namespace Bit.Core.AdminConsole.OrganizationAuth; +namespace Bit.Core.AdminConsole.OrganizationFeatures.OrganizationAuth; public class UpdateOrganizationAuthRequestCommand : IUpdateOrganizationAuthRequestCommand { diff --git a/src/Core/OrganizationFeatures/OrganizationUsers/CountNewSmSeatsRequiredQuery.cs b/src/Core/AdminConsole/OrganizationFeatures/OrganizationUsers/CountNewSmSeatsRequiredQuery.cs similarity index 87% rename from src/Core/OrganizationFeatures/OrganizationUsers/CountNewSmSeatsRequiredQuery.cs rename to src/Core/AdminConsole/OrganizationFeatures/OrganizationUsers/CountNewSmSeatsRequiredQuery.cs index 24bef3dc7ef1..2233d2da4675 100644 --- a/src/Core/OrganizationFeatures/OrganizationUsers/CountNewSmSeatsRequiredQuery.cs +++ b/src/Core/AdminConsole/OrganizationFeatures/OrganizationUsers/CountNewSmSeatsRequiredQuery.cs @@ -1,8 +1,9 @@ -using Bit.Core.Exceptions; -using Bit.Core.OrganizationFeatures.OrganizationUsers.Interfaces; +using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationUsers.Interfaces; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.Exceptions; using Bit.Core.Repositories; -namespace Bit.Core.OrganizationFeatures.OrganizationUsers; +namespace Bit.Core.AdminConsole.OrganizationFeatures.OrganizationUsers; public class CountNewSmSeatsRequiredQuery : ICountNewSmSeatsRequiredQuery { diff --git a/src/Core/OrganizationFeatures/OrganizationUsers/DeleteOrganizationUserCommand.cs b/src/Core/AdminConsole/OrganizationFeatures/OrganizationUsers/DeleteOrganizationUserCommand.cs similarity index 85% rename from src/Core/OrganizationFeatures/OrganizationUsers/DeleteOrganizationUserCommand.cs rename to src/Core/AdminConsole/OrganizationFeatures/OrganizationUsers/DeleteOrganizationUserCommand.cs index 69310b954a69..2bb508057504 100644 --- a/src/Core/OrganizationFeatures/OrganizationUsers/DeleteOrganizationUserCommand.cs +++ b/src/Core/AdminConsole/OrganizationFeatures/OrganizationUsers/DeleteOrganizationUserCommand.cs @@ -1,10 +1,12 @@ -using Bit.Core.Enums; +using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationUsers.Interfaces; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; +using Bit.Core.Enums; using Bit.Core.Exceptions; -using Bit.Core.OrganizationFeatures.OrganizationUsers.Interfaces; using Bit.Core.Repositories; using Bit.Core.Services; -namespace Bit.Core.OrganizationFeatures.OrganizationUsers; +namespace Bit.Core.AdminConsole.OrganizationFeatures.OrganizationUsers; public class DeleteOrganizationUserCommand : IDeleteOrganizationUserCommand { diff --git a/src/Core/OrganizationFeatures/OrganizationUsers/Interfaces/ICountNewSmSeatsRequiredQuery.cs b/src/Core/AdminConsole/OrganizationFeatures/OrganizationUsers/Interfaces/ICountNewSmSeatsRequiredQuery.cs similarity index 61% rename from src/Core/OrganizationFeatures/OrganizationUsers/Interfaces/ICountNewSmSeatsRequiredQuery.cs rename to src/Core/AdminConsole/OrganizationFeatures/OrganizationUsers/Interfaces/ICountNewSmSeatsRequiredQuery.cs index 851aef73a2ab..2b38f9721d3c 100644 --- a/src/Core/OrganizationFeatures/OrganizationUsers/Interfaces/ICountNewSmSeatsRequiredQuery.cs +++ b/src/Core/AdminConsole/OrganizationFeatures/OrganizationUsers/Interfaces/ICountNewSmSeatsRequiredQuery.cs @@ -1,4 +1,4 @@ -namespace Bit.Core.OrganizationFeatures.OrganizationUsers.Interfaces; +namespace Bit.Core.AdminConsole.OrganizationFeatures.OrganizationUsers.Interfaces; public interface ICountNewSmSeatsRequiredQuery { diff --git a/src/Core/OrganizationFeatures/OrganizationUsers/Interfaces/IDeleteOrganizationUserCommand.cs b/src/Core/AdminConsole/OrganizationFeatures/OrganizationUsers/Interfaces/IDeleteOrganizationUserCommand.cs similarity index 77% rename from src/Core/OrganizationFeatures/OrganizationUsers/Interfaces/IDeleteOrganizationUserCommand.cs rename to src/Core/AdminConsole/OrganizationFeatures/OrganizationUsers/Interfaces/IDeleteOrganizationUserCommand.cs index b7ca904a112d..32c19077a091 100644 --- a/src/Core/OrganizationFeatures/OrganizationUsers/Interfaces/IDeleteOrganizationUserCommand.cs +++ b/src/Core/AdminConsole/OrganizationFeatures/OrganizationUsers/Interfaces/IDeleteOrganizationUserCommand.cs @@ -1,6 +1,6 @@ using Bit.Core.Enums; -namespace Bit.Core.OrganizationFeatures.OrganizationUsers.Interfaces; +namespace Bit.Core.AdminConsole.OrganizationFeatures.OrganizationUsers.Interfaces; public interface IDeleteOrganizationUserCommand { diff --git a/src/Core/OrganizationFeatures/OrganizationUsers/Interfaces/IUpdateOrganizationUserGroupsCommand.cs b/src/Core/AdminConsole/OrganizationFeatures/OrganizationUsers/Interfaces/IUpdateOrganizationUserGroupsCommand.cs similarity index 54% rename from src/Core/OrganizationFeatures/OrganizationUsers/Interfaces/IUpdateOrganizationUserGroupsCommand.cs rename to src/Core/AdminConsole/OrganizationFeatures/OrganizationUsers/Interfaces/IUpdateOrganizationUserGroupsCommand.cs index 9dae9323349c..527083e7e904 100644 --- a/src/Core/OrganizationFeatures/OrganizationUsers/Interfaces/IUpdateOrganizationUserGroupsCommand.cs +++ b/src/Core/AdminConsole/OrganizationFeatures/OrganizationUsers/Interfaces/IUpdateOrganizationUserGroupsCommand.cs @@ -1,6 +1,7 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Entities; -namespace Bit.Core.OrganizationFeatures.OrganizationUsers.Interfaces; +namespace Bit.Core.AdminConsole.OrganizationFeatures.OrganizationUsers.Interfaces; public interface IUpdateOrganizationUserGroupsCommand { diff --git a/src/Core/OrganizationFeatures/OrganizationUsers/UpdateOrganizationUserGroupsCommand.cs b/src/Core/AdminConsole/OrganizationFeatures/OrganizationUsers/UpdateOrganizationUserGroupsCommand.cs similarity index 81% rename from src/Core/OrganizationFeatures/OrganizationUsers/UpdateOrganizationUserGroupsCommand.cs rename to src/Core/AdminConsole/OrganizationFeatures/OrganizationUsers/UpdateOrganizationUserGroupsCommand.cs index 7bb5814d6e1f..76b0d23888c5 100644 --- a/src/Core/OrganizationFeatures/OrganizationUsers/UpdateOrganizationUserGroupsCommand.cs +++ b/src/Core/AdminConsole/OrganizationFeatures/OrganizationUsers/UpdateOrganizationUserGroupsCommand.cs @@ -1,10 +1,13 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationUsers.Interfaces; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; +using Bit.Core.Entities; using Bit.Core.Enums; -using Bit.Core.OrganizationFeatures.OrganizationUsers.Interfaces; using Bit.Core.Repositories; using Bit.Core.Services; -namespace Bit.Core.OrganizationFeatures.OrganizationUsers; +namespace Bit.Core.AdminConsole.OrganizationFeatures.OrganizationUsers; public class UpdateOrganizationUserGroupsCommand : IUpdateOrganizationUserGroupsCommand { diff --git a/src/Core/Providers/Interfaces/ICreateProviderCommand.cs b/src/Core/AdminConsole/Providers/Interfaces/ICreateProviderCommand.cs similarity index 60% rename from src/Core/Providers/Interfaces/ICreateProviderCommand.cs rename to src/Core/AdminConsole/Providers/Interfaces/ICreateProviderCommand.cs index 4121b1533564..93b3e387a3af 100644 --- a/src/Core/Providers/Interfaces/ICreateProviderCommand.cs +++ b/src/Core/AdminConsole/Providers/Interfaces/ICreateProviderCommand.cs @@ -1,6 +1,6 @@ -using Bit.Core.Entities.Provider; +using Bit.Core.AdminConsole.Entities.Provider; -namespace Bit.Core.Providers.Interfaces; +namespace Bit.Core.AdminConsole.Providers.Interfaces; public interface ICreateProviderCommand { diff --git a/src/Core/Repositories/IGroupRepository.cs b/src/Core/AdminConsole/Repositories/IGroupRepository.cs similarity index 90% rename from src/Core/Repositories/IGroupRepository.cs rename to src/Core/AdminConsole/Repositories/IGroupRepository.cs index f1b506de07f0..7e691db17316 100644 --- a/src/Core/Repositories/IGroupRepository.cs +++ b/src/Core/AdminConsole/Repositories/IGroupRepository.cs @@ -1,7 +1,8 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; using Bit.Core.Models.Data; +using Bit.Core.Repositories; -namespace Bit.Core.Repositories; +namespace Bit.Core.AdminConsole.Repositories; public interface IGroupRepository : IRepository { diff --git a/src/Core/Repositories/IOrganizationApiKeyRepository.cs b/src/Core/AdminConsole/Repositories/IOrganizationApiKeyRepository.cs similarity index 60% rename from src/Core/Repositories/IOrganizationApiKeyRepository.cs rename to src/Core/AdminConsole/Repositories/IOrganizationApiKeyRepository.cs index 778db9d734e4..0d9ea4cc7cf3 100644 --- a/src/Core/Repositories/IOrganizationApiKeyRepository.cs +++ b/src/Core/AdminConsole/Repositories/IOrganizationApiKeyRepository.cs @@ -1,7 +1,8 @@ -using Bit.Core.Entities; -using Bit.Core.Enums; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.Repositories; -namespace Bit.Core.Repositories; +namespace Bit.Core.AdminConsole.Repositories; public interface IOrganizationApiKeyRepository : IRepository { diff --git a/src/Core/Repositories/IOrganizationRepository.cs b/src/Core/AdminConsole/Repositories/IOrganizationRepository.cs similarity index 81% rename from src/Core/Repositories/IOrganizationRepository.cs rename to src/Core/AdminConsole/Repositories/IOrganizationRepository.cs index 14126adb0aad..733d9433a3d7 100644 --- a/src/Core/Repositories/IOrganizationRepository.cs +++ b/src/Core/AdminConsole/Repositories/IOrganizationRepository.cs @@ -1,7 +1,8 @@ -using Bit.Core.Entities; -using Bit.Core.Models.Data.Organizations; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Models.Data.Organizations; +using Bit.Core.Repositories; -namespace Bit.Core.Repositories; +namespace Bit.Core.AdminConsole.Repositories; public interface IOrganizationRepository : IRepository { diff --git a/src/Core/Repositories/IOrganizationUserRepository.cs b/src/Core/AdminConsole/Repositories/IOrganizationUserRepository.cs similarity index 93% rename from src/Core/Repositories/IOrganizationUserRepository.cs rename to src/Core/AdminConsole/Repositories/IOrganizationUserRepository.cs index f9dfa12c2cbf..bbb6e2dd4d9b 100644 --- a/src/Core/Repositories/IOrganizationUserRepository.cs +++ b/src/Core/AdminConsole/Repositories/IOrganizationUserRepository.cs @@ -1,9 +1,10 @@ -using Bit.Core.Entities; -using Bit.Core.Enums; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Models.Data.Organizations.OrganizationUsers; using Bit.Core.Models.Data; -using Bit.Core.Models.Data.Organizations.OrganizationUsers; +using Bit.Core.Repositories; -namespace Bit.Core.Repositories; +namespace Bit.Core.AdminConsole.Repositories; public interface IOrganizationUserRepository : IRepository { diff --git a/src/Core/Repositories/IPolicyRepository.cs b/src/Core/AdminConsole/Repositories/IPolicyRepository.cs similarity index 66% rename from src/Core/Repositories/IPolicyRepository.cs rename to src/Core/AdminConsole/Repositories/IPolicyRepository.cs index 389d116c40d3..6050a7f69f13 100644 --- a/src/Core/Repositories/IPolicyRepository.cs +++ b/src/Core/AdminConsole/Repositories/IPolicyRepository.cs @@ -1,7 +1,8 @@ -using Bit.Core.Entities; -using Bit.Core.Enums; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.Repositories; -namespace Bit.Core.Repositories; +namespace Bit.Core.AdminConsole.Repositories; public interface IPolicyRepository : IRepository { diff --git a/src/Core/Repositories/IProviderOrganizationRepository.cs b/src/Core/AdminConsole/Repositories/IProviderOrganizationRepository.cs similarity index 76% rename from src/Core/Repositories/IProviderOrganizationRepository.cs rename to src/Core/AdminConsole/Repositories/IProviderOrganizationRepository.cs index 8550a3d7bc04..6f267295efad 100644 --- a/src/Core/Repositories/IProviderOrganizationRepository.cs +++ b/src/Core/AdminConsole/Repositories/IProviderOrganizationRepository.cs @@ -1,7 +1,8 @@ -using Bit.Core.Entities.Provider; -using Bit.Core.Models.Data; +using Bit.Core.AdminConsole.Entities.Provider; +using Bit.Core.AdminConsole.Models.Data.Provider; +using Bit.Core.Repositories; -namespace Bit.Core.Repositories; +namespace Bit.Core.AdminConsole.Repositories; public interface IProviderOrganizationRepository : IRepository { diff --git a/src/Core/Repositories/IProviderRepository.cs b/src/Core/AdminConsole/Repositories/IProviderRepository.cs similarity index 63% rename from src/Core/Repositories/IProviderRepository.cs rename to src/Core/AdminConsole/Repositories/IProviderRepository.cs index 8939bba966db..c9da0b2faad4 100644 --- a/src/Core/Repositories/IProviderRepository.cs +++ b/src/Core/AdminConsole/Repositories/IProviderRepository.cs @@ -1,7 +1,8 @@ -using Bit.Core.Entities.Provider; -using Bit.Core.Models.Data; +using Bit.Core.AdminConsole.Entities.Provider; +using Bit.Core.AdminConsole.Models.Data.Provider; +using Bit.Core.Repositories; -namespace Bit.Core.Repositories; +namespace Bit.Core.AdminConsole.Repositories; public interface IProviderRepository : IRepository { diff --git a/src/Core/Repositories/IProviderUserRepository.cs b/src/Core/AdminConsole/Repositories/IProviderUserRepository.cs similarity index 85% rename from src/Core/Repositories/IProviderUserRepository.cs rename to src/Core/AdminConsole/Repositories/IProviderUserRepository.cs index 9f0374fee3d2..34443f7d5f4d 100644 --- a/src/Core/Repositories/IProviderUserRepository.cs +++ b/src/Core/AdminConsole/Repositories/IProviderUserRepository.cs @@ -1,8 +1,9 @@ -using Bit.Core.Entities.Provider; -using Bit.Core.Enums.Provider; -using Bit.Core.Models.Data; +using Bit.Core.AdminConsole.Entities.Provider; +using Bit.Core.AdminConsole.Enums.Provider; +using Bit.Core.AdminConsole.Models.Data.Provider; +using Bit.Core.Repositories; -namespace Bit.Core.Repositories; +namespace Bit.Core.AdminConsole.Repositories; public interface IProviderUserRepository : IRepository { diff --git a/src/Core/Services/IApplicationCacheService.cs b/src/Core/AdminConsole/Services/IApplicationCacheService.cs similarity index 62% rename from src/Core/Services/IApplicationCacheService.cs rename to src/Core/AdminConsole/Services/IApplicationCacheService.cs index 7c21fac76f6f..c9d117849be3 100644 --- a/src/Core/Services/IApplicationCacheService.cs +++ b/src/Core/AdminConsole/Services/IApplicationCacheService.cs @@ -1,9 +1,9 @@ -using Bit.Core.Entities; -using Bit.Core.Entities.Provider; -using Bit.Core.Models.Data; -using Bit.Core.Models.Data.Organizations; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Entities.Provider; +using Bit.Core.AdminConsole.Models.Data.Organizations; +using Bit.Core.AdminConsole.Models.Data.Provider; -namespace Bit.Core.Services; +namespace Bit.Core.AdminConsole.Services; public interface IApplicationCacheService { diff --git a/src/Core/Services/IGroupService.cs b/src/Core/AdminConsole/Services/IGroupService.cs similarity index 85% rename from src/Core/Services/IGroupService.cs rename to src/Core/AdminConsole/Services/IGroupService.cs index 14967b6e85ec..d189a63de548 100644 --- a/src/Core/Services/IGroupService.cs +++ b/src/Core/AdminConsole/Services/IGroupService.cs @@ -1,7 +1,7 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; using Bit.Core.Enums; -namespace Bit.Core.Services; +namespace Bit.Core.AdminConsole.Services; public interface IGroupService { diff --git a/src/Core/Services/IOrganizationService.cs b/src/Core/AdminConsole/Services/IOrganizationService.cs similarity index 94% rename from src/Core/Services/IOrganizationService.cs rename to src/Core/AdminConsole/Services/IOrganizationService.cs index 3c48367d5308..9f8d0250fdde 100644 --- a/src/Core/Services/IOrganizationService.cs +++ b/src/Core/AdminConsole/Services/IOrganizationService.cs @@ -1,11 +1,15 @@ using System.Security.Claims; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Models.Business; using Bit.Core.Auth.Enums; using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Models.Business; using Bit.Core.Models.Data; +using Bit.Core.Services; -namespace Bit.Core.Services; +namespace Bit.Core.AdminConsole.Services; public interface IOrganizationService { @@ -85,8 +89,8 @@ Task>> RestoreUsersAsync(Guid organizationI Task InitPendingOrganization(Guid userId, Guid organizationId, string publicKey, string privateKey, string collectionName); Task ReplaceAndUpdateCacheAsync(Organization org, EventType? orgEvent = null); - void ValidatePasswordManagerPlan(Models.StaticStore.Plan plan, OrganizationUpgrade upgrade); - void ValidateSecretsManagerPlan(Models.StaticStore.Plan plan, OrganizationUpgrade upgrade); + void ValidatePasswordManagerPlan(Core.Models.StaticStore.Plan plan, OrganizationUpgrade upgrade); + void ValidateSecretsManagerPlan(Core.Models.StaticStore.Plan plan, OrganizationUpgrade upgrade); Task ValidateOrganizationUserUpdatePermissions(Guid organizationId, OrganizationUserType newType, OrganizationUserType? oldType, Permissions permissions); } diff --git a/src/Core/Services/IPolicyService.cs b/src/Core/AdminConsole/Services/IPolicyService.cs similarity index 70% rename from src/Core/Services/IPolicyService.cs rename to src/Core/AdminConsole/Services/IPolicyService.cs index 51867ec9668d..c436e3ef24ff 100644 --- a/src/Core/Services/IPolicyService.cs +++ b/src/Core/AdminConsole/Services/IPolicyService.cs @@ -1,9 +1,11 @@ -using Bit.Core.Entities; -using Bit.Core.Enums; -using Bit.Core.Models.Data.Organizations.OrganizationUsers; -using Bit.Core.Models.Data.Organizations.Policies; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Models.Data.Organizations.OrganizationUsers; +using Bit.Core.AdminConsole.Models.Data.Organizations.Policies; +using Bit.Core.Entities; +using Bit.Core.Services; -namespace Bit.Core.Services; +namespace Bit.Core.AdminConsole.Services; public interface IPolicyService { diff --git a/src/Core/Services/IProviderService.cs b/src/Core/AdminConsole/Services/IProviderService.cs similarity index 87% rename from src/Core/Services/IProviderService.cs rename to src/Core/AdminConsole/Services/IProviderService.cs index c1ac8b5a33aa..67b0b5ef782e 100644 --- a/src/Core/Services/IProviderService.cs +++ b/src/Core/AdminConsole/Services/IProviderService.cs @@ -1,9 +1,9 @@ -using Bit.Core.Entities; -using Bit.Core.Entities.Provider; -using Bit.Core.Models.Business; -using Bit.Core.Models.Business.Provider; +using Bit.Core.AdminConsole.Entities.Provider; +using Bit.Core.AdminConsole.Models.Business; +using Bit.Core.AdminConsole.Models.Business.Provider; +using Bit.Core.Entities; -namespace Bit.Core.Services; +namespace Bit.Core.AdminConsole.Services; public interface IProviderService { diff --git a/src/Core/Services/Implementations/GroupService.cs b/src/Core/AdminConsole/Services/Implementations/GroupService.cs similarity index 93% rename from src/Core/Services/Implementations/GroupService.cs rename to src/Core/AdminConsole/Services/Implementations/GroupService.cs index c878c321d969..1d103f5a62dc 100644 --- a/src/Core/Services/Implementations/GroupService.cs +++ b/src/Core/AdminConsole/Services/Implementations/GroupService.cs @@ -1,9 +1,10 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Enums; using Bit.Core.Exceptions; -using Bit.Core.Repositories; +using Bit.Core.Services; -namespace Bit.Core.Services; +namespace Bit.Core.AdminConsole.Services.Implementations; public class GroupService : IGroupService { diff --git a/src/Core/Services/Implementations/InMemoryApplicationCacheService.cs b/src/Core/AdminConsole/Services/Implementations/InMemoryApplicationCacheService.cs similarity index 91% rename from src/Core/Services/Implementations/InMemoryApplicationCacheService.cs rename to src/Core/AdminConsole/Services/Implementations/InMemoryApplicationCacheService.cs index dc23fcdb825f..102e31811387 100644 --- a/src/Core/Services/Implementations/InMemoryApplicationCacheService.cs +++ b/src/Core/AdminConsole/Services/Implementations/InMemoryApplicationCacheService.cs @@ -1,10 +1,10 @@ -using Bit.Core.Entities; -using Bit.Core.Entities.Provider; -using Bit.Core.Models.Data; -using Bit.Core.Models.Data.Organizations; -using Bit.Core.Repositories; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Entities.Provider; +using Bit.Core.AdminConsole.Models.Data.Organizations; +using Bit.Core.AdminConsole.Models.Data.Provider; +using Bit.Core.AdminConsole.Repositories; -namespace Bit.Core.Services; +namespace Bit.Core.AdminConsole.Services.Implementations; public class InMemoryApplicationCacheService : IApplicationCacheService { diff --git a/src/Core/Services/Implementations/InMemoryServiceBusApplicationCacheService.cs b/src/Core/AdminConsole/Services/Implementations/InMemoryServiceBusApplicationCacheService.cs similarity index 94% rename from src/Core/Services/Implementations/InMemoryServiceBusApplicationCacheService.cs rename to src/Core/AdminConsole/Services/Implementations/InMemoryServiceBusApplicationCacheService.cs index 7067efd82cf2..63a0d3965a75 100644 --- a/src/Core/Services/Implementations/InMemoryServiceBusApplicationCacheService.cs +++ b/src/Core/AdminConsole/Services/Implementations/InMemoryServiceBusApplicationCacheService.cs @@ -1,11 +1,11 @@ using Azure.Messaging.ServiceBus; -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Enums; -using Bit.Core.Repositories; using Bit.Core.Settings; using Bit.Core.Utilities; -namespace Bit.Core.Services; +namespace Bit.Core.AdminConsole.Services.Implementations; public class InMemoryServiceBusApplicationCacheService : InMemoryApplicationCacheService, IApplicationCacheService { diff --git a/src/Core/Services/Implementations/OrganizationService.cs b/src/Core/AdminConsole/Services/Implementations/OrganizationService.cs similarity index 99% rename from src/Core/Services/Implementations/OrganizationService.cs rename to src/Core/AdminConsole/Services/Implementations/OrganizationService.cs index d1e1085acee5..a81c38d7b046 100644 --- a/src/Core/Services/Implementations/OrganizationService.cs +++ b/src/Core/AdminConsole/Services/Implementations/OrganizationService.cs @@ -1,19 +1,24 @@ using System.Security.Claims; using System.Text.Json; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Enums.Provider; +using Bit.Core.AdminConsole.Models.Business; +using Bit.Core.AdminConsole.Models.Data.Organizations.Policies; +using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationUsers.Interfaces; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Auth.Enums; using Bit.Core.Auth.Models.Business; using Bit.Core.Auth.Repositories; using Bit.Core.Context; using Bit.Core.Entities; using Bit.Core.Enums; -using Bit.Core.Enums.Provider; using Bit.Core.Exceptions; using Bit.Core.Models.Business; using Bit.Core.Models.Data; -using Bit.Core.Models.Data.Organizations.Policies; using Bit.Core.OrganizationFeatures.OrganizationSubscriptions.Interface; -using Bit.Core.OrganizationFeatures.OrganizationUsers.Interfaces; using Bit.Core.Repositories; +using Bit.Core.Services; using Bit.Core.Settings; using Bit.Core.Tools.Enums; using Bit.Core.Tools.Models.Business; @@ -23,7 +28,7 @@ using Microsoft.Extensions.Logging; using Stripe; -namespace Bit.Core.Services; +namespace Bit.Core.AdminConsole.Services.Implementations; public class OrganizationService : IOrganizationService { @@ -1938,7 +1943,7 @@ private async Task GetOrgById(Guid id) return await _organizationRepository.GetByIdAsync(id); } - private static void ValidatePlan(Models.StaticStore.Plan plan, int additionalSeats, string productType) + private static void ValidatePlan(Core.Models.StaticStore.Plan plan, int additionalSeats, string productType) { if (plan is not { LegacyYear: null }) { @@ -1956,7 +1961,7 @@ private static void ValidatePlan(Models.StaticStore.Plan plan, int additionalSea } } - public void ValidatePasswordManagerPlan(Models.StaticStore.Plan plan, OrganizationUpgrade upgrade) + public void ValidatePasswordManagerPlan(Core.Models.StaticStore.Plan plan, OrganizationUpgrade upgrade) { ValidatePlan(plan, upgrade.AdditionalSeats, "Password Manager"); @@ -1998,7 +2003,7 @@ public void ValidatePasswordManagerPlan(Models.StaticStore.Plan plan, Organizati } } - public void ValidateSecretsManagerPlan(Models.StaticStore.Plan plan, OrganizationUpgrade upgrade) + public void ValidateSecretsManagerPlan(Core.Models.StaticStore.Plan plan, OrganizationUpgrade upgrade) { if (plan.SupportsSecretsManager == false) { diff --git a/src/Core/Services/Implementations/PolicyService.cs b/src/Core/AdminConsole/Services/Implementations/PolicyService.cs similarity index 93% rename from src/Core/Services/Implementations/PolicyService.cs rename to src/Core/AdminConsole/Services/Implementations/PolicyService.cs index 5f4e680df74d..8844dc166aba 100644 --- a/src/Core/Services/Implementations/PolicyService.cs +++ b/src/Core/AdminConsole/Services/Implementations/PolicyService.cs @@ -1,14 +1,17 @@ -using Bit.Core.Auth.Enums; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Models.Data.Organizations.OrganizationUsers; +using Bit.Core.AdminConsole.Models.Data.Organizations.Policies; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.Auth.Enums; using Bit.Core.Auth.Repositories; using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Exceptions; -using Bit.Core.Models.Data.Organizations.OrganizationUsers; -using Bit.Core.Models.Data.Organizations.Policies; -using Bit.Core.Repositories; +using Bit.Core.Services; using Bit.Core.Settings; -namespace Bit.Core.Services; +namespace Bit.Core.AdminConsole.Services.Implementations; public class PolicyService : IPolicyService { @@ -122,12 +125,12 @@ public async Task SaveAsync(Policy policy, IUserService userService, IOrganizati var orgUsers = await _organizationUserRepository.GetManyDetailsByOrganizationAsync( policy.OrganizationId); var removableOrgUsers = orgUsers.Where(ou => - ou.Status != Enums.OrganizationUserStatusType.Invited && ou.Status != Enums.OrganizationUserStatusType.Revoked && - ou.Type != Enums.OrganizationUserType.Owner && ou.Type != Enums.OrganizationUserType.Admin && + ou.Status != OrganizationUserStatusType.Invited && ou.Status != OrganizationUserStatusType.Revoked && + ou.Type != OrganizationUserType.Owner && ou.Type != OrganizationUserType.Admin && ou.UserId != savingUserId); switch (policy.Type) { - case Enums.PolicyType.TwoFactorAuthentication: + case PolicyType.TwoFactorAuthentication: foreach (var orgUser in removableOrgUsers) { if (!await userService.TwoFactorIsEnabledAsync(orgUser)) @@ -139,7 +142,7 @@ await _mailService.SendOrganizationUserRemovedForPolicyTwoStepEmailAsync( } } break; - case Enums.PolicyType.SingleOrg: + case PolicyType.SingleOrg: var userOrgs = await _organizationUserRepository.GetManyByManyUsersAsync( removableOrgUsers.Select(ou => ou.UserId.Value)); foreach (var orgUser in removableOrgUsers) @@ -162,7 +165,7 @@ await _mailService.SendOrganizationUserRemovedForPolicySingleOrgEmailAsync( } policy.RevisionDate = now; await _policyRepository.UpsertAsync(policy); - await _eventService.LogPolicyEventAsync(policy, Enums.EventType.Policy_Updated); + await _eventService.LogPolicyEventAsync(policy, Core.Enums.EventType.Policy_Updated); } public async Task GetMasterPasswordPolicyForUserAsync(User user) diff --git a/src/Core/Services/NoopImplementations/NoopProviderService.cs b/src/Core/AdminConsole/Services/NoopImplementations/NoopProviderService.cs similarity index 90% rename from src/Core/Services/NoopImplementations/NoopProviderService.cs rename to src/Core/AdminConsole/Services/NoopImplementations/NoopProviderService.cs index 596ec9171838..17cc4abaa032 100644 --- a/src/Core/Services/NoopImplementations/NoopProviderService.cs +++ b/src/Core/AdminConsole/Services/NoopImplementations/NoopProviderService.cs @@ -1,9 +1,9 @@ -using Bit.Core.Entities; -using Bit.Core.Entities.Provider; -using Bit.Core.Models.Business; -using Bit.Core.Models.Business.Provider; +using Bit.Core.AdminConsole.Entities.Provider; +using Bit.Core.AdminConsole.Models.Business; +using Bit.Core.AdminConsole.Models.Business.Provider; +using Bit.Core.Entities; -namespace Bit.Core.Services; +namespace Bit.Core.AdminConsole.Services.NoopImplementations; public class NoopProviderService : IProviderService { diff --git a/src/Core/Auth/Identity/IOrganizationTwoFactorTokenProvider.cs b/src/Core/Auth/Identity/IOrganizationTwoFactorTokenProvider.cs index 81ce2adae940..4226cd036165 100644 --- a/src/Core/Auth/Identity/IOrganizationTwoFactorTokenProvider.cs +++ b/src/Core/Auth/Identity/IOrganizationTwoFactorTokenProvider.cs @@ -1,4 +1,5 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Entities; namespace Bit.Core.Auth.Identity; diff --git a/src/Core/Auth/Identity/OrganizationDuoWebTokenProvider.cs b/src/Core/Auth/Identity/OrganizationDuoWebTokenProvider.cs index 2b66e550c785..58bcf5efd8db 100644 --- a/src/Core/Auth/Identity/OrganizationDuoWebTokenProvider.cs +++ b/src/Core/Auth/Identity/OrganizationDuoWebTokenProvider.cs @@ -1,4 +1,5 @@ -using Bit.Core.Auth.Enums; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Auth.Enums; using Bit.Core.Auth.Models; using Bit.Core.Auth.Utilities.Duo; using Bit.Core.Entities; diff --git a/src/Core/Auth/Models/Business/Tokenables/SsoTokenable.cs b/src/Core/Auth/Models/Business/Tokenables/SsoTokenable.cs index 1f7bdfbc0f1c..4a9e5f94b67d 100644 --- a/src/Core/Auth/Models/Business/Tokenables/SsoTokenable.cs +++ b/src/Core/Auth/Models/Business/Tokenables/SsoTokenable.cs @@ -1,4 +1,5 @@ using System.Text.Json.Serialization; +using Bit.Core.AdminConsole.Entities; using Bit.Core.Entities; using Bit.Core.Tokens; @@ -35,7 +36,7 @@ public bool TokenIsValid(Organization organization) && organization.Id.Equals(OrganizationId); } - // Validates deserialized + // Validates deserialized protected override bool TokenIsValid() => Identifier == TokenIdentifier && OrganizationId != default diff --git a/src/Core/Auth/Services/IEmergencyAccessService.cs b/src/Core/Auth/Services/IEmergencyAccessService.cs index d8abedb37f7a..2c946325106d 100644 --- a/src/Core/Auth/Services/IEmergencyAccessService.cs +++ b/src/Core/Auth/Services/IEmergencyAccessService.cs @@ -1,4 +1,5 @@ -using Bit.Core.Auth.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Auth.Entities; using Bit.Core.Auth.Enums; using Bit.Core.Auth.Models.Data; using Bit.Core.Entities; diff --git a/src/Core/Auth/Services/ISsoConfigService.cs b/src/Core/Auth/Services/ISsoConfigService.cs index 1f1ec55fdada..0030cde5675e 100644 --- a/src/Core/Auth/Services/ISsoConfigService.cs +++ b/src/Core/Auth/Services/ISsoConfigService.cs @@ -1,4 +1,5 @@ -using Bit.Core.Auth.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Auth.Entities; using Bit.Core.Entities; namespace Bit.Core.Auth.Services; diff --git a/src/Core/Auth/Services/Implementations/AuthRequestService.cs b/src/Core/Auth/Services/Implementations/AuthRequestService.cs index e59177d9fd34..a48efc90eede 100644 --- a/src/Core/Auth/Services/Implementations/AuthRequestService.cs +++ b/src/Core/Auth/Services/Implementations/AuthRequestService.cs @@ -1,4 +1,5 @@ using System.Diagnostics; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Auth.Entities; using Bit.Core.Auth.Enums; using Bit.Core.Auth.Exceptions; diff --git a/src/Core/Auth/Services/Implementations/EmergencyAccessService.cs b/src/Core/Auth/Services/Implementations/EmergencyAccessService.cs index c992bb9f13d0..8e06cc5ef55a 100644 --- a/src/Core/Auth/Services/Implementations/EmergencyAccessService.cs +++ b/src/Core/Auth/Services/Implementations/EmergencyAccessService.cs @@ -1,4 +1,8 @@ -using Bit.Core.Auth.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; +using Bit.Core.Auth.Entities; using Bit.Core.Auth.Enums; using Bit.Core.Auth.Models; using Bit.Core.Auth.Models.Business.Tokenables; diff --git a/src/Core/Auth/Services/Implementations/SsoConfigService.cs b/src/Core/Auth/Services/Implementations/SsoConfigService.cs index a7e4784f49a2..aac77613f65c 100644 --- a/src/Core/Auth/Services/Implementations/SsoConfigService.cs +++ b/src/Core/Auth/Services/Implementations/SsoConfigService.cs @@ -1,10 +1,14 @@ -using Bit.Core.Auth.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Models.Data.Organizations.Policies; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; +using Bit.Core.Auth.Entities; using Bit.Core.Auth.Enums; using Bit.Core.Auth.Repositories; using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Exceptions; -using Bit.Core.Models.Data.Organizations.Policies; using Bit.Core.Repositories; using Bit.Core.Services; diff --git a/src/Core/Context/CurrentContext.cs b/src/Core/Context/CurrentContext.cs index 4751beb797e7..fb91fe0b2e9e 100644 --- a/src/Core/Context/CurrentContext.cs +++ b/src/Core/Context/CurrentContext.cs @@ -1,7 +1,11 @@ using System.Security.Claims; +using Bit.Core.AdminConsole.Context; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Enums.Provider; +using Bit.Core.AdminConsole.Models.Data.Provider; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Entities; using Bit.Core.Enums; -using Bit.Core.Enums.Provider; using Bit.Core.Identity; using Bit.Core.Models.Data; using Bit.Core.Repositories; diff --git a/src/Core/Context/ICurrentContext.cs b/src/Core/Context/ICurrentContext.cs index c2e362d435de..ee3708142184 100644 --- a/src/Core/Context/ICurrentContext.cs +++ b/src/Core/Context/ICurrentContext.cs @@ -1,4 +1,6 @@ using System.Security.Claims; +using Bit.Core.AdminConsole.Context; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Identity; diff --git a/src/Core/HostedServices/ApplicationCacheHostedService.cs b/src/Core/HostedServices/ApplicationCacheHostedService.cs index 9021782d2032..ce990515ea14 100644 --- a/src/Core/HostedServices/ApplicationCacheHostedService.cs +++ b/src/Core/HostedServices/ApplicationCacheHostedService.cs @@ -1,5 +1,8 @@ using Azure.Messaging.ServiceBus; using Azure.Messaging.ServiceBus.Administration; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; +using Bit.Core.AdminConsole.Services.Implementations; using Bit.Core.Enums; using Bit.Core.Repositories; using Bit.Core.Services; diff --git a/src/Core/Models/Business/OrganizationLicense.cs b/src/Core/Models/Business/OrganizationLicense.cs index c8060263c810..9f6587e52e82 100644 --- a/src/Core/Models/Business/OrganizationLicense.cs +++ b/src/Core/Models/Business/OrganizationLicense.cs @@ -3,6 +3,7 @@ using System.Security.Cryptography.X509Certificates; using System.Text; using System.Text.Json.Serialization; +using Bit.Core.AdminConsole.Entities; using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Services; diff --git a/src/Core/Models/Business/SecretsManagerSubscriptionUpdate.cs b/src/Core/Models/Business/SecretsManagerSubscriptionUpdate.cs index 3787470588b9..a8d92dc62db9 100644 --- a/src/Core/Models/Business/SecretsManagerSubscriptionUpdate.cs +++ b/src/Core/Models/Business/SecretsManagerSubscriptionUpdate.cs @@ -1,4 +1,5 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Entities; using Bit.Core.Exceptions; using Bit.Core.Models.StaticStore; diff --git a/src/Core/Models/Business/SubscriptionCreateOptions.cs b/src/Core/Models/Business/SubscriptionCreateOptions.cs index 0ea4c4c0b574..b4634635b405 100644 --- a/src/Core/Models/Business/SubscriptionCreateOptions.cs +++ b/src/Core/Models/Business/SubscriptionCreateOptions.cs @@ -1,4 +1,6 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Models.Business; +using Bit.Core.Entities; using Stripe; using Plan = Bit.Core.Models.StaticStore.Plan; diff --git a/src/Core/Models/Business/SubscriptionUpdate.cs b/src/Core/Models/Business/SubscriptionUpdate.cs index 0dcf696dbcdc..e62edba94572 100644 --- a/src/Core/Models/Business/SubscriptionUpdate.cs +++ b/src/Core/Models/Business/SubscriptionUpdate.cs @@ -1,4 +1,5 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Entities; using Stripe; namespace Bit.Core.Models.Business; diff --git a/src/Core/Models/Data/Organizations/Policies/IPolicyDataModel.cs b/src/Core/Models/Data/Organizations/Policies/IPolicyDataModel.cs deleted file mode 100644 index ef8789d48377..000000000000 --- a/src/Core/Models/Data/Organizations/Policies/IPolicyDataModel.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace Bit.Core.Models.Data.Organizations.Policies; - -public interface IPolicyDataModel -{ -} diff --git a/src/Core/Models/StaticStore/SponsoredPlan.cs b/src/Core/Models/StaticStore/SponsoredPlan.cs index bcd23874a7e8..099b45a377d2 100644 --- a/src/Core/Models/StaticStore/SponsoredPlan.cs +++ b/src/Core/Models/StaticStore/SponsoredPlan.cs @@ -1,5 +1,5 @@ -using Bit.Core.Enums; -using Bit.Core.Models.Data.Organizations.OrganizationUsers; +using Bit.Core.AdminConsole.Models.Data.Organizations.OrganizationUsers; +using Bit.Core.Enums; namespace Bit.Core.Models.StaticStore; diff --git a/src/Core/OrganizationFeatures/OrganizationApiKeys/Interfaces/IRotateOrganizationApiKeyCommand.cs b/src/Core/OrganizationFeatures/OrganizationApiKeys/Interfaces/IRotateOrganizationApiKeyCommand.cs deleted file mode 100644 index a5cf51c3fe5e..000000000000 --- a/src/Core/OrganizationFeatures/OrganizationApiKeys/Interfaces/IRotateOrganizationApiKeyCommand.cs +++ /dev/null @@ -1,8 +0,0 @@ -using Bit.Core.Entities; - -namespace Bit.Core.OrganizationFeatures.OrganizationApiKeys.Interfaces; - -public interface IRotateOrganizationApiKeyCommand -{ - Task RotateApiKeyAsync(OrganizationApiKey organizationApiKey); -} diff --git a/src/Core/OrganizationFeatures/OrganizationConnections/Interfaces/IValidateBillingSyncKeyCommand.cs b/src/Core/OrganizationFeatures/OrganizationConnections/Interfaces/IValidateBillingSyncKeyCommand.cs index 9fb979548a62..41f4f40759f7 100644 --- a/src/Core/OrganizationFeatures/OrganizationConnections/Interfaces/IValidateBillingSyncKeyCommand.cs +++ b/src/Core/OrganizationFeatures/OrganizationConnections/Interfaces/IValidateBillingSyncKeyCommand.cs @@ -1,4 +1,5 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Entities; namespace Bit.Core.OrganizationFeatures.OrganizationConnections.Interfaces; diff --git a/src/Core/OrganizationFeatures/OrganizationConnections/ValidateBillingSyncKeyCommand.cs b/src/Core/OrganizationFeatures/OrganizationConnections/ValidateBillingSyncKeyCommand.cs index a764bbcf2349..9159aad29d32 100644 --- a/src/Core/OrganizationFeatures/OrganizationConnections/ValidateBillingSyncKeyCommand.cs +++ b/src/Core/OrganizationFeatures/OrganizationConnections/ValidateBillingSyncKeyCommand.cs @@ -1,4 +1,7 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.Entities; using Bit.Core.Exceptions; using Bit.Core.OrganizationFeatures.OrganizationConnections.Interfaces; using Bit.Core.Repositories; @@ -26,7 +29,7 @@ public async Task ValidateBillingSyncKeyAsync(Organization organization, s return false; } - var orgApiKey = (await _apiKeyRepository.GetManyByOrganizationIdTypeAsync(organization.Id, Enums.OrganizationApiKeyType.BillingSync)).FirstOrDefault(); + var orgApiKey = (await _apiKeyRepository.GetManyByOrganizationIdTypeAsync(organization.Id, OrganizationApiKeyType.BillingSync)).FirstOrDefault(); if (string.Equals(orgApiKey.ApiKey, billingSyncKey)) { return true; diff --git a/src/Core/OrganizationFeatures/OrganizationLicenses/Cloud/CloudGetOrganizationLicenseQuery.cs b/src/Core/OrganizationFeatures/OrganizationLicenses/Cloud/CloudGetOrganizationLicenseQuery.cs index a8d3a1638f51..d314ca5bba65 100644 --- a/src/Core/OrganizationFeatures/OrganizationLicenses/Cloud/CloudGetOrganizationLicenseQuery.cs +++ b/src/Core/OrganizationFeatures/OrganizationLicenses/Cloud/CloudGetOrganizationLicenseQuery.cs @@ -1,4 +1,5 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Entities; using Bit.Core.Exceptions; using Bit.Core.Models.Business; using Bit.Core.OrganizationFeatures.OrganizationLicenses.Interfaces; diff --git a/src/Core/OrganizationFeatures/OrganizationLicenses/Interfaces/IGetOrganizationLicenseQuery.cs b/src/Core/OrganizationFeatures/OrganizationLicenses/Interfaces/IGetOrganizationLicenseQuery.cs index 2c66833e63a2..312b80a4666a 100644 --- a/src/Core/OrganizationFeatures/OrganizationLicenses/Interfaces/IGetOrganizationLicenseQuery.cs +++ b/src/Core/OrganizationFeatures/OrganizationLicenses/Interfaces/IGetOrganizationLicenseQuery.cs @@ -1,4 +1,5 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Entities; using Bit.Core.Models.Business; namespace Bit.Core.OrganizationFeatures.OrganizationLicenses.Interfaces; diff --git a/src/Core/OrganizationFeatures/OrganizationLicenses/Interfaces/IUpdateOrganizationLicenseCommand.cs b/src/Core/OrganizationFeatures/OrganizationLicenses/Interfaces/IUpdateOrganizationLicenseCommand.cs index 2ba82c1c6224..54d9dbaad2f7 100644 --- a/src/Core/OrganizationFeatures/OrganizationLicenses/Interfaces/IUpdateOrganizationLicenseCommand.cs +++ b/src/Core/OrganizationFeatures/OrganizationLicenses/Interfaces/IUpdateOrganizationLicenseCommand.cs @@ -1,5 +1,7 @@ #nullable enable +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Models.Data.Organizations; using Bit.Core.Entities; using Bit.Core.Models.Business; using Bit.Core.Models.Data.Organizations; diff --git a/src/Core/OrganizationFeatures/OrganizationLicenses/SelfHosted/SelfHostedGetOrganizationLicenseQuery.cs b/src/Core/OrganizationFeatures/OrganizationLicenses/SelfHosted/SelfHostedGetOrganizationLicenseQuery.cs index 84ae0a27dbcd..89ea53fc200c 100644 --- a/src/Core/OrganizationFeatures/OrganizationLicenses/SelfHosted/SelfHostedGetOrganizationLicenseQuery.cs +++ b/src/Core/OrganizationFeatures/OrganizationLicenses/SelfHosted/SelfHostedGetOrganizationLicenseQuery.cs @@ -1,4 +1,5 @@ -using Bit.Core.Context; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Context; using Bit.Core.Entities; using Bit.Core.Exceptions; using Bit.Core.Models.Api.OrganizationLicenses; diff --git a/src/Core/OrganizationFeatures/OrganizationLicenses/UpdateOrganizationLicenseCommand.cs b/src/Core/OrganizationFeatures/OrganizationLicenses/UpdateOrganizationLicenseCommand.cs index 583f521434e5..e3c0aef73702 100644 --- a/src/Core/OrganizationFeatures/OrganizationLicenses/UpdateOrganizationLicenseCommand.cs +++ b/src/Core/OrganizationFeatures/OrganizationLicenses/UpdateOrganizationLicenseCommand.cs @@ -1,6 +1,9 @@ #nullable enable using System.Text.Json; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Models.Data.Organizations; +using Bit.Core.AdminConsole.Services; using Bit.Core.Entities; using Bit.Core.Exceptions; using Bit.Core.Models.Business; diff --git a/src/Core/OrganizationFeatures/OrganizationServiceCollectionExtensions.cs b/src/Core/OrganizationFeatures/OrganizationServiceCollectionExtensions.cs index 1756149236a3..b8b4742994c8 100644 --- a/src/Core/OrganizationFeatures/OrganizationServiceCollectionExtensions.cs +++ b/src/Core/OrganizationFeatures/OrganizationServiceCollectionExtensions.cs @@ -1,10 +1,14 @@ -using Bit.Core.AdminConsole.OrganizationAuth; -using Bit.Core.AdminConsole.OrganizationAuth.Interfaces; +using Bit.Core.AdminConsole.OrganizationFeatures.Groups; +using Bit.Core.AdminConsole.OrganizationFeatures.Groups.Interfaces; +using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationApiKeys; +using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationApiKeys.Interfaces; +using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationAuth; +using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationAuth.Interfaces; +using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationUsers; +using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationUsers.Interfaces; +using Bit.Core.AdminConsole.Services; +using Bit.Core.AdminConsole.Services.Implementations; using Bit.Core.Models.Business.Tokenables; -using Bit.Core.OrganizationFeatures.Groups; -using Bit.Core.OrganizationFeatures.Groups.Interfaces; -using Bit.Core.OrganizationFeatures.OrganizationApiKeys; -using Bit.Core.OrganizationFeatures.OrganizationApiKeys.Interfaces; using Bit.Core.OrganizationFeatures.OrganizationCollections; using Bit.Core.OrganizationFeatures.OrganizationCollections.Interfaces; using Bit.Core.OrganizationFeatures.OrganizationConnections; @@ -19,8 +23,6 @@ using Bit.Core.OrganizationFeatures.OrganizationSponsorships.FamiliesForEnterprise.SelfHosted; using Bit.Core.OrganizationFeatures.OrganizationSubscriptions; using Bit.Core.OrganizationFeatures.OrganizationSubscriptions.Interface; -using Bit.Core.OrganizationFeatures.OrganizationUsers; -using Bit.Core.OrganizationFeatures.OrganizationUsers.Interfaces; using Bit.Core.Services; using Bit.Core.Settings; using Bit.Core.Tokens; diff --git a/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/CancelSponsorshipCommand.cs b/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/CancelSponsorshipCommand.cs index 111cec395c95..15b5c436bf69 100644 --- a/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/CancelSponsorshipCommand.cs +++ b/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/CancelSponsorshipCommand.cs @@ -1,4 +1,5 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.Entities; using Bit.Core.Exceptions; using Bit.Core.Repositories; diff --git a/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Cloud/CloudRevokeSponsorshipCommand.cs b/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Cloud/CloudRevokeSponsorshipCommand.cs index 76c180f74e96..14ee626c0365 100644 --- a/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Cloud/CloudRevokeSponsorshipCommand.cs +++ b/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Cloud/CloudRevokeSponsorshipCommand.cs @@ -1,4 +1,5 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.Entities; using Bit.Core.Exceptions; using Bit.Core.OrganizationFeatures.OrganizationSponsorships.FamiliesForEnterprise.Interfaces; using Bit.Core.Repositories; diff --git a/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Cloud/CloudSyncSponsorshipsCommand.cs b/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Cloud/CloudSyncSponsorshipsCommand.cs index d0569278bbaa..29ff7487720e 100644 --- a/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Cloud/CloudSyncSponsorshipsCommand.cs +++ b/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Cloud/CloudSyncSponsorshipsCommand.cs @@ -1,4 +1,5 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Exceptions; using Bit.Core.Models.Data.Organizations.OrganizationSponsorships; diff --git a/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Cloud/RemoveSponsorshipCommand.cs b/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Cloud/RemoveSponsorshipCommand.cs index 1e05f8bc4fbf..dde359257bc7 100644 --- a/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Cloud/RemoveSponsorshipCommand.cs +++ b/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Cloud/RemoveSponsorshipCommand.cs @@ -1,4 +1,5 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.Entities; using Bit.Core.Exceptions; using Bit.Core.OrganizationFeatures.OrganizationSponsorships.FamiliesForEnterprise.Interfaces; using Bit.Core.Repositories; diff --git a/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Cloud/SendSponsorshipOfferCommand.cs b/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Cloud/SendSponsorshipOfferCommand.cs index 5f9a62d25f6c..975772ed1601 100644 --- a/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Cloud/SendSponsorshipOfferCommand.cs +++ b/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Cloud/SendSponsorshipOfferCommand.cs @@ -1,4 +1,6 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Exceptions; using Bit.Core.Models.Business.Tokenables; diff --git a/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Cloud/SetUpSponsorshipCommand.cs b/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Cloud/SetUpSponsorshipCommand.cs index 9230e7d13dbd..9afbdec6e564 100644 --- a/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Cloud/SetUpSponsorshipCommand.cs +++ b/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Cloud/SetUpSponsorshipCommand.cs @@ -1,4 +1,6 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.Entities; using Bit.Core.Exceptions; using Bit.Core.OrganizationFeatures.OrganizationSponsorships.FamiliesForEnterprise.Interfaces; using Bit.Core.Repositories; diff --git a/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Cloud/ValidateSponsorshipCommand.cs b/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Cloud/ValidateSponsorshipCommand.cs index 3f2d7af5ebd5..fa4b68c4facf 100644 --- a/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Cloud/ValidateSponsorshipCommand.cs +++ b/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Cloud/ValidateSponsorshipCommand.cs @@ -1,4 +1,6 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.Entities; using Bit.Core.OrganizationFeatures.OrganizationSponsorships.FamiliesForEnterprise.Interfaces; using Bit.Core.Repositories; using Bit.Core.Services; diff --git a/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/CreateSponsorshipCommand.cs b/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/CreateSponsorshipCommand.cs index 69e6c3232c45..241745c67cce 100644 --- a/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/CreateSponsorshipCommand.cs +++ b/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/CreateSponsorshipCommand.cs @@ -1,4 +1,6 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Exceptions; using Bit.Core.OrganizationFeatures.OrganizationSponsorships.FamiliesForEnterprise.Interfaces; diff --git a/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Interfaces/ICreateSponsorshipCommand.cs b/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Interfaces/ICreateSponsorshipCommand.cs index 1ba4b36628b0..8e3d055a7959 100644 --- a/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Interfaces/ICreateSponsorshipCommand.cs +++ b/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Interfaces/ICreateSponsorshipCommand.cs @@ -1,4 +1,5 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Entities; using Bit.Core.Enums; namespace Bit.Core.OrganizationFeatures.OrganizationSponsorships.FamiliesForEnterprise.Interfaces; diff --git a/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Interfaces/ISendSponsorshipOfferCommand.cs b/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Interfaces/ISendSponsorshipOfferCommand.cs index 9795ed00f221..2f7f2ba1f127 100644 --- a/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Interfaces/ISendSponsorshipOfferCommand.cs +++ b/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Interfaces/ISendSponsorshipOfferCommand.cs @@ -1,4 +1,5 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Entities; namespace Bit.Core.OrganizationFeatures.OrganizationSponsorships.FamiliesForEnterprise.Interfaces; diff --git a/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Interfaces/ISetUpSponsorshipCommand.cs b/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Interfaces/ISetUpSponsorshipCommand.cs index 4c57c907287b..45976b82eaf2 100644 --- a/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Interfaces/ISetUpSponsorshipCommand.cs +++ b/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Interfaces/ISetUpSponsorshipCommand.cs @@ -1,4 +1,5 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Entities; namespace Bit.Core.OrganizationFeatures.OrganizationSponsorships.FamiliesForEnterprise.Interfaces; diff --git a/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Interfaces/ISyncOrganizationSponsorshipsCommand.cs b/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Interfaces/ISyncOrganizationSponsorshipsCommand.cs index 0b8bb6444da7..a4351625a60c 100644 --- a/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Interfaces/ISyncOrganizationSponsorshipsCommand.cs +++ b/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Interfaces/ISyncOrganizationSponsorshipsCommand.cs @@ -1,4 +1,5 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Entities; using Bit.Core.Models.Data.Organizations.OrganizationSponsorships; namespace Bit.Core.OrganizationFeatures.OrganizationSponsorships.FamiliesForEnterprise.Interfaces; diff --git a/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/SelfHosted/SelfHostedRevokeSponsorshipCommand.cs b/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/SelfHosted/SelfHostedRevokeSponsorshipCommand.cs index 820d277581ee..fb5cfbcdd692 100644 --- a/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/SelfHosted/SelfHostedRevokeSponsorshipCommand.cs +++ b/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/SelfHosted/SelfHostedRevokeSponsorshipCommand.cs @@ -1,4 +1,5 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.Entities; using Bit.Core.Exceptions; using Bit.Core.OrganizationFeatures.OrganizationSponsorships.FamiliesForEnterprise.Interfaces; using Bit.Core.Repositories; diff --git a/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/SelfHosted/SelfHostedSyncSponsorshipsCommand.cs b/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/SelfHosted/SelfHostedSyncSponsorshipsCommand.cs index 0d22b53badef..278b8c95d147 100644 --- a/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/SelfHosted/SelfHostedSyncSponsorshipsCommand.cs +++ b/src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/SelfHosted/SelfHostedSyncSponsorshipsCommand.cs @@ -1,4 +1,5 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.Entities; using Bit.Core.Exceptions; using Bit.Core.IdentityServer; using Bit.Core.Models.Api.Request.OrganizationSponsorships; diff --git a/src/Core/OrganizationFeatures/OrganizationSubscriptions/AddSecretsManagerSubscriptionCommand.cs b/src/Core/OrganizationFeatures/OrganizationSubscriptions/AddSecretsManagerSubscriptionCommand.cs index bd33f336e47e..2bdeff7859bf 100644 --- a/src/Core/OrganizationFeatures/OrganizationSubscriptions/AddSecretsManagerSubscriptionCommand.cs +++ b/src/Core/OrganizationFeatures/OrganizationSubscriptions/AddSecretsManagerSubscriptionCommand.cs @@ -1,6 +1,10 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums.Provider; +using Bit.Core.AdminConsole.Models.Business; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; +using Bit.Core.Entities; using Bit.Core.Enums; -using Bit.Core.Enums.Provider; using Bit.Core.Exceptions; using Bit.Core.Models.Business; using Bit.Core.OrganizationFeatures.OrganizationSubscriptions.Interface; diff --git a/src/Core/OrganizationFeatures/OrganizationSubscriptions/Interface/IAddSecretsManagerSubscriptionCommand.cs b/src/Core/OrganizationFeatures/OrganizationSubscriptions/Interface/IAddSecretsManagerSubscriptionCommand.cs index 79adc740a5aa..51bf7d4371a0 100644 --- a/src/Core/OrganizationFeatures/OrganizationSubscriptions/Interface/IAddSecretsManagerSubscriptionCommand.cs +++ b/src/Core/OrganizationFeatures/OrganizationSubscriptions/Interface/IAddSecretsManagerSubscriptionCommand.cs @@ -1,4 +1,5 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Entities; namespace Bit.Core.OrganizationFeatures.OrganizationSubscriptions.Interface; diff --git a/src/Core/OrganizationFeatures/OrganizationSubscriptions/Interface/IUpgradeOrganizationPlanCommand.cs b/src/Core/OrganizationFeatures/OrganizationSubscriptions/Interface/IUpgradeOrganizationPlanCommand.cs index 59525242bb83..b60f7c7834ac 100644 --- a/src/Core/OrganizationFeatures/OrganizationSubscriptions/Interface/IUpgradeOrganizationPlanCommand.cs +++ b/src/Core/OrganizationFeatures/OrganizationSubscriptions/Interface/IUpgradeOrganizationPlanCommand.cs @@ -1,6 +1,8 @@ -namespace Bit.Core.OrganizationFeatures.OrganizationSubscriptions.Interface; +using Bit.Core.AdminConsole.Models.Business; + +namespace Bit.Core.OrganizationFeatures.OrganizationSubscriptions.Interface; public interface IUpgradeOrganizationPlanCommand { - Task> UpgradePlanAsync(Guid organizationId, Models.Business.OrganizationUpgrade upgrade); + Task> UpgradePlanAsync(Guid organizationId, OrganizationUpgrade upgrade); } diff --git a/src/Core/OrganizationFeatures/OrganizationSubscriptions/UpdateSecretsManagerSubscriptionCommand.cs b/src/Core/OrganizationFeatures/OrganizationSubscriptions/UpdateSecretsManagerSubscriptionCommand.cs index aeaac974d333..8c44a5decbf1 100644 --- a/src/Core/OrganizationFeatures/OrganizationSubscriptions/UpdateSecretsManagerSubscriptionCommand.cs +++ b/src/Core/OrganizationFeatures/OrganizationSubscriptions/UpdateSecretsManagerSubscriptionCommand.cs @@ -1,4 +1,8 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; +using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Exceptions; using Bit.Core.Models.Business; diff --git a/src/Core/OrganizationFeatures/OrganizationSubscriptions/UpgradeOrganizationPlanCommand.cs b/src/Core/OrganizationFeatures/OrganizationSubscriptions/UpgradeOrganizationPlanCommand.cs index 02b3818f126b..d76cba46c4d7 100644 --- a/src/Core/OrganizationFeatures/OrganizationSubscriptions/UpgradeOrganizationPlanCommand.cs +++ b/src/Core/OrganizationFeatures/OrganizationSubscriptions/UpgradeOrganizationPlanCommand.cs @@ -1,4 +1,9 @@ -using Bit.Core.AdminConsole.Models.OrganizationConnectionConfigs; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Models.Business; +using Bit.Core.AdminConsole.Models.OrganizationConnectionConfigs; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; using Bit.Core.Auth.Enums; using Bit.Core.Auth.Repositories; using Bit.Core.Context; diff --git a/src/Core/SecretsManager/Entities/AccessPolicy.cs b/src/Core/SecretsManager/Entities/AccessPolicy.cs index 6de856d8df5b..f450af5574a3 100644 --- a/src/Core/SecretsManager/Entities/AccessPolicy.cs +++ b/src/Core/SecretsManager/Entities/AccessPolicy.cs @@ -1,4 +1,5 @@ #nullable enable +using Bit.Core.AdminConsole.Entities; using Bit.Core.Entities; using Bit.Core.Utilities; diff --git a/src/Core/Services/IEventService.cs b/src/Core/Services/IEventService.cs index 10d8b6dbd0cb..38d147b50b91 100644 --- a/src/Core/Services/IEventService.cs +++ b/src/Core/Services/IEventService.cs @@ -1,5 +1,6 @@ -using Bit.Core.Entities; -using Bit.Core.Entities.Provider; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Entities.Provider; +using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.SecretsManager.Entities; using Bit.Core.Vault.Entities; diff --git a/src/Core/Services/ILicensingService.cs b/src/Core/Services/ILicensingService.cs index bf3b5ee4258e..e92fa87fd6f5 100644 --- a/src/Core/Services/ILicensingService.cs +++ b/src/Core/Services/ILicensingService.cs @@ -1,4 +1,5 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Entities; using Bit.Core.Models.Business; namespace Bit.Core.Services; diff --git a/src/Core/Services/IMailService.cs b/src/Core/Services/IMailService.cs index 0e5831082f8a..5536346fb5b1 100644 --- a/src/Core/Services/IMailService.cs +++ b/src/Core/Services/IMailService.cs @@ -1,7 +1,8 @@ -using Bit.Core.Auth.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Entities.Provider; +using Bit.Core.Auth.Entities; using Bit.Core.Auth.Models.Business; using Bit.Core.Entities; -using Bit.Core.Entities.Provider; using Bit.Core.Models.Mail; namespace Bit.Core.Services; diff --git a/src/Core/Services/IPaymentService.cs b/src/Core/Services/IPaymentService.cs index 03c2e93dd279..35c3372f33e5 100644 --- a/src/Core/Services/IPaymentService.cs +++ b/src/Core/Services/IPaymentService.cs @@ -1,4 +1,6 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Models.Business; +using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Models.Business; using Bit.Core.Models.StaticStore; diff --git a/src/Core/Services/IUserService.cs b/src/Core/Services/IUserService.cs index d0c078d40645..8259cff8a5ed 100644 --- a/src/Core/Services/IUserService.cs +++ b/src/Core/Services/IUserService.cs @@ -1,4 +1,6 @@ using System.Security.Claims; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Services; using Bit.Core.Auth.Enums; using Bit.Core.Auth.Models; using Bit.Core.Entities; diff --git a/src/Core/Services/Implementations/CollectionService.cs b/src/Core/Services/Implementations/CollectionService.cs index 006c8c5cfcda..fb6534ee5aab 100644 --- a/src/Core/Services/Implementations/CollectionService.cs +++ b/src/Core/Services/Implementations/CollectionService.cs @@ -1,4 +1,6 @@ -using Bit.Core.Context; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.Context; using Bit.Core.Entities; using Bit.Core.Exceptions; using Bit.Core.Models.Data; @@ -67,7 +69,7 @@ public async Task SaveAsync(Collection collection, IEnumerable { diff --git a/src/Core/Services/Implementations/EventService.cs b/src/Core/Services/Implementations/EventService.cs index d5dec0a10694..93c77524bd87 100644 --- a/src/Core/Services/Implementations/EventService.cs +++ b/src/Core/Services/Implementations/EventService.cs @@ -1,6 +1,11 @@ -using Bit.Core.Context; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Entities.Provider; +using Bit.Core.AdminConsole.Models.Data.Organizations; +using Bit.Core.AdminConsole.Models.Data.Provider; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; +using Bit.Core.Context; using Bit.Core.Entities; -using Bit.Core.Entities.Provider; using Bit.Core.Enums; using Bit.Core.Models.Data; using Bit.Core.Models.Data.Organizations; diff --git a/src/Core/Services/Implementations/HandlebarsMailService.cs b/src/Core/Services/Implementations/HandlebarsMailService.cs index 98ff7df07bd7..0b6fc8864777 100644 --- a/src/Core/Services/Implementations/HandlebarsMailService.cs +++ b/src/Core/Services/Implementations/HandlebarsMailService.cs @@ -1,10 +1,11 @@ using System.Net; using System.Reflection; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Entities.Provider; using Bit.Core.Auth.Entities; using Bit.Core.Auth.Models.Business; using Bit.Core.Auth.Models.Mail; using Bit.Core.Entities; -using Bit.Core.Entities.Provider; using Bit.Core.Models.Mail; using Bit.Core.Models.Mail.FamiliesForEnterprise; using Bit.Core.Models.Mail.Provider; diff --git a/src/Core/Services/Implementations/LicensingService.cs b/src/Core/Services/Implementations/LicensingService.cs index fc8cfe57371a..ba23cb7d4d6e 100644 --- a/src/Core/Services/Implementations/LicensingService.cs +++ b/src/Core/Services/Implementations/LicensingService.cs @@ -1,6 +1,8 @@ using System.Security.Cryptography.X509Certificates; using System.Text; using System.Text.Json; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Entities; using Bit.Core.Models.Business; using Bit.Core.Repositories; diff --git a/src/Core/Services/Implementations/OrganizationDomainService.cs b/src/Core/Services/Implementations/OrganizationDomainService.cs index ba342ce0342e..4fab01744860 100644 --- a/src/Core/Services/Implementations/OrganizationDomainService.cs +++ b/src/Core/Services/Implementations/OrganizationDomainService.cs @@ -1,4 +1,6 @@ -using Bit.Core.Enums; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.Enums; using Bit.Core.Repositories; using Bit.Core.Settings; using Microsoft.Extensions.Logging; @@ -53,7 +55,7 @@ public async Task ValidateOrganizationsDomainAsync() { _logger.LogInformation(Constants.BypassFiltersEventId, "Successfully validated domain"); - //update entry on OrganizationDomain table + //update entry on OrganizationDomain table domain.SetLastCheckedDate(); domain.SetVerifiedDate(); domain.SetJobRunCount(); @@ -64,7 +66,7 @@ await _eventService.LogOrganizationDomainEventAsync(domain, EventType.Organizati } else { - //update entry on OrganizationDomain table + //update entry on OrganizationDomain table domain.SetLastCheckedDate(); domain.SetJobRunCount(); domain.SetNextRunDate(_globalSettings.DomainVerification.VerificationInterval); @@ -78,7 +80,7 @@ await _eventService.LogOrganizationDomainEventAsync(domain, EventType.Organizati } catch (Exception ex) { - //update entry on OrganizationDomain table + //update entry on OrganizationDomain table domain.SetLastCheckedDate(); domain.SetJobRunCount(); domain.SetNextRunDate(_globalSettings.DomainVerification.VerificationInterval); @@ -117,7 +119,7 @@ await _mailService.SendUnverifiedOrganizationDomainEmailAsync(adminEmails, _logger.LogInformation(Constants.BypassFiltersEventId, "Expired domain: {domainName}", domain.DomainName); } - //delete domains that have not been verified within 7 days + //delete domains that have not been verified within 7 days var status = await _domainRepository.DeleteExpiredAsync(_globalSettings.DomainVerification.ExpirationPeriod); _logger.LogInformation(Constants.BypassFiltersEventId, "Delete status {status}", status); } diff --git a/src/Core/Services/Implementations/StripePaymentService.cs b/src/Core/Services/Implementations/StripePaymentService.cs index e1ac1ef7759b..cf3f96fbfc6f 100644 --- a/src/Core/Services/Implementations/StripePaymentService.cs +++ b/src/Core/Services/Implementations/StripePaymentService.cs @@ -1,4 +1,6 @@ using Bit.Billing.Models; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Models.Business; using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Exceptions; diff --git a/src/Core/Services/Implementations/UserService.cs b/src/Core/Services/Implementations/UserService.cs index 643e1bf18ea8..4c6ee8b4b6f9 100644 --- a/src/Core/Services/Implementations/UserService.cs +++ b/src/Core/Services/Implementations/UserService.cs @@ -1,5 +1,8 @@ using System.Security.Claims; using System.Text.Json; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; using Bit.Core.Auth.Enums; using Bit.Core.Auth.Models; using Bit.Core.Context; diff --git a/src/Core/Services/NoopImplementations/NoopEventService.cs b/src/Core/Services/NoopImplementations/NoopEventService.cs index 068e03e35c47..9a9d831c4e65 100644 --- a/src/Core/Services/NoopImplementations/NoopEventService.cs +++ b/src/Core/Services/NoopImplementations/NoopEventService.cs @@ -1,5 +1,6 @@ -using Bit.Core.Entities; -using Bit.Core.Entities.Provider; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Entities.Provider; +using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.SecretsManager.Entities; using Bit.Core.Vault.Entities; diff --git a/src/Core/Services/NoopImplementations/NoopLicensingService.cs b/src/Core/Services/NoopImplementations/NoopLicensingService.cs index c79be8009e80..8eb42a318c8c 100644 --- a/src/Core/Services/NoopImplementations/NoopLicensingService.cs +++ b/src/Core/Services/NoopImplementations/NoopLicensingService.cs @@ -1,4 +1,5 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Entities; using Bit.Core.Models.Business; using Bit.Core.Settings; using Microsoft.AspNetCore.Hosting; diff --git a/src/Core/Services/NoopImplementations/NoopMailService.cs b/src/Core/Services/NoopImplementations/NoopMailService.cs index 97d69cfa48bf..a3e64e051463 100644 --- a/src/Core/Services/NoopImplementations/NoopMailService.cs +++ b/src/Core/Services/NoopImplementations/NoopMailService.cs @@ -1,7 +1,8 @@ -using Bit.Core.Auth.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Entities.Provider; +using Bit.Core.Auth.Entities; using Bit.Core.Auth.Models.Business; using Bit.Core.Entities; -using Bit.Core.Entities.Provider; using Bit.Core.Models.Mail; namespace Bit.Core.Services; diff --git a/src/Core/Tools/Services/Implementations/SendService.cs b/src/Core/Tools/Services/Implementations/SendService.cs index 1c1cfab4e6a0..ff4867e2ddab 100644 --- a/src/Core/Tools/Services/Implementations/SendService.cs +++ b/src/Core/Tools/Services/Implementations/SendService.cs @@ -1,9 +1,12 @@ using System.Text.Json; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Models.Data.Organizations.Policies; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; using Bit.Core.Context; using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Exceptions; -using Bit.Core.Models.Data.Organizations.Policies; using Bit.Core.Repositories; using Bit.Core.Services; using Bit.Core.Settings; diff --git a/src/Core/Utilities/CoreHelpers.cs b/src/Core/Utilities/CoreHelpers.cs index c128fa8e46e5..0939463b6a2b 100644 --- a/src/Core/Utilities/CoreHelpers.cs +++ b/src/Core/Utilities/CoreHelpers.cs @@ -10,11 +10,13 @@ using Azure.Storage.Blobs; using Azure.Storage.Blobs.Models; using Azure.Storage.Queues.Models; +using Bit.Core.AdminConsole.Context; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Enums.Provider; using Bit.Core.Auth.Enums; using Bit.Core.Context; using Bit.Core.Entities; using Bit.Core.Enums; -using Bit.Core.Enums.Provider; using Bit.Core.Identity; using Bit.Core.Settings; using IdentityModel; @@ -647,31 +649,31 @@ public static List> BuildIdentityClaims(User user, { switch (group.Key) { - case Enums.OrganizationUserType.Owner: + case OrganizationUserType.Owner: foreach (var org in group) { claims.Add(new KeyValuePair(Claims.OrganizationOwner, org.Id.ToString())); } break; - case Enums.OrganizationUserType.Admin: + case OrganizationUserType.Admin: foreach (var org in group) { claims.Add(new KeyValuePair(Claims.OrganizationAdmin, org.Id.ToString())); } break; - case Enums.OrganizationUserType.Manager: + case OrganizationUserType.Manager: foreach (var org in group) { claims.Add(new KeyValuePair(Claims.OrganizationManager, org.Id.ToString())); } break; - case Enums.OrganizationUserType.User: + case OrganizationUserType.User: foreach (var org in group) { claims.Add(new KeyValuePair(Claims.OrganizationUser, org.Id.ToString())); } break; - case Enums.OrganizationUserType.Custom: + case OrganizationUserType.Custom: foreach (var org in group) { claims.Add(new KeyValuePair(Claims.OrganizationCustom, org.Id.ToString())); diff --git a/src/Core/Utilities/StaticStore.cs b/src/Core/Utilities/StaticStore.cs index 6726d9cd319b..a5b55f4c1789 100644 --- a/src/Core/Utilities/StaticStore.cs +++ b/src/Core/Utilities/StaticStore.cs @@ -1,6 +1,6 @@ using System.Collections.Immutable; +using Bit.Core.AdminConsole.Models.Data.Organizations.OrganizationUsers; using Bit.Core.Enums; -using Bit.Core.Models.Data.Organizations.OrganizationUsers; using Bit.Core.Models.StaticStore; using Bit.Core.Models.StaticStore.Plans; diff --git a/src/Core/Vault/Services/Implementations/CipherService.cs b/src/Core/Vault/Services/Implementations/CipherService.cs index 82a6753a9d59..436aae999015 100644 --- a/src/Core/Vault/Services/Implementations/CipherService.cs +++ b/src/Core/Vault/Services/Implementations/CipherService.cs @@ -1,4 +1,7 @@ using System.Text.Json; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; using Bit.Core.Context; using Bit.Core.Entities; using Bit.Core.Enums; @@ -32,7 +35,7 @@ public class CipherService : ICipherService private readonly IUserService _userService; private readonly IPolicyService _policyService; private readonly GlobalSettings _globalSettings; - private const long _fileSizeLeeway = 1024L * 1024L; // 1MB + private const long _fileSizeLeeway = 1024L * 1024L; // 1MB private readonly IReferenceEventService _referenceEventService; private readonly ICurrentContext _currentContext; @@ -650,7 +653,7 @@ public async Task SaveCollectionsAsync(Cipher cipher, IEnumerable collecti cipher.RevisionDate = DateTime.UtcNow; - // The sprocs will validate that all collections belong to this org/user and that they have + // The sprocs will validate that all collections belong to this org/user and that they have // proper write permissions. if (orgAdmin) { diff --git a/src/Events/Controllers/CollectController.cs b/src/Events/Controllers/CollectController.cs index a2bef7a7df4a..36e7a3ad8f5d 100644 --- a/src/Events/Controllers/CollectController.cs +++ b/src/Events/Controllers/CollectController.cs @@ -1,4 +1,5 @@ -using Bit.Core.Context; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.Context; using Bit.Core.Enums; using Bit.Core.Repositories; using Bit.Core.Services; diff --git a/src/Events/Startup.cs b/src/Events/Startup.cs index d41a27be0dc1..34ca63b1389e 100644 --- a/src/Events/Startup.cs +++ b/src/Events/Startup.cs @@ -1,4 +1,6 @@ using System.Globalization; +using Bit.Core.AdminConsole.Services; +using Bit.Core.AdminConsole.Services.Implementations; using Bit.Core.Context; using Bit.Core.IdentityServer; using Bit.Core.Services; diff --git a/src/Identity/IdentityServer/BaseRequestValidator.cs b/src/Identity/IdentityServer/BaseRequestValidator.cs index d52d3064a692..6e5524d71cc1 100644 --- a/src/Identity/IdentityServer/BaseRequestValidator.cs +++ b/src/Identity/IdentityServer/BaseRequestValidator.cs @@ -3,6 +3,12 @@ using System.Security.Claims; using System.Text.Json; using Bit.Core; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Models.Api.Response; +using Bit.Core.AdminConsole.Models.Data.Organizations; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; using Bit.Core.Auth.Entities; using Bit.Core.Auth.Enums; using Bit.Core.Auth.Identity; @@ -96,7 +102,7 @@ public BaseRequestValidator( _distributedCache = distributedCache; _cacheEntryOptions = new DistributedCacheEntryOptions { - // This sets the time an item is cached to 15 minutes. This value is hard coded + // This sets the time an item is cached to 15 minutes. This value is hard coded // to 15 because to it covers all time-out windows for both Authenticators and // Email TOTP. AbsoluteExpirationRelativeToNow = new TimeSpan(0, 15, 0) diff --git a/src/Identity/IdentityServer/ClientStore.cs b/src/Identity/IdentityServer/ClientStore.cs index f857e722598d..ecad173fcf71 100644 --- a/src/Identity/IdentityServer/ClientStore.cs +++ b/src/Identity/IdentityServer/ClientStore.cs @@ -1,5 +1,7 @@ using System.Collections.ObjectModel; using System.Security.Claims; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Context; using Bit.Core.Enums; using Bit.Core.Identity; diff --git a/src/Identity/IdentityServer/CustomTokenRequestValidator.cs b/src/Identity/IdentityServer/CustomTokenRequestValidator.cs index a15a7383722b..dd62e46686db 100644 --- a/src/Identity/IdentityServer/CustomTokenRequestValidator.cs +++ b/src/Identity/IdentityServer/CustomTokenRequestValidator.cs @@ -1,4 +1,6 @@ using System.Security.Claims; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; using Bit.Core.Auth.Identity; using Bit.Core.Auth.Models.Api.Response; using Bit.Core.Auth.Models.Business.Tokenables; diff --git a/src/Identity/IdentityServer/ProfileService.cs b/src/Identity/IdentityServer/ProfileService.cs index e8cad3c01d94..bbec6739ba5a 100644 --- a/src/Identity/IdentityServer/ProfileService.cs +++ b/src/Identity/IdentityServer/ProfileService.cs @@ -1,4 +1,5 @@ using System.Security.Claims; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Context; using Bit.Core.Identity; using Bit.Core.Repositories; diff --git a/src/Identity/IdentityServer/ResourceOwnerPasswordValidator.cs b/src/Identity/IdentityServer/ResourceOwnerPasswordValidator.cs index 8b8b0be52dc3..2027d9122485 100644 --- a/src/Identity/IdentityServer/ResourceOwnerPasswordValidator.cs +++ b/src/Identity/IdentityServer/ResourceOwnerPasswordValidator.cs @@ -1,4 +1,6 @@ using System.Security.Claims; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; using Bit.Core.Auth.Identity; using Bit.Core.Auth.Models.Business.Tokenables; using Bit.Core.Auth.Repositories; diff --git a/src/Infrastructure.Dapper/DapperHelpers.cs b/src/Infrastructure.Dapper/DapperHelpers.cs index 9f40e5600072..ced1988854fa 100644 --- a/src/Infrastructure.Dapper/DapperHelpers.cs +++ b/src/Infrastructure.Dapper/DapperHelpers.cs @@ -1,4 +1,5 @@ using System.Data; +using Bit.Core.AdminConsole.Entities; using Bit.Core.Entities; using Bit.Core.Models.Data; using Dapper; diff --git a/src/Infrastructure.Dapper/DapperServiceCollectionExtensions.cs b/src/Infrastructure.Dapper/DapperServiceCollectionExtensions.cs index d7082184d36e..0f8383ca537f 100644 --- a/src/Infrastructure.Dapper/DapperServiceCollectionExtensions.cs +++ b/src/Infrastructure.Dapper/DapperServiceCollectionExtensions.cs @@ -1,4 +1,5 @@ -using Bit.Core.Auth.Repositories; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.Auth.Repositories; using Bit.Core.Repositories; using Bit.Core.SecretsManager.Repositories; using Bit.Core.Tools.Repositories; diff --git a/src/Infrastructure.Dapper/Repositories/GroupRepository.cs b/src/Infrastructure.Dapper/Repositories/GroupRepository.cs index c5ef42c6b702..fdf90e2778a4 100644 --- a/src/Infrastructure.Dapper/Repositories/GroupRepository.cs +++ b/src/Infrastructure.Dapper/Repositories/GroupRepository.cs @@ -1,5 +1,8 @@ using System.Data; using System.Text.Json; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Models.Data; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Entities; using Bit.Core.Models.Data; using Bit.Core.Repositories; diff --git a/src/Infrastructure.Dapper/Repositories/OrganizationApiKeyRepository.cs b/src/Infrastructure.Dapper/Repositories/OrganizationApiKeyRepository.cs index a1f599f34dc4..353357072d1d 100644 --- a/src/Infrastructure.Dapper/Repositories/OrganizationApiKeyRepository.cs +++ b/src/Infrastructure.Dapper/Repositories/OrganizationApiKeyRepository.cs @@ -1,4 +1,7 @@ using System.Data; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Repositories; diff --git a/src/Infrastructure.Dapper/Repositories/OrganizationRepository.cs b/src/Infrastructure.Dapper/Repositories/OrganizationRepository.cs index 9d8cad0f9cef..a6501bc8779c 100644 --- a/src/Infrastructure.Dapper/Repositories/OrganizationRepository.cs +++ b/src/Infrastructure.Dapper/Repositories/OrganizationRepository.cs @@ -1,4 +1,7 @@ using System.Data; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Models.Data.Organizations; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Auth.Entities; using Bit.Core.Entities; using Bit.Core.Models.Data.Organizations; diff --git a/src/Infrastructure.Dapper/Repositories/OrganizationUserRepository.cs b/src/Infrastructure.Dapper/Repositories/OrganizationUserRepository.cs index 008242c26c2b..096bf8e72501 100644 --- a/src/Infrastructure.Dapper/Repositories/OrganizationUserRepository.cs +++ b/src/Infrastructure.Dapper/Repositories/OrganizationUserRepository.cs @@ -1,9 +1,12 @@ using System.Data; using System.Text.Json; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Models.Data.Organizations.OrganizationUsers; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Models.Data; -using Bit.Core.Models.Data.Organizations.OrganizationUsers; using Bit.Core.Repositories; using Bit.Core.Settings; using Dapper; diff --git a/src/Infrastructure.Dapper/Repositories/PolicyRepository.cs b/src/Infrastructure.Dapper/Repositories/PolicyRepository.cs index 8329a8a82b17..2d2c3e73b7dc 100644 --- a/src/Infrastructure.Dapper/Repositories/PolicyRepository.cs +++ b/src/Infrastructure.Dapper/Repositories/PolicyRepository.cs @@ -1,4 +1,7 @@ using System.Data; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Repositories; diff --git a/src/Infrastructure.Dapper/Repositories/ProviderOrganizationRepository.cs b/src/Infrastructure.Dapper/Repositories/ProviderOrganizationRepository.cs index 604d81a6e2db..bebac913b658 100644 --- a/src/Infrastructure.Dapper/Repositories/ProviderOrganizationRepository.cs +++ b/src/Infrastructure.Dapper/Repositories/ProviderOrganizationRepository.cs @@ -1,5 +1,7 @@ using System.Data; -using Bit.Core.Entities.Provider; +using Bit.Core.AdminConsole.Entities.Provider; +using Bit.Core.AdminConsole.Models.Data.Provider; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Models.Data; using Bit.Core.Repositories; using Bit.Core.Settings; diff --git a/src/Infrastructure.Dapper/Repositories/ProviderRepository.cs b/src/Infrastructure.Dapper/Repositories/ProviderRepository.cs index 39bc02931202..0fa5ed05701a 100644 --- a/src/Infrastructure.Dapper/Repositories/ProviderRepository.cs +++ b/src/Infrastructure.Dapper/Repositories/ProviderRepository.cs @@ -1,5 +1,7 @@ using System.Data; -using Bit.Core.Entities.Provider; +using Bit.Core.AdminConsole.Entities.Provider; +using Bit.Core.AdminConsole.Models.Data.Provider; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Models.Data; using Bit.Core.Repositories; using Bit.Core.Settings; diff --git a/src/Infrastructure.Dapper/Repositories/ProviderUserRepository.cs b/src/Infrastructure.Dapper/Repositories/ProviderUserRepository.cs index 114ed53f5433..e178e6705287 100644 --- a/src/Infrastructure.Dapper/Repositories/ProviderUserRepository.cs +++ b/src/Infrastructure.Dapper/Repositories/ProviderUserRepository.cs @@ -1,6 +1,8 @@ using System.Data; -using Bit.Core.Entities.Provider; -using Bit.Core.Enums.Provider; +using Bit.Core.AdminConsole.Entities.Provider; +using Bit.Core.AdminConsole.Enums.Provider; +using Bit.Core.AdminConsole.Models.Data.Provider; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Models.Data; using Bit.Core.Repositories; using Bit.Core.Settings; diff --git a/src/Infrastructure.EntityFramework/EntityFrameworkServiceCollectionExtensions.cs b/src/Infrastructure.EntityFramework/EntityFrameworkServiceCollectionExtensions.cs index 74716e2077d5..ff76213d796c 100644 --- a/src/Infrastructure.EntityFramework/EntityFrameworkServiceCollectionExtensions.cs +++ b/src/Infrastructure.EntityFramework/EntityFrameworkServiceCollectionExtensions.cs @@ -1,4 +1,5 @@ -using Bit.Core.Auth.Repositories; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.Auth.Repositories; using Bit.Core.Enums; using Bit.Core.Repositories; using Bit.Core.SecretsManager.Repositories; diff --git a/src/Infrastructure.EntityFramework/Models/Group.cs b/src/Infrastructure.EntityFramework/Models/Group.cs index eaa41bed8266..8df9dbd7b5a6 100644 --- a/src/Infrastructure.EntityFramework/Models/Group.cs +++ b/src/Infrastructure.EntityFramework/Models/Group.cs @@ -2,7 +2,7 @@ namespace Bit.Infrastructure.EntityFramework.Models; -public class Group : Core.Entities.Group +public class Group : Core.AdminConsole.Entities.Group { public virtual Organization Organization { get; set; } public virtual ICollection GroupUsers { get; set; } @@ -12,6 +12,6 @@ public class GroupMapperProfile : Profile { public GroupMapperProfile() { - CreateMap().ReverseMap(); + CreateMap().ReverseMap(); } } diff --git a/src/Infrastructure.EntityFramework/Models/GroupUser.cs b/src/Infrastructure.EntityFramework/Models/GroupUser.cs index 3f25e7d87645..4499b20f8a86 100644 --- a/src/Infrastructure.EntityFramework/Models/GroupUser.cs +++ b/src/Infrastructure.EntityFramework/Models/GroupUser.cs @@ -2,7 +2,7 @@ namespace Bit.Infrastructure.EntityFramework.Models; -public class GroupUser : Core.Entities.GroupUser +public class GroupUser : Core.AdminConsole.Entities.GroupUser { public virtual Group Group { get; set; } public virtual OrganizationUser OrganizationUser { get; set; } @@ -12,7 +12,7 @@ public class GroupUserMapperProfile : Profile { public GroupUserMapperProfile() { - CreateMap().ReverseMap(); + CreateMap().ReverseMap(); } } diff --git a/src/Infrastructure.EntityFramework/Models/Organization.cs b/src/Infrastructure.EntityFramework/Models/Organization.cs index d7410cf4a7cb..8daf97c834b1 100644 --- a/src/Infrastructure.EntityFramework/Models/Organization.cs +++ b/src/Infrastructure.EntityFramework/Models/Organization.cs @@ -1,4 +1,6 @@ using AutoMapper; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Models.Data.Organizations; using Bit.Core.Enums; using Bit.Core.Models.Data.Organizations; using Bit.Infrastructure.EntityFramework.Auth.Models; @@ -6,7 +8,7 @@ namespace Bit.Infrastructure.EntityFramework.Models; -public class Organization : Core.Entities.Organization +public class Organization : Core.AdminConsole.Entities.Organization { public virtual ICollection Ciphers { get; set; } public virtual ICollection OrganizationUsers { get; set; } @@ -25,7 +27,7 @@ public class OrganizationMapperProfile : Profile { public OrganizationMapperProfile() { - CreateMap().ReverseMap(); + CreateMap().ReverseMap(); CreateProjection() .ForMember(sd => sd.CollectionCount, opt => opt.MapFrom(o => o.Collections.Count)) .ForMember(sd => sd.GroupCount, opt => opt.MapFrom(o => o.Groups.Count)) diff --git a/src/Infrastructure.EntityFramework/Models/OrganizationApiKey.cs b/src/Infrastructure.EntityFramework/Models/OrganizationApiKey.cs index b8a4f4e74673..e88f34d3728a 100644 --- a/src/Infrastructure.EntityFramework/Models/OrganizationApiKey.cs +++ b/src/Infrastructure.EntityFramework/Models/OrganizationApiKey.cs @@ -2,7 +2,7 @@ namespace Bit.Infrastructure.EntityFramework.Models; -public class OrganizationApiKey : Core.Entities.OrganizationApiKey +public class OrganizationApiKey : Core.AdminConsole.Entities.OrganizationApiKey { public virtual Organization Organization { get; set; } } @@ -11,6 +11,6 @@ public class OrganizationApiKeyMapperProfile : Profile { public OrganizationApiKeyMapperProfile() { - CreateMap().ReverseMap(); + CreateMap().ReverseMap(); } } diff --git a/src/Infrastructure.EntityFramework/Models/OrganizationUser.cs b/src/Infrastructure.EntityFramework/Models/OrganizationUser.cs index f3e11835f0c5..59dc7fa70882 100644 --- a/src/Infrastructure.EntityFramework/Models/OrganizationUser.cs +++ b/src/Infrastructure.EntityFramework/Models/OrganizationUser.cs @@ -2,7 +2,7 @@ namespace Bit.Infrastructure.EntityFramework.Models; -public class OrganizationUser : Core.Entities.OrganizationUser +public class OrganizationUser : Core.AdminConsole.Entities.OrganizationUser { public virtual Organization Organization { get; set; } public virtual User User { get; set; } @@ -14,6 +14,6 @@ public class OrganizationUserMapperProfile : Profile { public OrganizationUserMapperProfile() { - CreateMap().ReverseMap(); + CreateMap().ReverseMap(); } } diff --git a/src/Infrastructure.EntityFramework/Models/Policy.cs b/src/Infrastructure.EntityFramework/Models/Policy.cs index 22b17c6f6d22..d5213f88270e 100644 --- a/src/Infrastructure.EntityFramework/Models/Policy.cs +++ b/src/Infrastructure.EntityFramework/Models/Policy.cs @@ -2,7 +2,7 @@ namespace Bit.Infrastructure.EntityFramework.Models; -public class Policy : Core.Entities.Policy +public class Policy : Core.AdminConsole.Entities.Policy { public virtual Organization Organization { get; set; } } @@ -11,6 +11,6 @@ public class PolicyMapperProfile : Profile { public PolicyMapperProfile() { - CreateMap().ReverseMap(); + CreateMap().ReverseMap(); } } diff --git a/src/Infrastructure.EntityFramework/Models/Provider/Provider.cs b/src/Infrastructure.EntityFramework/Models/Provider/Provider.cs index d639d6d01dc2..ffa861ca5165 100644 --- a/src/Infrastructure.EntityFramework/Models/Provider/Provider.cs +++ b/src/Infrastructure.EntityFramework/Models/Provider/Provider.cs @@ -2,7 +2,7 @@ namespace Bit.Infrastructure.EntityFramework.Models; -public class Provider : Core.Entities.Provider.Provider +public class Provider : Core.AdminConsole.Entities.Provider.Provider { } @@ -10,6 +10,6 @@ public class ProviderMapperProfile : Profile { public ProviderMapperProfile() { - CreateMap().ReverseMap(); + CreateMap().ReverseMap(); } } diff --git a/src/Infrastructure.EntityFramework/Models/Provider/ProviderOrganization.cs b/src/Infrastructure.EntityFramework/Models/Provider/ProviderOrganization.cs index af23ba978c7f..5ec038505913 100644 --- a/src/Infrastructure.EntityFramework/Models/Provider/ProviderOrganization.cs +++ b/src/Infrastructure.EntityFramework/Models/Provider/ProviderOrganization.cs @@ -2,7 +2,7 @@ namespace Bit.Infrastructure.EntityFramework.Models; -public class ProviderOrganization : Core.Entities.Provider.ProviderOrganization +public class ProviderOrganization : Core.AdminConsole.Entities.Provider.ProviderOrganization { public virtual Provider Provider { get; set; } public virtual Organization Organization { get; set; } @@ -12,6 +12,6 @@ public class ProviderOrganizationMapperProfile : Profile { public ProviderOrganizationMapperProfile() { - CreateMap().ReverseMap(); + CreateMap().ReverseMap(); } } diff --git a/src/Infrastructure.EntityFramework/Models/Provider/ProviderUser.cs b/src/Infrastructure.EntityFramework/Models/Provider/ProviderUser.cs index 5c53c4d97969..d30161c25210 100644 --- a/src/Infrastructure.EntityFramework/Models/Provider/ProviderUser.cs +++ b/src/Infrastructure.EntityFramework/Models/Provider/ProviderUser.cs @@ -2,7 +2,7 @@ namespace Bit.Infrastructure.EntityFramework.Models; -public class ProviderUser : Core.Entities.Provider.ProviderUser +public class ProviderUser : Core.AdminConsole.Entities.Provider.ProviderUser { public virtual User User { get; set; } public virtual Provider Provider { get; set; } @@ -12,6 +12,6 @@ public class ProviderUserMapperProfile : Profile { public ProviderUserMapperProfile() { - CreateMap().ReverseMap(); + CreateMap().ReverseMap(); } } diff --git a/src/Infrastructure.EntityFramework/Repositories/CollectionCipherRepository.cs b/src/Infrastructure.EntityFramework/Repositories/CollectionCipherRepository.cs index f929b8d92bfa..ad34632ad4d0 100644 --- a/src/Infrastructure.EntityFramework/Repositories/CollectionCipherRepository.cs +++ b/src/Infrastructure.EntityFramework/Repositories/CollectionCipherRepository.cs @@ -1,4 +1,5 @@ using AutoMapper; +using Bit.Core.AdminConsole.Enums; using Bit.Core.Enums; using Bit.Core.Repositories; using Bit.Infrastructure.EntityFramework.Repositories.Queries; diff --git a/src/Infrastructure.EntityFramework/Repositories/DatabaseContextExtensions.cs b/src/Infrastructure.EntityFramework/Repositories/DatabaseContextExtensions.cs index 480855d61c2f..352982cb55b3 100644 --- a/src/Infrastructure.EntityFramework/Repositories/DatabaseContextExtensions.cs +++ b/src/Infrastructure.EntityFramework/Repositories/DatabaseContextExtensions.cs @@ -1,6 +1,7 @@ -using Bit.Core.Auth.Enums; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Enums.Provider; +using Bit.Core.Auth.Enums; using Bit.Core.Enums; -using Bit.Core.Enums.Provider; using Bit.Infrastructure.EntityFramework.Repositories.Queries; using Microsoft.EntityFrameworkCore; diff --git a/src/Infrastructure.EntityFramework/Repositories/GroupRepository.cs b/src/Infrastructure.EntityFramework/Repositories/GroupRepository.cs index 9efd5e90c39f..e8c41db14b2e 100644 --- a/src/Infrastructure.EntityFramework/Repositories/GroupRepository.cs +++ b/src/Infrastructure.EntityFramework/Repositories/GroupRepository.cs @@ -1,19 +1,22 @@ using AutoMapper; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Models.Data; using Bit.Core.Repositories; using Bit.Infrastructure.EntityFramework.Models; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; +using Group = Bit.Core.AdminConsole.Entities.Group; +using GroupUser = Bit.Core.AdminConsole.Entities.GroupUser; namespace Bit.Infrastructure.EntityFramework.Repositories; -public class GroupRepository : Repository, IGroupRepository +public class GroupRepository : Repository, IGroupRepository { public GroupRepository(IServiceScopeFactory serviceScopeFactory, IMapper mapper) : base(serviceScopeFactory, mapper, (DatabaseContext context) => context.Groups) { } - public async Task CreateAsync(Core.Entities.Group obj, IEnumerable collections) + public async Task CreateAsync(Group obj, IEnumerable collections) { var grp = await base.CreateAsync(obj); using (var scope = ServiceScopeFactory.CreateScope()) @@ -51,7 +54,7 @@ public async Task DeleteUserAsync(Guid groupId, Guid organizationUserId) } } - public async Task>> GetByIdWithCollectionsAsync(Guid id) + public async Task>> GetByIdWithCollectionsAsync(Guid id) { var grp = await base.GetByIdAsync(id); using (var scope = ServiceScopeFactory.CreateScope()) @@ -67,12 +70,12 @@ from cg in dbContext.CollectionGroups ReadOnly = c.ReadOnly, HidePasswords = c.HidePasswords, }).ToList(); - return new Tuple>( + return new Tuple>( grp, collections); } } - public async Task> GetManyByOrganizationIdAsync(Guid organizationId) + public async Task> GetManyByOrganizationIdAsync(Guid organizationId) { using (var scope = ServiceScopeFactory.CreateScope()) { @@ -81,11 +84,11 @@ from cg in dbContext.CollectionGroups from g in dbContext.Groups where g.OrganizationId == organizationId select g).ToListAsync(); - return Mapper.Map>(data); + return Mapper.Map>(data); } } - public async Task>>> + public async Task>>> GetManyWithCollectionsByOrganizationIdAsync(Guid organizationId) { var groups = await GetManyByOrganizationIdAsync(organizationId); @@ -100,7 +103,7 @@ from cg in dbContext.CollectionGroups var collections = query.GroupBy(c => c.GroupId).ToList(); return groups.Select(group => - new Tuple>( + new Tuple>( group, collections .FirstOrDefault(c => c.Key == group.Id)? @@ -115,7 +118,7 @@ from cg in dbContext.CollectionGroups } } - public async Task> GetManyByManyIds(IEnumerable groupIds) + public async Task> GetManyByManyIds(IEnumerable groupIds) { using (var scope = ServiceScopeFactory.CreateScope()) { @@ -124,11 +127,11 @@ from cg in dbContext.CollectionGroups where groupIds.Contains(g.Id) select g; var groups = await query.ToListAsync(); - return Mapper.Map>(groups); + return Mapper.Map>(groups); } } - public async Task> GetManyGroupUsersByOrganizationIdAsync(Guid organizationId) + public async Task> GetManyGroupUsersByOrganizationIdAsync(Guid organizationId) { using (var scope = ServiceScopeFactory.CreateScope()) { @@ -140,7 +143,7 @@ on gu.GroupId equals g.Id where g.OrganizationId == organizationId select gu; var groupUsers = await query.ToListAsync(); - return Mapper.Map>(groupUsers); + return Mapper.Map>(groupUsers); } } @@ -172,7 +175,7 @@ from gu in dbContext.GroupUsers } } - public async Task ReplaceAsync(Core.Entities.Group group, IEnumerable requestedCollections) + public async Task ReplaceAsync(Group group, IEnumerable requestedCollections) { await base.ReplaceAsync(group); using (var scope = ServiceScopeFactory.CreateScope()) @@ -230,7 +233,7 @@ public async Task UpdateUsersAsync(Guid groupId, IEnumerable organizationU where organizationUserIds.Contains(ou.Id) && ou.OrganizationId == orgId && !dbContext.GroupUsers.Any(gu => gu.GroupId == groupId && ou.Id == gu.OrganizationUserId) - select new GroupUser + select new Models.GroupUser { GroupId = groupId, OrganizationUserId = ou.Id, diff --git a/src/Infrastructure.EntityFramework/Repositories/OrganizationApiKeyRepository.cs b/src/Infrastructure.EntityFramework/Repositories/OrganizationApiKeyRepository.cs index 52cf3d5e6abf..30054596dc4e 100644 --- a/src/Infrastructure.EntityFramework/Repositories/OrganizationApiKeyRepository.cs +++ b/src/Infrastructure.EntityFramework/Repositories/OrganizationApiKeyRepository.cs @@ -1,4 +1,7 @@ using AutoMapper; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Repositories; diff --git a/src/Infrastructure.EntityFramework/Repositories/OrganizationRepository.cs b/src/Infrastructure.EntityFramework/Repositories/OrganizationRepository.cs index b7ffb9978a49..444ffd85386d 100644 --- a/src/Infrastructure.EntityFramework/Repositories/OrganizationRepository.cs +++ b/src/Infrastructure.EntityFramework/Repositories/OrganizationRepository.cs @@ -1,5 +1,8 @@ using AutoMapper; using AutoMapper.QueryableExtensions; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Models.Data.Organizations; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Enums; using Bit.Core.Models.Data.Organizations; using Bit.Core.Repositories; @@ -9,13 +12,13 @@ namespace Bit.Infrastructure.EntityFramework.Repositories; -public class OrganizationRepository : Repository, IOrganizationRepository +public class OrganizationRepository : Repository, IOrganizationRepository { public OrganizationRepository(IServiceScopeFactory serviceScopeFactory, IMapper mapper) : base(serviceScopeFactory, mapper, (DatabaseContext context) => context.Organizations) { } - public async Task GetByIdentifierAsync(string identifier) + public async Task GetByIdentifierAsync(string identifier) { using (var scope = ServiceScopeFactory.CreateScope()) { @@ -26,17 +29,17 @@ public OrganizationRepository(IServiceScopeFactory serviceScopeFactory, IMapper } } - public async Task> GetManyByEnabledAsync() + public async Task> GetManyByEnabledAsync() { using (var scope = ServiceScopeFactory.CreateScope()) { var dbContext = GetDatabaseContext(scope); var organizations = await GetDbSet(dbContext).Where(e => e.Enabled).ToListAsync(); - return Mapper.Map>(organizations); + return Mapper.Map>(organizations); } } - public async Task> GetManyByUserIdAsync(Guid userId) + public async Task> GetManyByUserIdAsync(Guid userId) { using (var scope = ServiceScopeFactory.CreateScope()) { @@ -46,11 +49,11 @@ public OrganizationRepository(IServiceScopeFactory serviceScopeFactory, IMapper .Where(ou => ou.UserId == userId) .Select(ou => ou.Organization)) .ToListAsync(); - return Mapper.Map>(organizations); + return Mapper.Map>(organizations); } } - public async Task> SearchAsync(string name, string userEmail, + public async Task> SearchAsync(string name, string userEmail, bool? paid, int skip, int take) { using (var scope = ServiceScopeFactory.CreateScope()) @@ -65,7 +68,7 @@ public OrganizationRepository(IServiceScopeFactory serviceScopeFactory, IMapper .OrderBy(e => e.CreationDate) .Skip(skip).Take(take) .ToListAsync(); - return Mapper.Map>(organizations); + return Mapper.Map>(organizations); } } @@ -93,7 +96,7 @@ public async Task> GetManyAbilitiesAsync() } } - public async Task> SearchUnassignedToProviderAsync(string name, string ownerEmail, int skip, int take) + public async Task> SearchUnassignedToProviderAsync(string name, string ownerEmail, int skip, int take) { using (var scope = ServiceScopeFactory.CreateScope()) { @@ -137,7 +140,7 @@ public async Task UpdateStorageAsync(Guid id) await OrganizationUpdateStorage(id); } - public override async Task DeleteAsync(Core.Entities.Organization organization) + public override async Task DeleteAsync(Core.AdminConsole.Entities.Organization organization) { using (var scope = ServiceScopeFactory.CreateScope()) { @@ -197,7 +200,7 @@ await dbContext.OrganizationConnections.Where(oc => oc.OrganizationId == organiz } } - public async Task GetByLicenseKeyAsync(string licenseKey) + public async Task GetByLicenseKeyAsync(string licenseKey) { using (var scope = ServiceScopeFactory.CreateScope()) { diff --git a/src/Infrastructure.EntityFramework/Repositories/OrganizationUserRepository.cs b/src/Infrastructure.EntityFramework/Repositories/OrganizationUserRepository.cs index b3adada814cf..df2bcaa808a2 100644 --- a/src/Infrastructure.EntityFramework/Repositories/OrganizationUserRepository.cs +++ b/src/Infrastructure.EntityFramework/Repositories/OrganizationUserRepository.cs @@ -1,22 +1,25 @@ using AutoMapper; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Models.Data.Organizations.OrganizationUsers; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Enums; using Bit.Core.Models.Data; -using Bit.Core.Models.Data.Organizations.OrganizationUsers; using Bit.Core.Repositories; using Bit.Infrastructure.EntityFramework.Models; using Bit.Infrastructure.EntityFramework.Repositories.Queries; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; +using OrganizationUser = Bit.Core.AdminConsole.Entities.OrganizationUser; namespace Bit.Infrastructure.EntityFramework.Repositories; -public class OrganizationUserRepository : Repository, IOrganizationUserRepository +public class OrganizationUserRepository : Repository, IOrganizationUserRepository { public OrganizationUserRepository(IServiceScopeFactory serviceScopeFactory, IMapper mapper) : base(serviceScopeFactory, mapper, (DatabaseContext context) => context.OrganizationUsers) { } - public async Task CreateAsync(Core.Entities.OrganizationUser obj, IEnumerable collections) + public async Task CreateAsync(OrganizationUser obj, IEnumerable collections) { var organizationUser = await base.CreateAsync(obj); using (var scope = ServiceScopeFactory.CreateScope()) @@ -41,7 +44,7 @@ from c in dbContext.Collections return organizationUser.Id; } - public async Task> CreateManyAsync(IEnumerable organizationUsers) + public async Task> CreateManyAsync(IEnumerable organizationUsers) { if (!organizationUsers.Any()) { @@ -56,7 +59,7 @@ public async Task> CreateManyAsync(IEnumerable>(organizationUsers); + var entities = Mapper.Map>(organizationUsers); await dbContext.AddRangeAsync(entities); await dbContext.SaveChangesAsync(); } @@ -64,7 +67,7 @@ public async Task> CreateManyAsync(IEnumerable u.Id).ToList(); } - public override async Task DeleteAsync(Core.Entities.OrganizationUser organizationUser) => await DeleteAsync(organizationUser.Id); + public override async Task DeleteAsync(OrganizationUser organizationUser) => await DeleteAsync(organizationUser.Id); public async Task DeleteAsync(Guid organizationUserId) { using (var scope = ServiceScopeFactory.CreateScope()) @@ -128,7 +131,7 @@ public async Task DeleteManyAsync(IEnumerable organizationUserIds) } } - public async Task>> GetByIdWithCollectionsAsync(Guid id) + public async Task>> GetByIdWithCollectionsAsync(Guid id) { var organizationUser = await base.GetByIdAsync(id); using (var scope = ServiceScopeFactory.CreateScope()) @@ -147,12 +150,12 @@ on ou.Id equals cu.OrganizationUserId ReadOnly = cu.ReadOnly, HidePasswords = cu.HidePasswords, }); - return new Tuple>( + return new Tuple>( organizationUser, collections.ToList()); } } - public async Task GetByOrganizationAsync(Guid organizationId, Guid userId) + public async Task GetByOrganizationAsync(Guid organizationId, Guid userId) { using (var scope = ServiceScopeFactory.CreateScope()) { @@ -163,7 +166,7 @@ on ou.Id equals cu.OrganizationUserId } } - public async Task GetByOrganizationEmailAsync(Guid organizationId, string email) + public async Task GetByOrganizationEmailAsync(Guid organizationId, string email) { using (var scope = ServiceScopeFactory.CreateScope()) { @@ -260,7 +263,7 @@ public async Task GetDetailsByUserAsync(Gui } } - public async Task> GetManyAsync(IEnumerable Ids) + public async Task> GetManyAsync(IEnumerable Ids) { using (var scope = ServiceScopeFactory.CreateScope()) { @@ -273,7 +276,7 @@ where Ids.Contains(ou.Id) } } - public async Task> GetManyByManyUsersAsync(IEnumerable userIds) + public async Task> GetManyByManyUsersAsync(IEnumerable userIds) { using (var scope = ServiceScopeFactory.CreateScope()) { @@ -281,11 +284,11 @@ where Ids.Contains(ou.Id) var query = from ou in dbContext.OrganizationUsers where userIds.Contains(ou.Id) select ou; - return Mapper.Map>(await query.ToListAsync()); + return Mapper.Map>(await query.ToListAsync()); } } - public async Task> GetManyByOrganizationAsync(Guid organizationId, OrganizationUserType? type) + public async Task> GetManyByOrganizationAsync(Guid organizationId, OrganizationUserType? type) { using (var scope = ServiceScopeFactory.CreateScope()) { @@ -294,11 +297,11 @@ where userIds.Contains(ou.Id) where ou.OrganizationId == organizationId && (type == null || ou.Type == type) select ou; - return Mapper.Map>(await query.ToListAsync()); + return Mapper.Map>(await query.ToListAsync()); } } - public async Task> GetManyByUserAsync(Guid userId) + public async Task> GetManyByUserAsync(Guid userId) { using (var scope = ServiceScopeFactory.CreateScope()) { @@ -306,7 +309,7 @@ where userIds.Contains(ou.Id) var query = from ou in dbContext.OrganizationUsers where ou.UserId == userId select ou; - return Mapper.Map>(await query.ToListAsync()); + return Mapper.Map>(await query.ToListAsync()); } } @@ -411,7 +414,7 @@ on ou.UserId equals u.Id } } - public async override Task ReplaceAsync(Core.Entities.OrganizationUser organizationUser) + public async override Task ReplaceAsync(OrganizationUser organizationUser) { await base.ReplaceAsync(organizationUser); using (var scope = ServiceScopeFactory.CreateScope()) @@ -422,7 +425,7 @@ public async override Task ReplaceAsync(Core.Entities.OrganizationUser organizat } } - public async Task ReplaceAsync(Core.Entities.OrganizationUser obj, IEnumerable requestedCollections) + public async Task ReplaceAsync(OrganizationUser obj, IEnumerable requestedCollections) { await ReplaceAsync(obj); using (var scope = ServiceScopeFactory.CreateScope()) @@ -462,7 +465,7 @@ public async Task ReplaceAsync(Core.Entities.OrganizationUser obj, IEnumerable organizationUsers) + public async Task ReplaceManyAsync(IEnumerable organizationUsers) { using (var scope = ServiceScopeFactory.CreateScope()) { @@ -518,10 +521,10 @@ public async Task UpdateGroupsAsync(Guid orgUserId, IEnumerable groupIds) } } - public async Task UpsertManyAsync(IEnumerable organizationUsers) + public async Task UpsertManyAsync(IEnumerable organizationUsers) { - var createUsers = new List(); - var replaceUsers = new List(); + var createUsers = new List(); + var replaceUsers = new List(); foreach (var organizationUser in organizationUsers) { if (organizationUser.Id.Equals(default)) diff --git a/src/Infrastructure.EntityFramework/Repositories/PolicyRepository.cs b/src/Infrastructure.EntityFramework/Repositories/PolicyRepository.cs index 5dfe2b3bbb44..44a4f385ee60 100644 --- a/src/Infrastructure.EntityFramework/Repositories/PolicyRepository.cs +++ b/src/Infrastructure.EntityFramework/Repositories/PolicyRepository.cs @@ -1,31 +1,34 @@ using AutoMapper; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Enums; using Bit.Core.Repositories; using Bit.Infrastructure.EntityFramework.Models; using Bit.Infrastructure.EntityFramework.Repositories.Queries; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; +using Policy = Bit.Core.AdminConsole.Entities.Policy; namespace Bit.Infrastructure.EntityFramework.Repositories; -public class PolicyRepository : Repository, IPolicyRepository +public class PolicyRepository : Repository, IPolicyRepository { public PolicyRepository(IServiceScopeFactory serviceScopeFactory, IMapper mapper) : base(serviceScopeFactory, mapper, (DatabaseContext context) => context.Policies) { } - public async Task GetByOrganizationIdTypeAsync(Guid organizationId, PolicyType type) + public async Task GetByOrganizationIdTypeAsync(Guid organizationId, PolicyType type) { using (var scope = ServiceScopeFactory.CreateScope()) { var dbContext = GetDatabaseContext(scope); var results = await dbContext.Policies .FirstOrDefaultAsync(p => p.OrganizationId == organizationId && p.Type == type); - return Mapper.Map(results); + return Mapper.Map(results); } } - public async Task> GetManyByOrganizationIdAsync(Guid organizationId) + public async Task> GetManyByOrganizationIdAsync(Guid organizationId) { using (var scope = ServiceScopeFactory.CreateScope()) { @@ -33,11 +36,11 @@ public PolicyRepository(IServiceScopeFactory serviceScopeFactory, IMapper mapper var results = await dbContext.Policies .Where(p => p.OrganizationId == organizationId) .ToListAsync(); - return Mapper.Map>(results); + return Mapper.Map>(results); } } - public async Task> GetManyByUserIdAsync(Guid userId) + public async Task> GetManyByUserIdAsync(Guid userId) { using (var scope = ServiceScopeFactory.CreateScope()) { @@ -45,7 +48,7 @@ public PolicyRepository(IServiceScopeFactory serviceScopeFactory, IMapper mapper var query = new PolicyReadByUserIdQuery(userId); var results = await query.Run(dbContext).ToListAsync(); - return Mapper.Map>(results); + return Mapper.Map>(results); } } } diff --git a/src/Infrastructure.EntityFramework/Repositories/ProviderOrganizationRepository.cs b/src/Infrastructure.EntityFramework/Repositories/ProviderOrganizationRepository.cs index c5a6d34e2796..0644f43c9b5a 100644 --- a/src/Infrastructure.EntityFramework/Repositories/ProviderOrganizationRepository.cs +++ b/src/Infrastructure.EntityFramework/Repositories/ProviderOrganizationRepository.cs @@ -1,5 +1,7 @@ using AutoMapper; -using Bit.Core.Entities.Provider; +using Bit.Core.AdminConsole.Entities.Provider; +using Bit.Core.AdminConsole.Models.Data.Provider; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Models.Data; using Bit.Core.Repositories; using Bit.Infrastructure.EntityFramework.Repositories.Queries; diff --git a/src/Infrastructure.EntityFramework/Repositories/ProviderRepository.cs b/src/Infrastructure.EntityFramework/Repositories/ProviderRepository.cs index 8f66100738e7..c17192e50b7f 100644 --- a/src/Infrastructure.EntityFramework/Repositories/ProviderRepository.cs +++ b/src/Infrastructure.EntityFramework/Repositories/ProviderRepository.cs @@ -1,5 +1,7 @@ using AutoMapper; -using Bit.Core.Entities.Provider; +using Bit.Core.AdminConsole.Entities.Provider; +using Bit.Core.AdminConsole.Models.Data.Provider; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Models.Data; using Bit.Core.Repositories; using Microsoft.EntityFrameworkCore; diff --git a/src/Infrastructure.EntityFramework/Repositories/ProviderUserRepository.cs b/src/Infrastructure.EntityFramework/Repositories/ProviderUserRepository.cs index e858347fe292..68996f1f3677 100644 --- a/src/Infrastructure.EntityFramework/Repositories/ProviderUserRepository.cs +++ b/src/Infrastructure.EntityFramework/Repositories/ProviderUserRepository.cs @@ -1,6 +1,8 @@ using AutoMapper; -using Bit.Core.Entities.Provider; -using Bit.Core.Enums.Provider; +using Bit.Core.AdminConsole.Entities.Provider; +using Bit.Core.AdminConsole.Enums.Provider; +using Bit.Core.AdminConsole.Models.Data.Provider; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Models.Data; using Bit.Core.Repositories; using Bit.Infrastructure.EntityFramework.Repositories.Queries; diff --git a/src/Infrastructure.EntityFramework/Repositories/Queries/CollectionCipherReadByUserIdQuery.cs b/src/Infrastructure.EntityFramework/Repositories/Queries/CollectionCipherReadByUserIdQuery.cs index 1347a706f271..8adf2851dd8b 100644 --- a/src/Infrastructure.EntityFramework/Repositories/Queries/CollectionCipherReadByUserIdQuery.cs +++ b/src/Infrastructure.EntityFramework/Repositories/Queries/CollectionCipherReadByUserIdQuery.cs @@ -1,4 +1,5 @@ -using Bit.Core.Enums; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.Enums; using Bit.Infrastructure.EntityFramework.Models; namespace Bit.Infrastructure.EntityFramework.Repositories.Queries; diff --git a/src/Infrastructure.EntityFramework/Repositories/Queries/OrganizationUserOrganizationDetailsViewQuery.cs b/src/Infrastructure.EntityFramework/Repositories/Queries/OrganizationUserOrganizationDetailsViewQuery.cs index c308a41d2f2a..a03c10c91ad7 100644 --- a/src/Infrastructure.EntityFramework/Repositories/Queries/OrganizationUserOrganizationDetailsViewQuery.cs +++ b/src/Infrastructure.EntityFramework/Repositories/Queries/OrganizationUserOrganizationDetailsViewQuery.cs @@ -1,4 +1,4 @@ -using Bit.Core.Models.Data.Organizations.OrganizationUsers; +using Bit.Core.AdminConsole.Models.Data.Organizations.OrganizationUsers; namespace Bit.Infrastructure.EntityFramework.Repositories.Queries; diff --git a/src/Infrastructure.EntityFramework/Repositories/Queries/OrganizationUserReadCountByFreeOrganizationAdminUserQuery.cs b/src/Infrastructure.EntityFramework/Repositories/Queries/OrganizationUserReadCountByFreeOrganizationAdminUserQuery.cs index c1656d3dfdd0..0c451e7b3f5f 100644 --- a/src/Infrastructure.EntityFramework/Repositories/Queries/OrganizationUserReadCountByFreeOrganizationAdminUserQuery.cs +++ b/src/Infrastructure.EntityFramework/Repositories/Queries/OrganizationUserReadCountByFreeOrganizationAdminUserQuery.cs @@ -1,4 +1,5 @@ -using Bit.Core.Enums; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.Enums; using Bit.Infrastructure.EntityFramework.Models; namespace Bit.Infrastructure.EntityFramework.Repositories.Queries; diff --git a/src/Infrastructure.EntityFramework/Repositories/Queries/OrganizationUserReadOccupiedSeatCountByOrganizationIdQuery.cs b/src/Infrastructure.EntityFramework/Repositories/Queries/OrganizationUserReadOccupiedSeatCountByOrganizationIdQuery.cs index 47b50617a061..70d9390a2826 100644 --- a/src/Infrastructure.EntityFramework/Repositories/Queries/OrganizationUserReadOccupiedSeatCountByOrganizationIdQuery.cs +++ b/src/Infrastructure.EntityFramework/Repositories/Queries/OrganizationUserReadOccupiedSeatCountByOrganizationIdQuery.cs @@ -1,4 +1,5 @@ -using Bit.Core.Enums; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.Enums; using Bit.Infrastructure.EntityFramework.Models; namespace Bit.Infrastructure.EntityFramework.Repositories.Queries; diff --git a/src/Infrastructure.EntityFramework/Repositories/Queries/OrganizationUserReadOccupiedSmSeatCountByOrganizationIdQuery.cs b/src/Infrastructure.EntityFramework/Repositories/Queries/OrganizationUserReadOccupiedSmSeatCountByOrganizationIdQuery.cs index 0f21a80ba64f..ae847a7ab47e 100644 --- a/src/Infrastructure.EntityFramework/Repositories/Queries/OrganizationUserReadOccupiedSmSeatCountByOrganizationIdQuery.cs +++ b/src/Infrastructure.EntityFramework/Repositories/Queries/OrganizationUserReadOccupiedSmSeatCountByOrganizationIdQuery.cs @@ -1,4 +1,5 @@ -using Bit.Core.Enums; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.Enums; using Bit.Infrastructure.EntityFramework.Models; namespace Bit.Infrastructure.EntityFramework.Repositories.Queries; diff --git a/src/Infrastructure.EntityFramework/Repositories/Queries/OrganizationUserUserViewQuery.cs b/src/Infrastructure.EntityFramework/Repositories/Queries/OrganizationUserUserViewQuery.cs index 95f663817182..9dc0332f0b94 100644 --- a/src/Infrastructure.EntityFramework/Repositories/Queries/OrganizationUserUserViewQuery.cs +++ b/src/Infrastructure.EntityFramework/Repositories/Queries/OrganizationUserUserViewQuery.cs @@ -1,4 +1,4 @@ -using Bit.Core.Models.Data.Organizations.OrganizationUsers; +using Bit.Core.AdminConsole.Models.Data.Organizations.OrganizationUsers; namespace Bit.Infrastructure.EntityFramework.Repositories.Queries; diff --git a/src/Infrastructure.EntityFramework/Repositories/Queries/PolicyReadByUserIdQuery.cs b/src/Infrastructure.EntityFramework/Repositories/Queries/PolicyReadByUserIdQuery.cs index 9da530b01bc6..c1bf8cdf0820 100644 --- a/src/Infrastructure.EntityFramework/Repositories/Queries/PolicyReadByUserIdQuery.cs +++ b/src/Infrastructure.EntityFramework/Repositories/Queries/PolicyReadByUserIdQuery.cs @@ -1,4 +1,5 @@ -using Bit.Core.Enums; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.Enums; using Bit.Infrastructure.EntityFramework.Models; namespace Bit.Infrastructure.EntityFramework.Repositories.Queries; diff --git a/src/Infrastructure.EntityFramework/Repositories/Queries/ProviderOrganizationCountByOrganizationIdsQuery.cs b/src/Infrastructure.EntityFramework/Repositories/Queries/ProviderOrganizationCountByOrganizationIdsQuery.cs index 4d9357f2f70d..e50e34241066 100644 --- a/src/Infrastructure.EntityFramework/Repositories/Queries/ProviderOrganizationCountByOrganizationIdsQuery.cs +++ b/src/Infrastructure.EntityFramework/Repositories/Queries/ProviderOrganizationCountByOrganizationIdsQuery.cs @@ -1,4 +1,4 @@ -using Bit.Core.Entities.Provider; +using Bit.Core.AdminConsole.Entities.Provider; namespace Bit.Infrastructure.EntityFramework.Repositories.Queries; diff --git a/src/Infrastructure.EntityFramework/Repositories/Queries/ProviderOrganizationOrganizationDetailsReadByProviderIdQuery.cs b/src/Infrastructure.EntityFramework/Repositories/Queries/ProviderOrganizationOrganizationDetailsReadByProviderIdQuery.cs index 04d690a74340..473c0c125767 100644 --- a/src/Infrastructure.EntityFramework/Repositories/Queries/ProviderOrganizationOrganizationDetailsReadByProviderIdQuery.cs +++ b/src/Infrastructure.EntityFramework/Repositories/Queries/ProviderOrganizationOrganizationDetailsReadByProviderIdQuery.cs @@ -1,4 +1,6 @@ -using Bit.Core.Models.Data; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Models.Data.Provider; +using Bit.Core.Models.Data; namespace Bit.Infrastructure.EntityFramework.Repositories.Queries; @@ -29,7 +31,7 @@ on po.OrganizationId equals ou.OrganizationId Settings = x.po.Settings, CreationDate = x.po.CreationDate, RevisionDate = x.po.RevisionDate, - UserCount = x.o.OrganizationUsers.Count(ou => ou.Status == Core.Enums.OrganizationUserStatusType.Confirmed), + UserCount = x.o.OrganizationUsers.Count(ou => ou.Status == OrganizationUserStatusType.Confirmed), Seats = x.o.Seats, Plan = x.o.Plan, Status = x.o.Status diff --git a/src/Infrastructure.EntityFramework/Repositories/Queries/ProviderOrganizationReadByUserIdQuery.cs b/src/Infrastructure.EntityFramework/Repositories/Queries/ProviderOrganizationReadByUserIdQuery.cs index d28e178ab088..ef2d5cbb8de1 100644 --- a/src/Infrastructure.EntityFramework/Repositories/Queries/ProviderOrganizationReadByUserIdQuery.cs +++ b/src/Infrastructure.EntityFramework/Repositories/Queries/ProviderOrganizationReadByUserIdQuery.cs @@ -1,4 +1,5 @@ -using Bit.Core.Models.Data; +using Bit.Core.AdminConsole.Models.Data.Provider; +using Bit.Core.Models.Data; namespace Bit.Infrastructure.EntityFramework.Repositories.Queries; diff --git a/src/Infrastructure.EntityFramework/Repositories/Queries/ProviderUserOrganizationDetailsViewQuery.cs b/src/Infrastructure.EntityFramework/Repositories/Queries/ProviderUserOrganizationDetailsViewQuery.cs index d578012f42ab..8e06daa62664 100644 --- a/src/Infrastructure.EntityFramework/Repositories/Queries/ProviderUserOrganizationDetailsViewQuery.cs +++ b/src/Infrastructure.EntityFramework/Repositories/Queries/ProviderUserOrganizationDetailsViewQuery.cs @@ -1,4 +1,5 @@ -using Bit.Core.Models.Data; +using Bit.Core.AdminConsole.Models.Data.Provider; +using Bit.Core.Models.Data; namespace Bit.Infrastructure.EntityFramework.Repositories.Queries; diff --git a/src/Infrastructure.EntityFramework/Repositories/Queries/ProviderUserProviderDetailsReadByUserIdStatusQuery.cs b/src/Infrastructure.EntityFramework/Repositories/Queries/ProviderUserProviderDetailsReadByUserIdStatusQuery.cs index 1cae8437ac3a..1573c91de2fd 100644 --- a/src/Infrastructure.EntityFramework/Repositories/Queries/ProviderUserProviderDetailsReadByUserIdStatusQuery.cs +++ b/src/Infrastructure.EntityFramework/Repositories/Queries/ProviderUserProviderDetailsReadByUserIdStatusQuery.cs @@ -1,4 +1,5 @@ -using Bit.Core.Enums.Provider; +using Bit.Core.AdminConsole.Enums.Provider; +using Bit.Core.AdminConsole.Models.Data.Provider; using Bit.Core.Models.Data; namespace Bit.Infrastructure.EntityFramework.Repositories.Queries; diff --git a/src/Infrastructure.EntityFramework/Repositories/Queries/UserBumpAccountRevisionDateByCipherIdQuery.cs b/src/Infrastructure.EntityFramework/Repositories/Queries/UserBumpAccountRevisionDateByCipherIdQuery.cs index 55195d09b9df..88c800aa2c79 100644 --- a/src/Infrastructure.EntityFramework/Repositories/Queries/UserBumpAccountRevisionDateByCipherIdQuery.cs +++ b/src/Infrastructure.EntityFramework/Repositories/Queries/UserBumpAccountRevisionDateByCipherIdQuery.cs @@ -1,4 +1,5 @@ -using Bit.Core.Enums; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.Enums; using User = Bit.Infrastructure.EntityFramework.Models.User; namespace Bit.Infrastructure.EntityFramework.Repositories.Queries; diff --git a/src/Infrastructure.EntityFramework/Repositories/Queries/UserBumpAccountRevisionDateByOrganizationIdQuery.cs b/src/Infrastructure.EntityFramework/Repositories/Queries/UserBumpAccountRevisionDateByOrganizationIdQuery.cs index d18cdc064be8..4fe71f9ddc81 100644 --- a/src/Infrastructure.EntityFramework/Repositories/Queries/UserBumpAccountRevisionDateByOrganizationIdQuery.cs +++ b/src/Infrastructure.EntityFramework/Repositories/Queries/UserBumpAccountRevisionDateByOrganizationIdQuery.cs @@ -1,4 +1,5 @@ -using Bit.Core.Enums; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.Enums; using Bit.Infrastructure.EntityFramework.Models; namespace Bit.Infrastructure.EntityFramework.Repositories.Queries; diff --git a/src/Infrastructure.EntityFramework/Repositories/Queries/UserCipherDetailsQuery.cs b/src/Infrastructure.EntityFramework/Repositories/Queries/UserCipherDetailsQuery.cs index d1f8b0adf7b9..e18b3a655a07 100644 --- a/src/Infrastructure.EntityFramework/Repositories/Queries/UserCipherDetailsQuery.cs +++ b/src/Infrastructure.EntityFramework/Repositories/Queries/UserCipherDetailsQuery.cs @@ -1,4 +1,5 @@ using System.Text.Json; +using Bit.Core.AdminConsole.Enums; using Bit.Core.Enums; using Bit.Core.Vault.Models.Data; using Bit.Infrastructure.EntityFramework.Vault.Models; diff --git a/src/Infrastructure.EntityFramework/Repositories/Queries/UserCollectionDetailsQuery.cs b/src/Infrastructure.EntityFramework/Repositories/Queries/UserCollectionDetailsQuery.cs index fa84b3c651bf..e25712d161d9 100644 --- a/src/Infrastructure.EntityFramework/Repositories/Queries/UserCollectionDetailsQuery.cs +++ b/src/Infrastructure.EntityFramework/Repositories/Queries/UserCollectionDetailsQuery.cs @@ -1,4 +1,5 @@ -using Bit.Core.Enums; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.Enums; using Bit.Core.Models.Data; namespace Bit.Infrastructure.EntityFramework.Repositories.Queries; diff --git a/src/Infrastructure.EntityFramework/Repositories/Queries/UserReadPublicKeysByProviderUserIdsQuery.cs b/src/Infrastructure.EntityFramework/Repositories/Queries/UserReadPublicKeysByProviderUserIdsQuery.cs index db347b99b4a2..3b494d54e81c 100644 --- a/src/Infrastructure.EntityFramework/Repositories/Queries/UserReadPublicKeysByProviderUserIdsQuery.cs +++ b/src/Infrastructure.EntityFramework/Repositories/Queries/UserReadPublicKeysByProviderUserIdsQuery.cs @@ -1,4 +1,5 @@ -using Bit.Core.Enums.Provider; +using Bit.Core.AdminConsole.Enums.Provider; +using Bit.Core.AdminConsole.Models.Data.Provider; using Bit.Core.Models.Data; namespace Bit.Infrastructure.EntityFramework.Repositories.Queries; diff --git a/src/Infrastructure.EntityFramework/Vault/Repositories/CipherRepository.cs b/src/Infrastructure.EntityFramework/Vault/Repositories/CipherRepository.cs index c575838362f4..4663118a2c9a 100644 --- a/src/Infrastructure.EntityFramework/Vault/Repositories/CipherRepository.cs +++ b/src/Infrastructure.EntityFramework/Vault/Repositories/CipherRepository.cs @@ -1,6 +1,7 @@ using System.Text.Json; using System.Text.Json.Nodes; using AutoMapper; +using Bit.Core.AdminConsole.Enums; using Bit.Core.Enums; using Bit.Core.Utilities; using Bit.Core.Vault.Enums; diff --git a/src/Infrastructure.EntityFramework/Vault/Repositories/Queries/CipherReadCanEditByIdUserIdQuery.cs b/src/Infrastructure.EntityFramework/Vault/Repositories/Queries/CipherReadCanEditByIdUserIdQuery.cs index 3f0a17180bea..4b5a8d90bb98 100644 --- a/src/Infrastructure.EntityFramework/Vault/Repositories/Queries/CipherReadCanEditByIdUserIdQuery.cs +++ b/src/Infrastructure.EntityFramework/Vault/Repositories/Queries/CipherReadCanEditByIdUserIdQuery.cs @@ -1,4 +1,5 @@ -using Bit.Core.Enums; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.Enums; using Bit.Infrastructure.EntityFramework.Repositories; using Bit.Infrastructure.EntityFramework.Repositories.Queries; using Bit.Infrastructure.EntityFramework.Vault.Models; diff --git a/src/SharedWeb/Utilities/ServiceCollectionExtensions.cs b/src/SharedWeb/Utilities/ServiceCollectionExtensions.cs index ea97af041958..0143c9296e96 100644 --- a/src/SharedWeb/Utilities/ServiceCollectionExtensions.cs +++ b/src/SharedWeb/Utilities/ServiceCollectionExtensions.cs @@ -3,6 +3,9 @@ using System.Security.Claims; using System.Security.Cryptography.X509Certificates; using AspNetCoreRateLimit; +using Bit.Core.AdminConsole.Services; +using Bit.Core.AdminConsole.Services.Implementations; +using Bit.Core.AdminConsole.Services.NoopImplementations; using Bit.Core.Auth.Enums; using Bit.Core.Auth.Identity; using Bit.Core.Auth.IdentityServer; diff --git a/test/Api.IntegrationTest/Controllers/ConfigControllerTests.cs b/test/Api.IntegrationTest/Controllers/ConfigControllerTests.cs index 22c73983983c..1d4483412caf 100644 --- a/test/Api.IntegrationTest/Controllers/ConfigControllerTests.cs +++ b/test/Api.IntegrationTest/Controllers/ConfigControllerTests.cs @@ -2,6 +2,8 @@ using Bit.Api.IntegrationTest.Factories; using Bit.Api.IntegrationTest.Helpers; using Bit.Api.Models.Response; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; using Bit.Core.Entities; using Xunit; @@ -79,7 +81,7 @@ public async Task GetConfigs_WithOrganizations(int orgCount) Organization org; (org, _) = await OrganizationTestHelpers.SignUpAsync(_factory, plan: Core.Enums.PlanType.Free, ownerEmail: ownerEmail, name: i.ToString(), billingEmail: ownerEmail, ownerKey: i.ToString()); - await OrganizationTestHelpers.CreateUserAsync(_factory, org.Id, _email, Core.Enums.OrganizationUserType.User); + await OrganizationTestHelpers.CreateUserAsync(_factory, org.Id, _email, OrganizationUserType.User); } await LoginAsync(); diff --git a/test/Api.IntegrationTest/Helpers/OrganizationTestHelpers.cs b/test/Api.IntegrationTest/Helpers/OrganizationTestHelpers.cs index e84d89713e7a..59ea0bb217ff 100644 --- a/test/Api.IntegrationTest/Helpers/OrganizationTestHelpers.cs +++ b/test/Api.IntegrationTest/Helpers/OrganizationTestHelpers.cs @@ -1,4 +1,9 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Models.Business; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; +using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Models.Business; using Bit.Core.Repositories; diff --git a/test/Api.IntegrationTest/SecretsManager/Controllers/AccessPoliciesControllerTests.cs b/test/Api.IntegrationTest/SecretsManager/Controllers/AccessPoliciesControllerTests.cs index 006bcc2c246d..a1c5c6ef552a 100644 --- a/test/Api.IntegrationTest/SecretsManager/Controllers/AccessPoliciesControllerTests.cs +++ b/test/Api.IntegrationTest/SecretsManager/Controllers/AccessPoliciesControllerTests.cs @@ -5,6 +5,7 @@ using Bit.Api.Models.Response; using Bit.Api.SecretsManager.Models.Request; using Bit.Api.SecretsManager.Models.Response; +using Bit.Core.AdminConsole.Enums; using Bit.Core.Enums; using Bit.Core.SecretsManager.Entities; using Bit.Core.SecretsManager.Repositories; diff --git a/test/Api.IntegrationTest/SecretsManager/Controllers/ProjectsControllerTests.cs b/test/Api.IntegrationTest/SecretsManager/Controllers/ProjectsControllerTests.cs index 65ec123a2027..40f45922348f 100644 --- a/test/Api.IntegrationTest/SecretsManager/Controllers/ProjectsControllerTests.cs +++ b/test/Api.IntegrationTest/SecretsManager/Controllers/ProjectsControllerTests.cs @@ -5,6 +5,8 @@ using Bit.Api.Models.Response; using Bit.Api.SecretsManager.Models.Request; using Bit.Api.SecretsManager.Models.Response; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.SecretsManager.Entities; diff --git a/test/Api.IntegrationTest/SecretsManager/Controllers/SecretsControllerTests.cs b/test/Api.IntegrationTest/SecretsManager/Controllers/SecretsControllerTests.cs index 8cea05c5cb7f..95accf5dc5a8 100644 --- a/test/Api.IntegrationTest/SecretsManager/Controllers/SecretsControllerTests.cs +++ b/test/Api.IntegrationTest/SecretsManager/Controllers/SecretsControllerTests.cs @@ -5,6 +5,7 @@ using Bit.Api.Models.Response; using Bit.Api.SecretsManager.Models.Request; using Bit.Api.SecretsManager.Models.Response; +using Bit.Core.AdminConsole.Enums; using Bit.Core.Enums; using Bit.Core.SecretsManager.Entities; using Bit.Core.SecretsManager.Repositories; diff --git a/test/Api.IntegrationTest/SecretsManager/Controllers/SecretsTrashControllerTests.cs b/test/Api.IntegrationTest/SecretsManager/Controllers/SecretsTrashControllerTests.cs index 69837981f6c7..43ac474787f6 100644 --- a/test/Api.IntegrationTest/SecretsManager/Controllers/SecretsTrashControllerTests.cs +++ b/test/Api.IntegrationTest/SecretsManager/Controllers/SecretsTrashControllerTests.cs @@ -2,6 +2,7 @@ using System.Net.Http.Headers; using Bit.Api.IntegrationTest.Factories; using Bit.Api.SecretsManager.Models.Response; +using Bit.Core.AdminConsole.Enums; using Bit.Core.Enums; using Bit.Core.SecretsManager.Repositories; using Xunit; diff --git a/test/Api.IntegrationTest/SecretsManager/Controllers/ServiceAccountsControllerTests.cs b/test/Api.IntegrationTest/SecretsManager/Controllers/ServiceAccountsControllerTests.cs index 8150dced5229..d4428011b30e 100644 --- a/test/Api.IntegrationTest/SecretsManager/Controllers/ServiceAccountsControllerTests.cs +++ b/test/Api.IntegrationTest/SecretsManager/Controllers/ServiceAccountsControllerTests.cs @@ -5,6 +5,8 @@ using Bit.Api.Models.Response; using Bit.Api.SecretsManager.Models.Request; using Bit.Api.SecretsManager.Models.Response; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.SecretsManager.Entities; diff --git a/test/Api.IntegrationTest/SecretsManager/SecretsManagerOrganizationHelper.cs b/test/Api.IntegrationTest/SecretsManager/SecretsManagerOrganizationHelper.cs index 6430f7199a97..3d9ad67e62c8 100644 --- a/test/Api.IntegrationTest/SecretsManager/SecretsManagerOrganizationHelper.cs +++ b/test/Api.IntegrationTest/SecretsManager/SecretsManagerOrganizationHelper.cs @@ -1,5 +1,8 @@ using Bit.Api.IntegrationTest.Factories; using Bit.Api.IntegrationTest.Helpers; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Repositories; diff --git a/test/Api.Test/AdminConsole/Controllers/GroupsControllerTests.cs b/test/Api.Test/AdminConsole/Controllers/GroupsControllerTests.cs index 1bf97e0e8f2a..9777cb9e66e3 100644 --- a/test/Api.Test/AdminConsole/Controllers/GroupsControllerTests.cs +++ b/test/Api.Test/AdminConsole/Controllers/GroupsControllerTests.cs @@ -1,9 +1,11 @@ using Bit.Api.AdminConsole.Controllers; using Bit.Api.AdminConsole.Models.Request; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.OrganizationFeatures.Groups.Interfaces; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Context; using Bit.Core.Entities; using Bit.Core.Models.Data; -using Bit.Core.OrganizationFeatures.Groups.Interfaces; using Bit.Core.Repositories; using Bit.Test.Common.AutoFixture; using Bit.Test.Common.AutoFixture.Attributes; diff --git a/test/Api.Test/AdminConsole/Controllers/OrganizationSponsorshipsControllerTests.cs b/test/Api.Test/AdminConsole/Controllers/OrganizationSponsorshipsControllerTests.cs index e54a89688564..a381bac796c7 100644 --- a/test/Api.Test/AdminConsole/Controllers/OrganizationSponsorshipsControllerTests.cs +++ b/test/Api.Test/AdminConsole/Controllers/OrganizationSponsorshipsControllerTests.cs @@ -1,5 +1,8 @@ using Bit.Api.Controllers; using Bit.Api.Models.Request.Organizations; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Context; using Bit.Core.Entities; using Bit.Core.Enums; diff --git a/test/Api.Test/AdminConsole/Controllers/OrganizationUsersControllerTests.cs b/test/Api.Test/AdminConsole/Controllers/OrganizationUsersControllerTests.cs index 4b5c633cbeed..34170dbd5aa5 100644 --- a/test/Api.Test/AdminConsole/Controllers/OrganizationUsersControllerTests.cs +++ b/test/Api.Test/AdminConsole/Controllers/OrganizationUsersControllerTests.cs @@ -1,7 +1,11 @@ using Bit.Api.AdminConsole.Controllers; using Bit.Api.AdminConsole.Models.Request.Organizations; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Models.Data.Organizations.Policies; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; using Bit.Core.Entities; -using Bit.Core.Models.Data.Organizations.Policies; using Bit.Core.Repositories; using Bit.Core.Services; using Bit.Core.Utilities; @@ -21,7 +25,7 @@ public class OrganizationUsersControllerTests public async Task PutResetPasswordEnrollment_InivitedUser_AcceptsInvite(Guid orgId, Guid userId, OrganizationUserResetPasswordEnrollmentRequestModel model, User user, OrganizationUser orgUser, SutProvider sutProvider) { - orgUser.Status = Core.Enums.OrganizationUserStatusType.Invited; + orgUser.Status = OrganizationUserStatusType.Invited; sutProvider.GetDependency().GetUserByPrincipalAsync(default).ReturnsForAnyArgs(user); sutProvider.GetDependency().GetByOrganizationAsync(default, default).ReturnsForAnyArgs(orgUser); @@ -35,7 +39,7 @@ public async Task PutResetPasswordEnrollment_InivitedUser_AcceptsInvite(Guid org public async Task PutResetPasswordEnrollment_ConfirmedUser_AcceptsInvite(Guid orgId, Guid userId, OrganizationUserResetPasswordEnrollmentRequestModel model, User user, OrganizationUser orgUser, SutProvider sutProvider) { - orgUser.Status = Core.Enums.OrganizationUserStatusType.Confirmed; + orgUser.Status = OrganizationUserStatusType.Confirmed; sutProvider.GetDependency().GetUserByPrincipalAsync(default).ReturnsForAnyArgs(user); sutProvider.GetDependency().GetByOrganizationAsync(default, default).ReturnsForAnyArgs(orgUser); @@ -81,7 +85,7 @@ public async Task Accept_RequireMasterPasswordReset(Guid orgId, Guid orgUserId, }; sutProvider.GetDependency().GetUserByPrincipalAsync(default).ReturnsForAnyArgs(user); sutProvider.GetDependency().GetByOrganizationIdTypeAsync(orgId, - Core.Enums.PolicyType.ResetPassword).Returns(policy); + PolicyType.ResetPassword).Returns(policy); await sutProvider.Sut.Accept(orgId, orgUserId, model); diff --git a/test/Api.Test/AdminConsole/Controllers/OrganizationsControllerTests.cs b/test/Api.Test/AdminConsole/Controllers/OrganizationsControllerTests.cs index 2568ba518a89..b1acae27d414 100644 --- a/test/Api.Test/AdminConsole/Controllers/OrganizationsControllerTests.cs +++ b/test/Api.Test/AdminConsole/Controllers/OrganizationsControllerTests.cs @@ -1,6 +1,9 @@ using System.Security.Claims; using AutoFixture.Xunit2; using Bit.Api.AdminConsole.Controllers; +using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationApiKeys.Interfaces; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; using Bit.Core.Auth.Entities; using Bit.Core.Auth.Enums; using Bit.Core.Auth.Models.Data; @@ -9,7 +12,6 @@ using Bit.Core.Context; using Bit.Core.Entities; using Bit.Core.Exceptions; -using Bit.Core.OrganizationFeatures.OrganizationApiKeys.Interfaces; using Bit.Core.OrganizationFeatures.OrganizationLicenses.Interfaces; using Bit.Core.OrganizationFeatures.OrganizationSubscriptions.Interface; using Bit.Core.Repositories; diff --git a/test/Api.Test/AdminConsole/Public/Controllers/GroupsControllerTests.cs b/test/Api.Test/AdminConsole/Public/Controllers/GroupsControllerTests.cs index 2ba4cfd01b2f..37351b3255d1 100644 --- a/test/Api.Test/AdminConsole/Public/Controllers/GroupsControllerTests.cs +++ b/test/Api.Test/AdminConsole/Public/Controllers/GroupsControllerTests.cs @@ -1,10 +1,12 @@ using Bit.Api.AdminConsole.Public.Controllers; using Bit.Api.AdminConsole.Public.Models.Request; using Bit.Api.AdminConsole.Public.Models.Response; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.OrganizationFeatures.Groups.Interfaces; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Context; using Bit.Core.Entities; using Bit.Core.Models.Data; -using Bit.Core.OrganizationFeatures.Groups.Interfaces; using Bit.Core.Repositories; using Bit.Test.Common.AutoFixture; using Bit.Test.Common.AutoFixture.Attributes; diff --git a/test/Api.Test/Controllers/AccountsControllerTests.cs b/test/Api.Test/Controllers/AccountsControllerTests.cs index 0dff6db93d7a..0d161d2bde75 100644 --- a/test/Api.Test/Controllers/AccountsControllerTests.cs +++ b/test/Api.Test/Controllers/AccountsControllerTests.cs @@ -1,6 +1,8 @@ using System.Security.Claims; using Bit.Api.Auth.Models.Request.Accounts; using Bit.Api.Controllers; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; using Bit.Core.Auth.Models.Api.Request.Accounts; using Bit.Core.Auth.Services; using Bit.Core.Entities; diff --git a/test/Api.Test/Controllers/CollectionsControllerTests.cs b/test/Api.Test/Controllers/CollectionsControllerTests.cs index c035a8bc51a1..50411e6c71d3 100644 --- a/test/Api.Test/Controllers/CollectionsControllerTests.cs +++ b/test/Api.Test/Controllers/CollectionsControllerTests.cs @@ -1,5 +1,6 @@ using Bit.Api.Controllers; using Bit.Api.Models.Request; +using Bit.Core.AdminConsole.Entities; using Bit.Core.Context; using Bit.Core.Entities; using Bit.Core.Exceptions; diff --git a/test/Api.Test/Controllers/OrganizationDomainControllerTests.cs b/test/Api.Test/Controllers/OrganizationDomainControllerTests.cs index bd97aa20bf5e..a816a2b8c7d8 100644 --- a/test/Api.Test/Controllers/OrganizationDomainControllerTests.cs +++ b/test/Api.Test/Controllers/OrganizationDomainControllerTests.cs @@ -3,6 +3,7 @@ using Bit.Api.Models.Request.Organizations; using Bit.Api.Models.Response; using Bit.Api.Models.Response.Organizations; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Context; using Bit.Core.Exceptions; using Bit.Core.Models.Data.Organizations; @@ -13,7 +14,7 @@ using NSubstitute; using NSubstitute.ReturnsExtensions; using Xunit; -using Organization = Bit.Core.Entities.Organization; +using Organization = Bit.Core.AdminConsole.Entities.Organization; using OrganizationDomain = Bit.Core.Entities.OrganizationDomain; namespace Bit.Api.Test.Controllers; diff --git a/test/Api.Test/SecretsManager/Controllers/AccessPoliciesControllerTests.cs b/test/Api.Test/SecretsManager/Controllers/AccessPoliciesControllerTests.cs index e369120a9541..be00ce0aa058 100644 --- a/test/Api.Test/SecretsManager/Controllers/AccessPoliciesControllerTests.cs +++ b/test/Api.Test/SecretsManager/Controllers/AccessPoliciesControllerTests.cs @@ -2,6 +2,8 @@ using Bit.Api.SecretsManager.Controllers; using Bit.Api.SecretsManager.Models.Request; using Bit.Api.Test.SecretsManager.Enums; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Context; using Bit.Core.Entities; using Bit.Core.Enums; diff --git a/test/Api.Test/SecretsManager/Controllers/ServiceAccountsControllerTests.cs b/test/Api.Test/SecretsManager/Controllers/ServiceAccountsControllerTests.cs index 29dcd117c12a..370619d590f2 100644 --- a/test/Api.Test/SecretsManager/Controllers/ServiceAccountsControllerTests.cs +++ b/test/Api.Test/SecretsManager/Controllers/ServiceAccountsControllerTests.cs @@ -1,6 +1,8 @@ using System.Security.Claims; using Bit.Api.SecretsManager.Controllers; using Bit.Api.SecretsManager.Models.Request; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Context; using Bit.Core.Entities; using Bit.Core.Enums; diff --git a/test/Api.Test/Vault/Controllers/SyncControllerTests.cs b/test/Api.Test/Vault/Controllers/SyncControllerTests.cs index 0034120b19b1..3cf47eefef6e 100644 --- a/test/Api.Test/Vault/Controllers/SyncControllerTests.cs +++ b/test/Api.Test/Vault/Controllers/SyncControllerTests.cs @@ -3,12 +3,16 @@ using AutoFixture; using Bit.Api.Vault.Controllers; using Bit.Api.Vault.Models.Response; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Enums.Provider; +using Bit.Core.AdminConsole.Models.Data.Organizations.OrganizationUsers; +using Bit.Core.AdminConsole.Models.Data.Provider; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Entities; using Bit.Core.Enums; -using Bit.Core.Enums.Provider; using Bit.Core.Exceptions; using Bit.Core.Models.Data; -using Bit.Core.Models.Data.Organizations.OrganizationUsers; using Bit.Core.Repositories; using Bit.Core.Services; using Bit.Core.Tools.Entities; diff --git a/test/Billing.Test/Controllers/FreshdeskControllerTests.cs b/test/Billing.Test/Controllers/FreshdeskControllerTests.cs index 97c7434ea627..ba251ce151ac 100644 --- a/test/Billing.Test/Controllers/FreshdeskControllerTests.cs +++ b/test/Billing.Test/Controllers/FreshdeskControllerTests.cs @@ -1,5 +1,7 @@ using Bit.Billing.Controllers; using Bit.Billing.Models; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Entities; using Bit.Core.Repositories; using Bit.Test.Common.AutoFixture; diff --git a/test/Billing.Test/Controllers/FreshsalesControllerTests.cs b/test/Billing.Test/Controllers/FreshsalesControllerTests.cs index 3a5cf3bf179e..4a9ef1dd1d1d 100644 --- a/test/Billing.Test/Controllers/FreshsalesControllerTests.cs +++ b/test/Billing.Test/Controllers/FreshsalesControllerTests.cs @@ -1,4 +1,6 @@ using Bit.Billing.Controllers; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Entities; using Bit.Core.Repositories; using Bit.Core.Settings; diff --git a/test/Core.Test/AdminConsole/OrganizationAuth/UpdateOrganizationAuthRequestCommandTests.cs b/test/Core.Test/AdminConsole/OrganizationAuth/UpdateOrganizationAuthRequestCommandTests.cs index ac37158c547d..fed0def34d2c 100644 --- a/test/Core.Test/AdminConsole/OrganizationAuth/UpdateOrganizationAuthRequestCommandTests.cs +++ b/test/Core.Test/AdminConsole/OrganizationAuth/UpdateOrganizationAuthRequestCommandTests.cs @@ -1,4 +1,4 @@ -using Bit.Core.AdminConsole.OrganizationAuth; +using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationAuth; using Bit.Core.Auth.Entities; using Bit.Core.Auth.Models.Api.Request.AuthRequest; using Bit.Core.Auth.Services; diff --git a/test/Core.Test/Auth/Models/Business/Tokenables/SsoTokenableTests.cs b/test/Core.Test/Auth/Models/Business/Tokenables/SsoTokenableTests.cs index 3cc85b97e04e..fec679fe3b0c 100644 --- a/test/Core.Test/Auth/Models/Business/Tokenables/SsoTokenableTests.cs +++ b/test/Core.Test/Auth/Models/Business/Tokenables/SsoTokenableTests.cs @@ -1,4 +1,5 @@ using AutoFixture.Xunit2; +using Bit.Core.AdminConsole.Entities; using Bit.Core.Auth.Models.Business.Tokenables; using Bit.Core.Entities; using Bit.Core.Tokens; diff --git a/test/Core.Test/Auth/Services/AuthRequestServiceTests.cs b/test/Core.Test/Auth/Services/AuthRequestServiceTests.cs index cd7f85ae8b10..0e7ea7c6d6cf 100644 --- a/test/Core.Test/Auth/Services/AuthRequestServiceTests.cs +++ b/test/Core.Test/Auth/Services/AuthRequestServiceTests.cs @@ -1,4 +1,6 @@ -using Bit.Core.Auth.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.Auth.Entities; using Bit.Core.Auth.Enums; using Bit.Core.Auth.Exceptions; using Bit.Core.Auth.Models.Api.Request.AuthRequest; diff --git a/test/Core.Test/Auth/Services/SsoConfigServiceTests.cs b/test/Core.Test/Auth/Services/SsoConfigServiceTests.cs index 7886d6f9e817..de6e72ed861d 100644 --- a/test/Core.Test/Auth/Services/SsoConfigServiceTests.cs +++ b/test/Core.Test/Auth/Services/SsoConfigServiceTests.cs @@ -1,12 +1,16 @@ -using Bit.Core.Auth.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Models.Data.Organizations.OrganizationUsers; +using Bit.Core.AdminConsole.Models.Data.Organizations.Policies; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; +using Bit.Core.Auth.Entities; using Bit.Core.Auth.Enums; using Bit.Core.Auth.Models.Data; using Bit.Core.Auth.Repositories; using Bit.Core.Auth.Services; using Bit.Core.Entities; using Bit.Core.Exceptions; -using Bit.Core.Models.Data.Organizations.OrganizationUsers; -using Bit.Core.Models.Data.Organizations.Policies; using Bit.Core.Repositories; using Bit.Core.Services; using Bit.Test.Common.AutoFixture; @@ -205,7 +209,7 @@ public async Task SaveAsync_KeyConnector_SsoPolicyNotEnabled_Throws(SutProvider< }; sutProvider.GetDependency().GetByOrganizationIdTypeAsync( - Arg.Any(), Enums.PolicyType.SingleOrg).Returns(new Policy + Arg.Any(), PolicyType.SingleOrg).Returns(new Policy { Enabled = true }); @@ -239,7 +243,7 @@ public async Task SaveAsync_KeyConnector_SsoConfigNotEnabled_Throws(SutProvider< }; sutProvider.GetDependency().GetByOrganizationIdTypeAsync( - Arg.Any(), Arg.Any()).Returns(new Policy + Arg.Any(), Arg.Any()).Returns(new Policy { Enabled = true }); @@ -274,7 +278,7 @@ public async Task SaveAsync_KeyConnector_KeyConnectorAbilityNotEnabled_Throws(Su }; sutProvider.GetDependency().GetByOrganizationIdTypeAsync( - Arg.Any(), Arg.Any()).Returns(new Policy + Arg.Any(), Arg.Any()).Returns(new Policy { Enabled = true, }); @@ -309,7 +313,7 @@ public async Task SaveAsync_KeyConnector_Success(SutProvider s }; sutProvider.GetDependency().GetByOrganizationIdTypeAsync( - Arg.Any(), Arg.Any()).Returns(new Policy + Arg.Any(), Arg.Any()).Returns(new Policy { Enabled = true, }); @@ -338,7 +342,7 @@ public async Task SaveAsync_Tde_Enable_Required_Policies(SutProvider().Received(1) .SaveAsync( - Arg.Is(t => t.Type == Enums.PolicyType.SingleOrg), + Arg.Is(t => t.Type == PolicyType.SingleOrg), Arg.Any(), Arg.Any(), null @@ -346,7 +350,7 @@ await sutProvider.GetDependency().Received(1) await sutProvider.GetDependency().Received(1) .SaveAsync( - Arg.Is(t => t.Type == Enums.PolicyType.ResetPassword && t.GetDataModel().AutoEnrollEnabled), + Arg.Is(t => t.Type == PolicyType.ResetPassword && t.GetDataModel().AutoEnrollEnabled), Arg.Any(), Arg.Any(), null diff --git a/test/Core.Test/AutoFixture/CurrentContextFixtures.cs b/test/Core.Test/AutoFixture/CurrentContextFixtures.cs index a7b2f6d55beb..f9dd87141999 100644 --- a/test/Core.Test/AutoFixture/CurrentContextFixtures.cs +++ b/test/Core.Test/AutoFixture/CurrentContextFixtures.cs @@ -1,5 +1,6 @@ using AutoFixture; using AutoFixture.Kernel; +using Bit.Core.AdminConsole.Context; using Bit.Core.Context; using Bit.Test.Common.AutoFixture; using Bit.Test.Common.AutoFixture.Attributes; diff --git a/test/Core.Test/AutoFixture/OrganizationFixtures.cs b/test/Core.Test/AutoFixture/OrganizationFixtures.cs index e4e75ed0eefe..f1867b0300c6 100644 --- a/test/Core.Test/AutoFixture/OrganizationFixtures.cs +++ b/test/Core.Test/AutoFixture/OrganizationFixtures.cs @@ -1,6 +1,9 @@ using System.Text.Json; using AutoFixture; using AutoFixture.Kernel; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Models.Business; using Bit.Core.Auth.Enums; using Bit.Core.Auth.Models; using Bit.Core.Entities; diff --git a/test/Core.Test/AutoFixture/OrganizationUserFixtures.cs b/test/Core.Test/AutoFixture/OrganizationUserFixtures.cs index 74bdbfc519df..053f7d78430b 100644 --- a/test/Core.Test/AutoFixture/OrganizationUserFixtures.cs +++ b/test/Core.Test/AutoFixture/OrganizationUserFixtures.cs @@ -1,6 +1,8 @@ using System.Reflection; using AutoFixture; using AutoFixture.Xunit2; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; using Bit.Core.Entities; using Bit.Core.Enums; diff --git a/test/Core.Test/AutoFixture/PolicyFixtures.cs b/test/Core.Test/AutoFixture/PolicyFixtures.cs index fb8109baf9a3..0c0264e4ea6d 100644 --- a/test/Core.Test/AutoFixture/PolicyFixtures.cs +++ b/test/Core.Test/AutoFixture/PolicyFixtures.cs @@ -1,6 +1,8 @@ using System.Reflection; using AutoFixture; using AutoFixture.Xunit2; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; using Bit.Core.Entities; using Bit.Core.Enums; diff --git a/test/Core.Test/Entities/OrganizationTests.cs b/test/Core.Test/Entities/OrganizationTests.cs index 996dde458834..7d5b05654d26 100644 --- a/test/Core.Test/Entities/OrganizationTests.cs +++ b/test/Core.Test/Entities/OrganizationTests.cs @@ -1,4 +1,5 @@ using System.Text.Json; +using Bit.Core.AdminConsole.Entities; using Bit.Core.Auth.Enums; using Bit.Core.Auth.Models; using Bit.Core.Entities; diff --git a/test/Core.Test/Models/Business/SecretsManagerSubscriptionUpdateTests.cs b/test/Core.Test/Models/Business/SecretsManagerSubscriptionUpdateTests.cs index 0adef6b473ca..0d8fa4e08fd2 100644 --- a/test/Core.Test/Models/Business/SecretsManagerSubscriptionUpdateTests.cs +++ b/test/Core.Test/Models/Business/SecretsManagerSubscriptionUpdateTests.cs @@ -1,4 +1,5 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Exceptions; using Bit.Core.Models.Business; diff --git a/test/Core.Test/Models/Data/SelfHostedOrganizationDetailsTests.cs b/test/Core.Test/Models/Data/SelfHostedOrganizationDetailsTests.cs index a46981ee9b3c..7c88e05d1aed 100644 --- a/test/Core.Test/Models/Data/SelfHostedOrganizationDetailsTests.cs +++ b/test/Core.Test/Models/Data/SelfHostedOrganizationDetailsTests.cs @@ -1,4 +1,7 @@ -using Bit.Core.AdminConsole.Models.OrganizationConnectionConfigs; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Models.Data.Organizations; +using Bit.Core.AdminConsole.Models.OrganizationConnectionConfigs; using Bit.Core.Auth.Entities; using Bit.Core.Auth.Enums; using Bit.Core.Auth.Models.Data; diff --git a/test/Core.Test/OrganizationFeatures/Groups/CreateGroupCommandTests.cs b/test/Core.Test/OrganizationFeatures/Groups/CreateGroupCommandTests.cs index 92011e49f23a..16f293ca7a78 100644 --- a/test/Core.Test/OrganizationFeatures/Groups/CreateGroupCommandTests.cs +++ b/test/Core.Test/OrganizationFeatures/Groups/CreateGroupCommandTests.cs @@ -1,8 +1,10 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.OrganizationFeatures.Groups; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Exceptions; using Bit.Core.Models.Data; -using Bit.Core.OrganizationFeatures.Groups; using Bit.Core.Repositories; using Bit.Core.Services; using Bit.Core.Test.AutoFixture.OrganizationFixtures; diff --git a/test/Core.Test/OrganizationFeatures/Groups/DeleteGroupCommandTests.cs b/test/Core.Test/OrganizationFeatures/Groups/DeleteGroupCommandTests.cs index 27b070d2133e..02efc6a07ae0 100644 --- a/test/Core.Test/OrganizationFeatures/Groups/DeleteGroupCommandTests.cs +++ b/test/Core.Test/OrganizationFeatures/Groups/DeleteGroupCommandTests.cs @@ -1,7 +1,9 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.OrganizationFeatures.Groups; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Exceptions; -using Bit.Core.OrganizationFeatures.Groups; using Bit.Core.Repositories; using Bit.Core.Services; using Bit.Core.Test.AutoFixture.OrganizationFixtures; @@ -42,7 +44,7 @@ public async Task DeleteGroup_MismatchingOrganizationId_Throws(SutProvider() .GetByIdAsync(groupId) - .Returns(new Core.Entities.Group + .Returns(new Group { Id = groupId, OrganizationId = Guid.NewGuid() diff --git a/test/Core.Test/OrganizationFeatures/Groups/UpdateGroupCommandTests.cs b/test/Core.Test/OrganizationFeatures/Groups/UpdateGroupCommandTests.cs index dde281b785c6..2e42df42c4cd 100644 --- a/test/Core.Test/OrganizationFeatures/Groups/UpdateGroupCommandTests.cs +++ b/test/Core.Test/OrganizationFeatures/Groups/UpdateGroupCommandTests.cs @@ -1,8 +1,10 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.OrganizationFeatures.Groups; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Exceptions; using Bit.Core.Models.Data; -using Bit.Core.OrganizationFeatures.Groups; using Bit.Core.Repositories; using Bit.Core.Services; using Bit.Core.Test.AutoFixture.OrganizationFixtures; diff --git a/test/Core.Test/OrganizationFeatures/OrganizationApiKeys/CreateOrganizationApiKeyCommandTest.cs b/test/Core.Test/OrganizationFeatures/OrganizationApiKeys/CreateOrganizationApiKeyCommandTest.cs index 6b7fb3151a35..3465fda1ad84 100644 --- a/test/Core.Test/OrganizationFeatures/OrganizationApiKeys/CreateOrganizationApiKeyCommandTest.cs +++ b/test/Core.Test/OrganizationFeatures/OrganizationApiKeys/CreateOrganizationApiKeyCommandTest.cs @@ -1,6 +1,9 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationApiKeys; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.Entities; using Bit.Core.Enums; -using Bit.Core.OrganizationFeatures.OrganizationApiKeys; using Bit.Core.Repositories; using Bit.Test.Common.AutoFixture; using Bit.Test.Common.AutoFixture.Attributes; diff --git a/test/Core.Test/OrganizationFeatures/OrganizationApiKeys/GetOrganizationApiKeyQueryTests.cs b/test/Core.Test/OrganizationFeatures/OrganizationApiKeys/GetOrganizationApiKeyQueryTests.cs index d374bf806849..ca2b0a3a6c0b 100644 --- a/test/Core.Test/OrganizationFeatures/OrganizationApiKeys/GetOrganizationApiKeyQueryTests.cs +++ b/test/Core.Test/OrganizationFeatures/OrganizationApiKeys/GetOrganizationApiKeyQueryTests.cs @@ -1,6 +1,9 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationApiKeys; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.Entities; using Bit.Core.Enums; -using Bit.Core.OrganizationFeatures.OrganizationApiKeys; using Bit.Core.Repositories; using Bit.Test.Common.AutoFixture; using Bit.Test.Common.AutoFixture.Attributes; diff --git a/test/Core.Test/OrganizationFeatures/OrganizationApiKeys/RotateOrganizationApiKeyCommandTests.cs b/test/Core.Test/OrganizationFeatures/OrganizationApiKeys/RotateOrganizationApiKeyCommandTests.cs index dc2ec10c2dbe..71e4e9fafc34 100644 --- a/test/Core.Test/OrganizationFeatures/OrganizationApiKeys/RotateOrganizationApiKeyCommandTests.cs +++ b/test/Core.Test/OrganizationFeatures/OrganizationApiKeys/RotateOrganizationApiKeyCommandTests.cs @@ -1,5 +1,6 @@ -using Bit.Core.Entities; -using Bit.Core.OrganizationFeatures.OrganizationApiKeys; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationApiKeys; +using Bit.Core.Entities; using Bit.Test.Common.AutoFixture; using Bit.Test.Common.AutoFixture.Attributes; using Bit.Test.Common.Helpers; diff --git a/test/Core.Test/OrganizationFeatures/OrganizationConnections/ValidateBillingSyncKeyCommandTests.cs b/test/Core.Test/OrganizationFeatures/OrganizationConnections/ValidateBillingSyncKeyCommandTests.cs index 349f0316d784..72e9632cf9ee 100644 --- a/test/Core.Test/OrganizationFeatures/OrganizationConnections/ValidateBillingSyncKeyCommandTests.cs +++ b/test/Core.Test/OrganizationFeatures/OrganizationConnections/ValidateBillingSyncKeyCommandTests.cs @@ -1,4 +1,7 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Exceptions; using Bit.Core.OrganizationFeatures.OrganizationConnections; diff --git a/test/Core.Test/OrganizationFeatures/OrganizationLicenses/CloudGetOrganizationLicenseQueryTests.cs b/test/Core.Test/OrganizationFeatures/OrganizationLicenses/CloudGetOrganizationLicenseQueryTests.cs index cb896ed7178a..00a4b12b2e95 100644 --- a/test/Core.Test/OrganizationFeatures/OrganizationLicenses/CloudGetOrganizationLicenseQueryTests.cs +++ b/test/Core.Test/OrganizationFeatures/OrganizationLicenses/CloudGetOrganizationLicenseQueryTests.cs @@ -1,4 +1,5 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Exceptions; using Bit.Core.Models.Business; diff --git a/test/Core.Test/OrganizationFeatures/OrganizationLicenses/SelfHostedGetOrganizationLicenseQueryTests.cs b/test/Core.Test/OrganizationFeatures/OrganizationLicenses/SelfHostedGetOrganizationLicenseQueryTests.cs index df4a93305caf..f57fc8c3496a 100644 --- a/test/Core.Test/OrganizationFeatures/OrganizationLicenses/SelfHostedGetOrganizationLicenseQueryTests.cs +++ b/test/Core.Test/OrganizationFeatures/OrganizationLicenses/SelfHostedGetOrganizationLicenseQueryTests.cs @@ -1,4 +1,5 @@ using System.Text.Json; +using Bit.Core.AdminConsole.Entities; using Bit.Core.Entities; using Bit.Core.Exceptions; using Bit.Core.Models.Business; diff --git a/test/Core.Test/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/CancelSponsorshipCommandTestsBase.cs b/test/Core.Test/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/CancelSponsorshipCommandTestsBase.cs index ca684a30ce48..9e7266adf5f4 100644 --- a/test/Core.Test/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/CancelSponsorshipCommandTestsBase.cs +++ b/test/Core.Test/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/CancelSponsorshipCommandTestsBase.cs @@ -1,4 +1,6 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.Entities; using Bit.Core.Repositories; using Bit.Core.Services; using Bit.Test.Common.AutoFixture; diff --git a/test/Core.Test/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Cloud/CloudSyncSponsorshipsCommandTests.cs b/test/Core.Test/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Cloud/CloudSyncSponsorshipsCommandTests.cs index f7534d8a73b7..9743bdccf287 100644 --- a/test/Core.Test/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Cloud/CloudSyncSponsorshipsCommandTests.cs +++ b/test/Core.Test/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Cloud/CloudSyncSponsorshipsCommandTests.cs @@ -1,4 +1,5 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Exceptions; using Bit.Core.Models.Data.Organizations.OrganizationSponsorships; diff --git a/test/Core.Test/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Cloud/SendSponsorshipOfferCommandTests.cs b/test/Core.Test/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Cloud/SendSponsorshipOfferCommandTests.cs index f4f8a2cf4aba..617687339146 100644 --- a/test/Core.Test/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Cloud/SendSponsorshipOfferCommandTests.cs +++ b/test/Core.Test/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Cloud/SendSponsorshipOfferCommandTests.cs @@ -1,4 +1,6 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Exceptions; using Bit.Core.OrganizationFeatures.OrganizationSponsorships.FamiliesForEnterprise.Cloud; diff --git a/test/Core.Test/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Cloud/SetUpSponsorshipCommandTests.cs b/test/Core.Test/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Cloud/SetUpSponsorshipCommandTests.cs index 07920d2c8861..10a72c401bcf 100644 --- a/test/Core.Test/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Cloud/SetUpSponsorshipCommandTests.cs +++ b/test/Core.Test/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Cloud/SetUpSponsorshipCommandTests.cs @@ -1,4 +1,6 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Exceptions; using Bit.Core.OrganizationFeatures.OrganizationSponsorships.FamiliesForEnterprise.Cloud; diff --git a/test/Core.Test/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Cloud/ValidateSponsorshipCommandTests.cs b/test/Core.Test/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Cloud/ValidateSponsorshipCommandTests.cs index a187f5b2968d..645b154fe812 100644 --- a/test/Core.Test/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Cloud/ValidateSponsorshipCommandTests.cs +++ b/test/Core.Test/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Cloud/ValidateSponsorshipCommandTests.cs @@ -1,4 +1,6 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.OrganizationFeatures.OrganizationSponsorships.FamiliesForEnterprise.Cloud; using Bit.Core.Repositories; diff --git a/test/Core.Test/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/CreateSponsorshipCommandTests.cs b/test/Core.Test/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/CreateSponsorshipCommandTests.cs index 4eb2779d9227..1243e0de93ba 100644 --- a/test/Core.Test/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/CreateSponsorshipCommandTests.cs +++ b/test/Core.Test/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/CreateSponsorshipCommandTests.cs @@ -1,4 +1,6 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Exceptions; using Bit.Core.OrganizationFeatures.OrganizationSponsorships.FamiliesForEnterprise; diff --git a/test/Core.Test/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/FamiliesForEnterpriseTestsBase.cs b/test/Core.Test/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/FamiliesForEnterpriseTestsBase.cs index e49b095d76fa..751f0f7a1caf 100644 --- a/test/Core.Test/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/FamiliesForEnterpriseTestsBase.cs +++ b/test/Core.Test/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/FamiliesForEnterpriseTestsBase.cs @@ -1,4 +1,5 @@ -using Bit.Core.Enums; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.Enums; using Bit.Core.Utilities; namespace Bit.Core.Test.OrganizationFeatures.OrganizationSponsorships.FamiliesForEnterprise; diff --git a/test/Core.Test/OrganizationFeatures/OrganizationSubscriptionUpdate/AddSecretsManagerSubscriptionCommandTests.cs b/test/Core.Test/OrganizationFeatures/OrganizationSubscriptionUpdate/AddSecretsManagerSubscriptionCommandTests.cs index 810561c4b53d..35ea281d25e2 100644 --- a/test/Core.Test/OrganizationFeatures/OrganizationSubscriptionUpdate/AddSecretsManagerSubscriptionCommandTests.cs +++ b/test/Core.Test/OrganizationFeatures/OrganizationSubscriptionUpdate/AddSecretsManagerSubscriptionCommandTests.cs @@ -1,7 +1,11 @@ -using Bit.Core.Entities; -using Bit.Core.Entities.Provider; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Entities.Provider; +using Bit.Core.AdminConsole.Enums.Provider; +using Bit.Core.AdminConsole.Models.Business; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; +using Bit.Core.Entities; using Bit.Core.Enums; -using Bit.Core.Enums.Provider; using Bit.Core.Exceptions; using Bit.Core.Models.Business; using Bit.Core.Models.StaticStore; diff --git a/test/Core.Test/OrganizationFeatures/OrganizationSubscriptionUpdate/UpdateSecretsManagerSubscriptionCommandTests.cs b/test/Core.Test/OrganizationFeatures/OrganizationSubscriptionUpdate/UpdateSecretsManagerSubscriptionCommandTests.cs index e64cbe304fd8..3b04a0bc8a53 100644 --- a/test/Core.Test/OrganizationFeatures/OrganizationSubscriptionUpdate/UpdateSecretsManagerSubscriptionCommandTests.cs +++ b/test/Core.Test/OrganizationFeatures/OrganizationSubscriptionUpdate/UpdateSecretsManagerSubscriptionCommandTests.cs @@ -1,4 +1,7 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; +using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Exceptions; using Bit.Core.Models.Business; diff --git a/test/Core.Test/OrganizationFeatures/OrganizationSubscriptionUpdate/UpgradeOrganizationPlanCommandTests.cs b/test/Core.Test/OrganizationFeatures/OrganizationSubscriptionUpdate/UpgradeOrganizationPlanCommandTests.cs index f79001639e74..0d43a3623d64 100644 --- a/test/Core.Test/OrganizationFeatures/OrganizationSubscriptionUpdate/UpgradeOrganizationPlanCommandTests.cs +++ b/test/Core.Test/OrganizationFeatures/OrganizationSubscriptionUpdate/UpgradeOrganizationPlanCommandTests.cs @@ -1,4 +1,7 @@ -using Bit.Core.Enums; +using Bit.Core.AdminConsole.Models.Business; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; +using Bit.Core.Enums; using Bit.Core.Exceptions; using Bit.Core.Models.Business; using Bit.Core.OrganizationFeatures.OrganizationSubscriptions; @@ -11,7 +14,7 @@ using Bit.Test.Common.AutoFixture.Attributes; using NSubstitute; using Xunit; -using Organization = Bit.Core.Entities.Organization; +using Organization = Bit.Core.AdminConsole.Entities.Organization; namespace Bit.Core.Test.OrganizationFeatures.OrganizationSubscriptionUpdate; diff --git a/test/Core.Test/OrganizationFeatures/OrganizationUsers/CountNewSmSeatsRequiredQueryTests.cs b/test/Core.Test/OrganizationFeatures/OrganizationUsers/CountNewSmSeatsRequiredQueryTests.cs index 375fcc66a289..6ce6c25b4c5e 100644 --- a/test/Core.Test/OrganizationFeatures/OrganizationUsers/CountNewSmSeatsRequiredQueryTests.cs +++ b/test/Core.Test/OrganizationFeatures/OrganizationUsers/CountNewSmSeatsRequiredQueryTests.cs @@ -1,6 +1,8 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationUsers; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.Entities; using Bit.Core.Exceptions; -using Bit.Core.OrganizationFeatures.OrganizationUsers; using Bit.Core.Repositories; using Bit.Test.Common.AutoFixture; using Bit.Test.Common.AutoFixture.Attributes; diff --git a/test/Core.Test/OrganizationFeatures/OrganizationUsers/DeleteOrganizationUserCommandTests.cs b/test/Core.Test/OrganizationFeatures/OrganizationUsers/DeleteOrganizationUserCommandTests.cs index b28ea914dfbe..4951d8df212f 100644 --- a/test/Core.Test/OrganizationFeatures/OrganizationUsers/DeleteOrganizationUserCommandTests.cs +++ b/test/Core.Test/OrganizationFeatures/OrganizationUsers/DeleteOrganizationUserCommandTests.cs @@ -1,7 +1,10 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationUsers; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; +using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Exceptions; -using Bit.Core.OrganizationFeatures.OrganizationUsers; using Bit.Core.Repositories; using Bit.Core.Services; using Bit.Test.Common.AutoFixture; diff --git a/test/Core.Test/OrganizationFeatures/OrganizationUsers/UpdateOrganizationUserGroupsCommandTests.cs b/test/Core.Test/OrganizationFeatures/OrganizationUsers/UpdateOrganizationUserGroupsCommandTests.cs index 542220560ca6..9112cc8c765c 100644 --- a/test/Core.Test/OrganizationFeatures/OrganizationUsers/UpdateOrganizationUserGroupsCommandTests.cs +++ b/test/Core.Test/OrganizationFeatures/OrganizationUsers/UpdateOrganizationUserGroupsCommandTests.cs @@ -1,6 +1,9 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationUsers; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; +using Bit.Core.Entities; using Bit.Core.Enums; -using Bit.Core.OrganizationFeatures.OrganizationUsers; using Bit.Core.Repositories; using Bit.Core.Services; using Bit.Test.Common.AutoFixture; diff --git a/test/Core.Test/Services/CollectionServiceTests.cs b/test/Core.Test/Services/CollectionServiceTests.cs index d5b5f15ccdd9..73fb91ae9de9 100644 --- a/test/Core.Test/Services/CollectionServiceTests.cs +++ b/test/Core.Test/Services/CollectionServiceTests.cs @@ -1,4 +1,7 @@ -using Bit.Core.Context; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.Context; using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Exceptions; diff --git a/test/Core.Test/Services/EventServiceTests.cs b/test/Core.Test/Services/EventServiceTests.cs index 2cda759b150f..ad043c07c6c2 100644 --- a/test/Core.Test/Services/EventServiceTests.cs +++ b/test/Core.Test/Services/EventServiceTests.cs @@ -1,6 +1,10 @@ -using Bit.Core.Context; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Entities.Provider; +using Bit.Core.AdminConsole.Models.Data.Organizations; +using Bit.Core.AdminConsole.Models.Data.Provider; +using Bit.Core.AdminConsole.Services; +using Bit.Core.Context; using Bit.Core.Entities; -using Bit.Core.Entities.Provider; using Bit.Core.Enums; using Bit.Core.Models.Data; using Bit.Core.Models.Data.Organizations; diff --git a/test/Core.Test/Services/GroupServiceTests.cs b/test/Core.Test/Services/GroupServiceTests.cs index e904ea7a75f8..4c3f6b164921 100644 --- a/test/Core.Test/Services/GroupServiceTests.cs +++ b/test/Core.Test/Services/GroupServiceTests.cs @@ -1,4 +1,7 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services.Implementations; +using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Exceptions; using Bit.Core.Repositories; diff --git a/test/Core.Test/Services/HandlebarsMailServiceTests.cs b/test/Core.Test/Services/HandlebarsMailServiceTests.cs index a29e884367f9..89d9a211e091 100644 --- a/test/Core.Test/Services/HandlebarsMailServiceTests.cs +++ b/test/Core.Test/Services/HandlebarsMailServiceTests.cs @@ -1,8 +1,9 @@ using System.Reflection; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Entities.Provider; using Bit.Core.Auth.Entities; using Bit.Core.Auth.Models.Business; using Bit.Core.Entities; -using Bit.Core.Entities.Provider; using Bit.Core.Services; using Bit.Core.Settings; using Microsoft.Extensions.Logging; diff --git a/test/Core.Test/Services/InMemoryApplicationCacheServiceTests.cs b/test/Core.Test/Services/InMemoryApplicationCacheServiceTests.cs index ff8e734b3224..d5fc8fddb647 100644 --- a/test/Core.Test/Services/InMemoryApplicationCacheServiceTests.cs +++ b/test/Core.Test/Services/InMemoryApplicationCacheServiceTests.cs @@ -1,4 +1,6 @@ -using Bit.Core.Repositories; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services.Implementations; +using Bit.Core.Repositories; using Bit.Core.Services; using NSubstitute; using Xunit; diff --git a/test/Core.Test/Services/InMemoryServiceBusApplicationCacheServiceTests.cs b/test/Core.Test/Services/InMemoryServiceBusApplicationCacheServiceTests.cs index f74aa6f505c4..c2baaf799001 100644 --- a/test/Core.Test/Services/InMemoryServiceBusApplicationCacheServiceTests.cs +++ b/test/Core.Test/Services/InMemoryServiceBusApplicationCacheServiceTests.cs @@ -1,4 +1,6 @@ -using Bit.Core.Repositories; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services.Implementations; +using Bit.Core.Repositories; using Bit.Core.Services; using Bit.Core.Settings; using NSubstitute; diff --git a/test/Core.Test/Services/LicensingServiceTests.cs b/test/Core.Test/Services/LicensingServiceTests.cs index 4a8ba0255feb..c5fe655fa06f 100644 --- a/test/Core.Test/Services/LicensingServiceTests.cs +++ b/test/Core.Test/Services/LicensingServiceTests.cs @@ -1,5 +1,6 @@ using System.Text.Json; using AutoFixture; +using Bit.Core.AdminConsole.Entities; using Bit.Core.Entities; using Bit.Core.Models.Business; using Bit.Core.Services; diff --git a/test/Core.Test/Services/OrganizationServiceTests.cs b/test/Core.Test/Services/OrganizationServiceTests.cs index 2354d16bf931..7930548c1804 100644 --- a/test/Core.Test/Services/OrganizationServiceTests.cs +++ b/test/Core.Test/Services/OrganizationServiceTests.cs @@ -1,4 +1,13 @@ using System.Text.Json; +using Bit.Core.AdminConsole.Entities.Provider; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Enums.Provider; +using Bit.Core.AdminConsole.Models.Business; +using Bit.Core.AdminConsole.Models.Data.Organizations.OrganizationUsers; +using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationUsers.Interfaces; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; +using Bit.Core.AdminConsole.Services.Implementations; using Bit.Core.Auth.Entities; using Bit.Core.Auth.Enums; using Bit.Core.Auth.Models.Business; @@ -6,16 +15,12 @@ using Bit.Core.Auth.Repositories; using Bit.Core.Context; using Bit.Core.Entities; -using Bit.Core.Entities.Provider; using Bit.Core.Enums; -using Bit.Core.Enums.Provider; using Bit.Core.Exceptions; using Bit.Core.Models.Business; using Bit.Core.Models.Data; -using Bit.Core.Models.Data.Organizations.OrganizationUsers; using Bit.Core.Models.StaticStore; using Bit.Core.OrganizationFeatures.OrganizationSubscriptions.Interface; -using Bit.Core.OrganizationFeatures.OrganizationUsers.Interfaces; using Bit.Core.Repositories; using Bit.Core.Services; using Bit.Core.Settings; @@ -32,9 +37,9 @@ using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; -using Organization = Bit.Core.Entities.Organization; -using OrganizationUser = Bit.Core.Entities.OrganizationUser; -using Policy = Bit.Core.Entities.Policy; +using Organization = Bit.Core.AdminConsole.Entities.Organization; +using OrganizationUser = Bit.Core.AdminConsole.Entities.OrganizationUser; +using Policy = Bit.Core.AdminConsole.Entities.Policy; namespace Bit.Core.Test.Services; diff --git a/test/Core.Test/Services/PolicyServiceTests.cs b/test/Core.Test/Services/PolicyServiceTests.cs index aedc3cc587e7..68f28e9018b8 100644 --- a/test/Core.Test/Services/PolicyServiceTests.cs +++ b/test/Core.Test/Services/PolicyServiceTests.cs @@ -1,12 +1,17 @@ -using Bit.Core.Auth.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Models.Data.Organizations.OrganizationUsers; +using Bit.Core.AdminConsole.Models.Data.Organizations.Policies; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; +using Bit.Core.AdminConsole.Services.Implementations; +using Bit.Core.Auth.Entities; using Bit.Core.Auth.Enums; using Bit.Core.Auth.Models.Data; using Bit.Core.Auth.Repositories; using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Exceptions; -using Bit.Core.Models.Data.Organizations.OrganizationUsers; -using Bit.Core.Models.Data.Organizations.Policies; using Bit.Core.Repositories; using Bit.Core.Services; using Bit.Test.Common.AutoFixture; @@ -106,7 +111,7 @@ await sutProvider.GetDependency() } [Theory, BitAutoData] - public async Task SaveAsync_SingleOrg_VaultTimeoutEnabled_ThrowsBadRequest([PolicyFixtures.Policy(Enums.PolicyType.SingleOrg)] Policy policy, SutProvider sutProvider) + public async Task SaveAsync_SingleOrg_VaultTimeoutEnabled_ThrowsBadRequest([PolicyFixtures.Policy(PolicyType.SingleOrg)] Policy policy, SutProvider sutProvider) { policy.Enabled = false; @@ -117,7 +122,7 @@ public async Task SaveAsync_SingleOrg_VaultTimeoutEnabled_ThrowsBadRequest([Poli }); sutProvider.GetDependency() - .GetByOrganizationIdTypeAsync(policy.OrganizationId, Enums.PolicyType.MaximumVaultTimeout) + .GetByOrganizationIdTypeAsync(policy.OrganizationId, PolicyType.MaximumVaultTimeout) .Returns(new Policy { Enabled = true }); var badRequestException = await Assert.ThrowsAsync( @@ -137,7 +142,7 @@ await sutProvider.GetDependency() [BitAutoData(PolicyType.SingleOrg)] [BitAutoData(PolicyType.RequireSso)] public async Task SaveAsync_PolicyRequiredByKeyConnector_DisablePolicy_ThrowsBadRequest( - Enums.PolicyType policyType, + PolicyType policyType, Policy policy, SutProvider sutProvider) { @@ -173,7 +178,7 @@ await sutProvider.GetDependency() [Theory, BitAutoData] public async Task SaveAsync_RequireSsoPolicy_NotEnabled_ThrowsBadRequestAsync( - [PolicyFixtures.Policy(Enums.PolicyType.RequireSso)] Policy policy, SutProvider sutProvider) + [PolicyFixtures.Policy(PolicyType.RequireSso)] Policy policy, SutProvider sutProvider) { policy.Enabled = true; @@ -218,7 +223,7 @@ public async Task SaveAsync_NewPolicy_Created( }); sutProvider.GetDependency() - .GetByOrganizationIdTypeAsync(policy.OrganizationId, Enums.PolicyType.SingleOrg) + .GetByOrganizationIdTypeAsync(policy.OrganizationId, PolicyType.SingleOrg) .Returns(Task.FromResult(new Policy { Enabled = true })); var utcNow = DateTime.UtcNow; @@ -248,7 +253,7 @@ public async Task SaveAsync_VaultTimeoutPolicy_NotEnabled_ThrowsBadRequestAsync( }); sutProvider.GetDependency() - .GetByOrganizationIdTypeAsync(policy.OrganizationId, Enums.PolicyType.SingleOrg) + .GetByOrganizationIdTypeAsync(policy.OrganizationId, PolicyType.SingleOrg) .Returns(Task.FromResult(new Policy { Enabled = false })); var badRequestException = await Assert.ThrowsAsync( @@ -292,7 +297,7 @@ public async Task SaveAsync_ExistingPolicy_UpdateTwoFactor( Enabled = false, }); - var orgUserDetail = new Core.Models.Data.Organizations.OrganizationUsers.OrganizationUserUserDetails + var orgUserDetail = new OrganizationUserUserDetails { Id = Guid.NewGuid(), Status = OrganizationUserStatusType.Accepted, @@ -305,7 +310,7 @@ public async Task SaveAsync_ExistingPolicy_UpdateTwoFactor( sutProvider.GetDependency() .GetManyDetailsByOrganizationAsync(policy.OrganizationId) - .Returns(new List + .Returns(new List { orgUserDetail, }); @@ -362,7 +367,7 @@ public async Task SaveAsync_ExistingPolicy_UpdateSingleOrg( Enabled = false, }); - var orgUserDetail = new Core.Models.Data.Organizations.OrganizationUsers.OrganizationUserUserDetails + var orgUserDetail = new OrganizationUserUserDetails { Id = Guid.NewGuid(), Status = OrganizationUserStatusType.Accepted, @@ -375,7 +380,7 @@ public async Task SaveAsync_ExistingPolicy_UpdateSingleOrg( sutProvider.GetDependency() .GetManyDetailsByOrganizationAsync(policy.OrganizationId) - .Returns(new List + .Returns(new List { orgUserDetail, }); @@ -487,7 +492,7 @@ await sutProvider.GetDependency() [Theory, BitAutoData] public async Task SaveAsync_PolicyRequiredForAccountRecovery_NotEnabled_ThrowsBadRequestAsync( - [PolicyFixtures.Policy(Enums.PolicyType.ResetPassword)] Policy policy, SutProvider sutProvider) + [PolicyFixtures.Policy(PolicyType.ResetPassword)] Policy policy, SutProvider sutProvider) { policy.Enabled = true; policy.SetDataModel(new ResetPasswordDataModel()); @@ -522,7 +527,7 @@ await sutProvider.GetDependency() [Theory, BitAutoData] public async Task SaveAsync_SingleOrg_AccountRecoveryEnabled_ThrowsBadRequest( - [PolicyFixtures.Policy(Enums.PolicyType.SingleOrg)] Policy policy, SutProvider sutProvider) + [PolicyFixtures.Policy(PolicyType.SingleOrg)] Policy policy, SutProvider sutProvider) { policy.Enabled = false; @@ -533,7 +538,7 @@ public async Task SaveAsync_SingleOrg_AccountRecoveryEnabled_ThrowsBadRequest( }); sutProvider.GetDependency() - .GetByOrganizationIdTypeAsync(policy.OrganizationId, Enums.PolicyType.ResetPassword) + .GetByOrganizationIdTypeAsync(policy.OrganizationId, PolicyType.ResetPassword) .Returns(new Policy { Enabled = true }); var badRequestException = await Assert.ThrowsAsync( diff --git a/test/Core.Test/Services/StripePaymentServiceTests.cs b/test/Core.Test/Services/StripePaymentServiceTests.cs index 2133a14a9735..0d95623471f6 100644 --- a/test/Core.Test/Services/StripePaymentServiceTests.cs +++ b/test/Core.Test/Services/StripePaymentServiceTests.cs @@ -1,4 +1,6 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Models.Business; +using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Exceptions; using Bit.Core.Models.Business; diff --git a/test/Core.Test/Services/UserServiceTests.cs b/test/Core.Test/Services/UserServiceTests.cs index 92de67a4e62e..a74d57b4ff4d 100644 --- a/test/Core.Test/Services/UserServiceTests.cs +++ b/test/Core.Test/Services/UserServiceTests.cs @@ -1,4 +1,8 @@ using System.Text.Json; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Models.Data.Organizations; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; using Bit.Core.Auth.Enums; using Bit.Core.Auth.Models; using Bit.Core.Context; diff --git a/test/Core.Test/Tools/Services/SendServiceTests.cs b/test/Core.Test/Tools/Services/SendServiceTests.cs index 6b59429cd8cc..130085425a5a 100644 --- a/test/Core.Test/Tools/Services/SendServiceTests.cs +++ b/test/Core.Test/Tools/Services/SendServiceTests.cs @@ -1,10 +1,14 @@ using System.Text; using System.Text.Json; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Models.Data.Organizations.OrganizationUsers; +using Bit.Core.AdminConsole.Models.Data.Organizations.Policies; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Exceptions; -using Bit.Core.Models.Data.Organizations.OrganizationUsers; -using Bit.Core.Models.Data.Organizations.Policies; using Bit.Core.Repositories; using Bit.Core.Services; using Bit.Core.Test.AutoFixture.CurrentContextFixtures; diff --git a/test/Core.Test/Utilities/CoreHelpersTests.cs b/test/Core.Test/Utilities/CoreHelpersTests.cs index 4def69404259..3c0629249b12 100644 --- a/test/Core.Test/Utilities/CoreHelpersTests.cs +++ b/test/Core.Test/Utilities/CoreHelpersTests.cs @@ -1,9 +1,11 @@ using System.Text; using AutoFixture; +using Bit.Core.AdminConsole.Context; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Enums.Provider; using Bit.Core.Context; using Bit.Core.Entities; using Bit.Core.Enums; -using Bit.Core.Enums.Provider; using Bit.Core.Test.AutoFixture.UserFixtures; using Bit.Core.Utilities; using Bit.Test.Common.AutoFixture; diff --git a/test/Core.Test/Vault/Services/CipherServiceTests.cs b/test/Core.Test/Vault/Services/CipherServiceTests.cs index ea3309fc69d9..2705670356ed 100644 --- a/test/Core.Test/Vault/Services/CipherServiceTests.cs +++ b/test/Core.Test/Vault/Services/CipherServiceTests.cs @@ -1,4 +1,6 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Exceptions; using Bit.Core.Repositories; diff --git a/test/Identity.IntegrationTest/Endpoints/IdentityServerSsoTests.cs b/test/Identity.IntegrationTest/Endpoints/IdentityServerSsoTests.cs index 8e9e82c6b754..b5f4d7477778 100644 --- a/test/Identity.IntegrationTest/Endpoints/IdentityServerSsoTests.cs +++ b/test/Identity.IntegrationTest/Endpoints/IdentityServerSsoTests.cs @@ -1,6 +1,9 @@ using System.Security.Claims; using System.Text.Json; using Bit.Core; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Auth.Entities; using Bit.Core.Auth.Enums; using Bit.Core.Auth.Models.Api.Request.Accounts; diff --git a/test/Identity.IntegrationTest/Endpoints/IdentityServerTests.cs b/test/Identity.IntegrationTest/Endpoints/IdentityServerTests.cs index cae6ed172c36..c5395686746f 100644 --- a/test/Identity.IntegrationTest/Endpoints/IdentityServerTests.cs +++ b/test/Identity.IntegrationTest/Endpoints/IdentityServerTests.cs @@ -1,4 +1,7 @@ using System.Text.Json; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Auth.Models.Api.Request.Accounts; using Bit.Core.Enums; using Bit.Core.Repositories; @@ -328,7 +331,7 @@ await _factory.RegisterAsync(new RegisterRequestModel } [Theory, BitAutoData] - public async Task TokenEndpoint_GrantTypeClientCredentials_AsOrganization_Success(Bit.Core.Entities.Organization organization, Bit.Core.Entities.OrganizationApiKey organizationApiKey) + public async Task TokenEndpoint_GrantTypeClientCredentials_AsOrganization_Success(Organization organization, OrganizationApiKey organizationApiKey) { var orgRepo = _factory.Services.GetRequiredService(); organization.Enabled = true; @@ -556,11 +559,11 @@ private async Task CreateOrganizationWithSsoPolicyAsync(Guid organizationId, str var organizationUserRepository = _factory.Services.GetService(); var policyRepository = _factory.Services.GetService(); - var organization = new Bit.Core.Entities.Organization { Id = organizationId, Enabled = true, UseSso = ssoPolicyEnabled, UsePolicies = true }; + var organization = new Organization { Id = organizationId, Enabled = true, UseSso = ssoPolicyEnabled, UsePolicies = true }; await organizationRepository.CreateAsync(organization); var user = await userRepository.GetByEmailAsync(username); - var organizationUser = new Bit.Core.Entities.OrganizationUser + var organizationUser = new OrganizationUser { OrganizationId = organization.Id, UserId = user.Id, @@ -569,7 +572,7 @@ private async Task CreateOrganizationWithSsoPolicyAsync(Guid organizationId, str }; await organizationUserRepository.CreateAsync(organizationUser); - var ssoPolicy = new Bit.Core.Entities.Policy { OrganizationId = organization.Id, Type = PolicyType.RequireSso, Enabled = ssoPolicyEnabled }; + var ssoPolicy = new Policy { OrganizationId = organization.Id, Type = PolicyType.RequireSso, Enabled = ssoPolicyEnabled }; await policyRepository.CreateAsync(ssoPolicy); } diff --git a/test/Infrastructure.EFIntegration.Test/Auth/Repositories/AuthRequestRepositoryTests.cs b/test/Infrastructure.EFIntegration.Test/Auth/Repositories/AuthRequestRepositoryTests.cs index 18c3cd2ef516..64025b106802 100644 --- a/test/Infrastructure.EFIntegration.Test/Auth/Repositories/AuthRequestRepositoryTests.cs +++ b/test/Infrastructure.EFIntegration.Test/Auth/Repositories/AuthRequestRepositoryTests.cs @@ -1,4 +1,5 @@ -using Bit.Core.Auth.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Auth.Entities; using Bit.Core.Entities; using Bit.Core.Test.AutoFixture.Attributes; using Bit.Infrastructure.EFIntegration.Test.Auth.AutoFixture; diff --git a/test/Infrastructure.EFIntegration.Test/Auth/Repositories/SsoConfigRepositoryTests.cs b/test/Infrastructure.EFIntegration.Test/Auth/Repositories/SsoConfigRepositoryTests.cs index f1eafba977b3..589f1127f9e3 100644 --- a/test/Infrastructure.EFIntegration.Test/Auth/Repositories/SsoConfigRepositoryTests.cs +++ b/test/Infrastructure.EFIntegration.Test/Auth/Repositories/SsoConfigRepositoryTests.cs @@ -1,4 +1,5 @@ -using Bit.Core.Auth.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Auth.Entities; using Bit.Core.Entities; using Bit.Core.Test.AutoFixture.Attributes; using Bit.Infrastructure.EFIntegration.Test.Auth.AutoFixture; diff --git a/test/Infrastructure.EFIntegration.Test/Auth/Repositories/SsoUserRepositoryTests.cs b/test/Infrastructure.EFIntegration.Test/Auth/Repositories/SsoUserRepositoryTests.cs index 7e6a7173f1f1..b8d00d07440b 100644 --- a/test/Infrastructure.EFIntegration.Test/Auth/Repositories/SsoUserRepositoryTests.cs +++ b/test/Infrastructure.EFIntegration.Test/Auth/Repositories/SsoUserRepositoryTests.cs @@ -1,4 +1,5 @@ -using Bit.Core.Auth.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Auth.Entities; using Bit.Core.Entities; using Bit.Core.Test.AutoFixture.Attributes; using Bit.Infrastructure.EFIntegration.Test.Auth.AutoFixture; diff --git a/test/Infrastructure.EFIntegration.Test/AutoFixture/GroupFixtures.cs b/test/Infrastructure.EFIntegration.Test/AutoFixture/GroupFixtures.cs index c6cca49015b5..18ca93a5d9ce 100644 --- a/test/Infrastructure.EFIntegration.Test/AutoFixture/GroupFixtures.cs +++ b/test/Infrastructure.EFIntegration.Test/AutoFixture/GroupFixtures.cs @@ -1,5 +1,6 @@ using AutoFixture; using AutoFixture.Kernel; +using Bit.Core.AdminConsole.Entities; using Bit.Core.Entities; using Bit.Infrastructure.EFIntegration.Test.AutoFixture.Relays; using Bit.Infrastructure.EntityFramework.Repositories; diff --git a/test/Infrastructure.EFIntegration.Test/AutoFixture/GroupUserFixtures.cs b/test/Infrastructure.EFIntegration.Test/AutoFixture/GroupUserFixtures.cs index 2b68cde32269..5a2d21f477dd 100644 --- a/test/Infrastructure.EFIntegration.Test/AutoFixture/GroupUserFixtures.cs +++ b/test/Infrastructure.EFIntegration.Test/AutoFixture/GroupUserFixtures.cs @@ -1,5 +1,6 @@ using AutoFixture; using AutoFixture.Kernel; +using Bit.Core.AdminConsole.Entities; using Bit.Core.Entities; using Bit.Infrastructure.EntityFramework.Repositories; using Bit.Test.Common.AutoFixture; diff --git a/test/Infrastructure.EFIntegration.Test/AutoFixture/OrganizationFixtures.cs b/test/Infrastructure.EFIntegration.Test/AutoFixture/OrganizationFixtures.cs index 894609944296..cdc5a250b7a0 100644 --- a/test/Infrastructure.EFIntegration.Test/AutoFixture/OrganizationFixtures.cs +++ b/test/Infrastructure.EFIntegration.Test/AutoFixture/OrganizationFixtures.cs @@ -1,5 +1,6 @@ using AutoFixture; using AutoFixture.Kernel; +using Bit.Core.AdminConsole.Entities; using Bit.Core.Auth.Enums; using Bit.Core.Auth.Models; using Bit.Core.Entities; diff --git a/test/Infrastructure.EFIntegration.Test/AutoFixture/OrganizationUserFixtures.cs b/test/Infrastructure.EFIntegration.Test/AutoFixture/OrganizationUserFixtures.cs index 191b48852bce..bc03e5e2bf05 100644 --- a/test/Infrastructure.EFIntegration.Test/AutoFixture/OrganizationUserFixtures.cs +++ b/test/Infrastructure.EFIntegration.Test/AutoFixture/OrganizationUserFixtures.cs @@ -1,6 +1,7 @@ using System.Text.Json; using AutoFixture; using AutoFixture.Kernel; +using Bit.Core.AdminConsole.Entities; using Bit.Core.Auth.Enums; using Bit.Core.Auth.Models; using Bit.Core.Entities; diff --git a/test/Infrastructure.EFIntegration.Test/AutoFixture/PolicyFixtures.cs b/test/Infrastructure.EFIntegration.Test/AutoFixture/PolicyFixtures.cs index 70cea3e01189..276f6c82e442 100644 --- a/test/Infrastructure.EFIntegration.Test/AutoFixture/PolicyFixtures.cs +++ b/test/Infrastructure.EFIntegration.Test/AutoFixture/PolicyFixtures.cs @@ -1,5 +1,6 @@ using AutoFixture; using AutoFixture.Kernel; +using Bit.Core.AdminConsole.Entities; using Bit.Core.Entities; using Bit.Infrastructure.EntityFramework.Repositories; using Bit.Test.Common.AutoFixture; diff --git a/test/Infrastructure.EFIntegration.Test/Repositories/CollectionRepository.cs b/test/Infrastructure.EFIntegration.Test/Repositories/CollectionRepository.cs index eb3b269467dd..f8eee19f2b47 100644 --- a/test/Infrastructure.EFIntegration.Test/Repositories/CollectionRepository.cs +++ b/test/Infrastructure.EFIntegration.Test/Repositories/CollectionRepository.cs @@ -1,4 +1,5 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Entities; using Bit.Core.Test.AutoFixture.Attributes; using Bit.Infrastructure.EFIntegration.Test.AutoFixture; using Bit.Infrastructure.EFIntegration.Test.Repositories.EqualityComparers; diff --git a/test/Infrastructure.EFIntegration.Test/Repositories/EqualityComparers/GroupCompare.cs b/test/Infrastructure.EFIntegration.Test/Repositories/EqualityComparers/GroupCompare.cs index dcb0be2ff1b4..d0ebf0fc9a49 100644 --- a/test/Infrastructure.EFIntegration.Test/Repositories/EqualityComparers/GroupCompare.cs +++ b/test/Infrastructure.EFIntegration.Test/Repositories/EqualityComparers/GroupCompare.cs @@ -1,4 +1,5 @@ using System.Diagnostics.CodeAnalysis; +using Bit.Core.AdminConsole.Entities; using Bit.Core.Entities; namespace Bit.Infrastructure.EFIntegration.Test.Repositories.EqualityComparers; diff --git a/test/Infrastructure.EFIntegration.Test/Repositories/EqualityComparers/OrganizationCompare.cs b/test/Infrastructure.EFIntegration.Test/Repositories/EqualityComparers/OrganizationCompare.cs index b2abe5fde1f6..b35f46b66ddb 100644 --- a/test/Infrastructure.EFIntegration.Test/Repositories/EqualityComparers/OrganizationCompare.cs +++ b/test/Infrastructure.EFIntegration.Test/Repositories/EqualityComparers/OrganizationCompare.cs @@ -1,4 +1,5 @@ using System.Diagnostics.CodeAnalysis; +using Bit.Core.AdminConsole.Entities; using Bit.Core.Entities; namespace Bit.Infrastructure.EFIntegration.Test.Repositories.EqualityComparers; diff --git a/test/Infrastructure.EFIntegration.Test/Repositories/EqualityComparers/OrganizationUserCompare.cs b/test/Infrastructure.EFIntegration.Test/Repositories/EqualityComparers/OrganizationUserCompare.cs index 6d947cc6c7e6..460bc3e43846 100644 --- a/test/Infrastructure.EFIntegration.Test/Repositories/EqualityComparers/OrganizationUserCompare.cs +++ b/test/Infrastructure.EFIntegration.Test/Repositories/EqualityComparers/OrganizationUserCompare.cs @@ -1,4 +1,5 @@ using System.Diagnostics.CodeAnalysis; +using Bit.Core.AdminConsole.Entities; using Bit.Core.Entities; namespace Bit.Infrastructure.EFIntegration.Test.Repositories.EqualityComparers; diff --git a/test/Infrastructure.EFIntegration.Test/Repositories/EqualityComparers/OrganizationUserPolicyDetailsCompare.cs b/test/Infrastructure.EFIntegration.Test/Repositories/EqualityComparers/OrganizationUserPolicyDetailsCompare.cs index 3524f893e077..8cbda32dfcdd 100644 --- a/test/Infrastructure.EFIntegration.Test/Repositories/EqualityComparers/OrganizationUserPolicyDetailsCompare.cs +++ b/test/Infrastructure.EFIntegration.Test/Repositories/EqualityComparers/OrganizationUserPolicyDetailsCompare.cs @@ -1,4 +1,4 @@ -using Bit.Core.Models.Data.Organizations.OrganizationUsers; +using Bit.Core.AdminConsole.Models.Data.Organizations.OrganizationUsers; namespace Bit.Infrastructure.EFIntegration.Test.Repositories.EqualityComparers; diff --git a/test/Infrastructure.EFIntegration.Test/Repositories/EqualityComparers/PolicyCompare.cs b/test/Infrastructure.EFIntegration.Test/Repositories/EqualityComparers/PolicyCompare.cs index f3bd7dc7a929..08a9b8ddafb4 100644 --- a/test/Infrastructure.EFIntegration.Test/Repositories/EqualityComparers/PolicyCompare.cs +++ b/test/Infrastructure.EFIntegration.Test/Repositories/EqualityComparers/PolicyCompare.cs @@ -1,4 +1,5 @@ using System.Diagnostics.CodeAnalysis; +using Bit.Core.AdminConsole.Entities; using Bit.Core.Entities; namespace Bit.Infrastructure.EFIntegration.Test.Repositories.EqualityComparers; diff --git a/test/Infrastructure.EFIntegration.Test/Repositories/OrganizationRepositoryTests.cs b/test/Infrastructure.EFIntegration.Test/Repositories/OrganizationRepositoryTests.cs index 40732709b4a7..191db1168c19 100644 --- a/test/Infrastructure.EFIntegration.Test/Repositories/OrganizationRepositoryTests.cs +++ b/test/Infrastructure.EFIntegration.Test/Repositories/OrganizationRepositoryTests.cs @@ -1,4 +1,7 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Models.Data.Organizations; +using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Models.Data.Organizations; using Bit.Core.Test.AutoFixture.Attributes; @@ -6,7 +9,7 @@ using Bit.Infrastructure.EFIntegration.Test.Repositories.EqualityComparers; using Xunit; using EfRepo = Bit.Infrastructure.EntityFramework.Repositories; -using Organization = Bit.Core.Entities.Organization; +using Organization = Bit.Core.AdminConsole.Entities.Organization; using SqlRepo = Bit.Infrastructure.Dapper.Repositories; namespace Bit.Infrastructure.EFIntegration.Test.Repositories; diff --git a/test/Infrastructure.EFIntegration.Test/Repositories/OrganizationSponsorshipRepositoryTests.cs b/test/Infrastructure.EFIntegration.Test/Repositories/OrganizationSponsorshipRepositoryTests.cs index ee7d0d271c76..b7179ec5a76c 100644 --- a/test/Infrastructure.EFIntegration.Test/Repositories/OrganizationSponsorshipRepositoryTests.cs +++ b/test/Infrastructure.EFIntegration.Test/Repositories/OrganizationSponsorshipRepositoryTests.cs @@ -1,4 +1,5 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Entities; using Bit.Core.Test.AutoFixture.Attributes; using Bit.Infrastructure.EFIntegration.Test.AutoFixture; using Bit.Infrastructure.EFIntegration.Test.Repositories.EqualityComparers; diff --git a/test/Infrastructure.EFIntegration.Test/Repositories/OrganizationUserRepositoryTests.cs b/test/Infrastructure.EFIntegration.Test/Repositories/OrganizationUserRepositoryTests.cs index 4f3b912b6ec0..bb5161a5c9c6 100644 --- a/test/Infrastructure.EFIntegration.Test/Repositories/OrganizationUserRepositoryTests.cs +++ b/test/Infrastructure.EFIntegration.Test/Repositories/OrganizationUserRepositoryTests.cs @@ -1,16 +1,19 @@ using System.Text.Json; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Entities.Provider; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Models.Data.Organizations.OrganizationUsers; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Entities; -using Bit.Core.Entities.Provider; using Bit.Core.Enums; using Bit.Core.Models.Data; -using Bit.Core.Models.Data.Organizations.OrganizationUsers; using Bit.Core.Repositories; using Bit.Core.Test.AutoFixture.Attributes; using Bit.Infrastructure.EFIntegration.Test.AutoFixture; using Bit.Infrastructure.EFIntegration.Test.Repositories.EqualityComparers; using Xunit; using EfRepo = Bit.Infrastructure.EntityFramework.Repositories; -using OrganizationUser = Bit.Core.Entities.OrganizationUser; +using OrganizationUser = Bit.Core.AdminConsole.Entities.OrganizationUser; using SqlRepo = Bit.Infrastructure.Dapper.Repositories; namespace Bit.Infrastructure.EFIntegration.Test.Repositories; diff --git a/test/Infrastructure.EFIntegration.Test/Repositories/PolicyRepositoryTests.cs b/test/Infrastructure.EFIntegration.Test/Repositories/PolicyRepositoryTests.cs index db05c52a3211..bba8843cacb8 100644 --- a/test/Infrastructure.EFIntegration.Test/Repositories/PolicyRepositoryTests.cs +++ b/test/Infrastructure.EFIntegration.Test/Repositories/PolicyRepositoryTests.cs @@ -1,10 +1,11 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Entities; using Bit.Core.Test.AutoFixture.Attributes; using Bit.Infrastructure.EFIntegration.Test.AutoFixture; using Bit.Infrastructure.EFIntegration.Test.Repositories.EqualityComparers; using Xunit; using EfRepo = Bit.Infrastructure.EntityFramework.Repositories; -using Policy = Bit.Core.Entities.Policy; +using Policy = Bit.Core.AdminConsole.Entities.Policy; using SqlRepo = Bit.Infrastructure.Dapper.Repositories; namespace Bit.Infrastructure.EFIntegration.Test.Repositories; diff --git a/test/Infrastructure.EFIntegration.Test/Repositories/TransactionRepositoryTests.cs b/test/Infrastructure.EFIntegration.Test/Repositories/TransactionRepositoryTests.cs index 2f0d2cd8aa73..e43ff98cbfc4 100644 --- a/test/Infrastructure.EFIntegration.Test/Repositories/TransactionRepositoryTests.cs +++ b/test/Infrastructure.EFIntegration.Test/Repositories/TransactionRepositoryTests.cs @@ -1,4 +1,5 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Entities; using Bit.Core.Test.AutoFixture.Attributes; using Bit.Infrastructure.EFIntegration.Test.AutoFixture; using Bit.Infrastructure.EFIntegration.Test.Repositories.EqualityComparers; diff --git a/test/Infrastructure.EFIntegration.Test/Repositories/UserRepositoryTests.cs b/test/Infrastructure.EFIntegration.Test/Repositories/UserRepositoryTests.cs index e888826ded41..a7d97d1c75fe 100644 --- a/test/Infrastructure.EFIntegration.Test/Repositories/UserRepositoryTests.cs +++ b/test/Infrastructure.EFIntegration.Test/Repositories/UserRepositoryTests.cs @@ -1,4 +1,5 @@ -using Bit.Core.Auth.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Auth.Entities; using Bit.Core.Entities; using Bit.Core.Models.Data; using Bit.Core.Test.AutoFixture.Attributes; diff --git a/test/Infrastructure.EFIntegration.Test/Tools/Repositories/SendRepositoryTests.cs b/test/Infrastructure.EFIntegration.Test/Tools/Repositories/SendRepositoryTests.cs index c9e276d45cd7..a14892b9b690 100644 --- a/test/Infrastructure.EFIntegration.Test/Tools/Repositories/SendRepositoryTests.cs +++ b/test/Infrastructure.EFIntegration.Test/Tools/Repositories/SendRepositoryTests.cs @@ -1,4 +1,5 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Entities; using Bit.Core.Test.AutoFixture.Attributes; using Bit.Core.Tools.Entities; using Bit.Infrastructure.EFIntegration.Test.Tools.AutoFixture; diff --git a/test/Infrastructure.EFIntegration.Test/Vault/Repositories/CipherRepositoryTests.cs b/test/Infrastructure.EFIntegration.Test/Vault/Repositories/CipherRepositoryTests.cs index 8af82bdd811b..2197df1cdb08 100644 --- a/test/Infrastructure.EFIntegration.Test/Vault/Repositories/CipherRepositoryTests.cs +++ b/test/Infrastructure.EFIntegration.Test/Vault/Repositories/CipherRepositoryTests.cs @@ -1,4 +1,5 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.Entities; using Bit.Core.Models.Data; using Bit.Core.Test.AutoFixture.Attributes; using Bit.Core.Vault.Entities; diff --git a/test/Infrastructure.IntegrationTest/Repositories/OrganizationUserRepositoryTests.cs b/test/Infrastructure.IntegrationTest/Repositories/OrganizationUserRepositoryTests.cs index e07b3ba72069..c35f4fa8aa25 100644 --- a/test/Infrastructure.IntegrationTest/Repositories/OrganizationUserRepositoryTests.cs +++ b/test/Infrastructure.IntegrationTest/Repositories/OrganizationUserRepositoryTests.cs @@ -1,4 +1,7 @@ -using Bit.Core.Entities; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Repositories; using Xunit; diff --git a/test/Infrastructure.IntegrationTest/Vault/Repositories/CipherRepositoryTests.cs b/test/Infrastructure.IntegrationTest/Vault/Repositories/CipherRepositoryTests.cs index 1712313d3765..9969f3288436 100644 --- a/test/Infrastructure.IntegrationTest/Vault/Repositories/CipherRepositoryTests.cs +++ b/test/Infrastructure.IntegrationTest/Vault/Repositories/CipherRepositoryTests.cs @@ -1,4 +1,7 @@ using System.Text.Json; +using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Enums; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Models.Data;