* Return Policy object instead of NotFoundException
* Add unit tests, change orgId type to Guid
* Fix test cases, throw exception when manage not allowed
* Add check for managed user before purging account
* Rename IOrganizationRepository.GetByClaimedUserDomainAsync to GetByVerifiedUserEmailDomainAsync and refactor to return a list. Remove ManagedByOrganizationId from ProfileResponseMode. Add ManagesActiveUser to ProfileOrganizationResponseModel
* Rename the property ManagesActiveUser to UserIsManagedByOrganization
* Remove whole class #nullable enable and add it to specific places
* [PM-11405] Account Deprovisioning: Prevent a verified user from changing their email address
* Remove unnecessary .ToList()
* Refactor IUserService methods GetOrganizationsManagingUserAsync and IsManagedByAnyOrganizationAsync to not return nullable objects. Update ProfileOrganizationResponseModel.UserIsManagedByOrganization to not be nullable
* Update error message when unable to purge vault for managed account
* Update error message when unable to change email for managed account
* Update expected error messages on unit tests
* Add TestFeatureService to Api.IntegrationTest.Helpers and use it on ApiApplicationFactory to be able to enable specific features for each test
* Add CreateVerifiedDomainAsync method to OrganizationTestHelpers
* Add tests to AccountsControllerTest to prevent changing email for managed accounts
* Remove setting the feature flag value in ApiApplicationFactory and set it on AccountsControllerTest
* Remove TestFeatureService class from Api.IntegrationTest.Helpers
* Refactor OrganizationUsersController.Get to include organization management status of organization users in details endpoint
* Refactor OrganizationUsersController.Get to include organization management status of an individual user in details endpoint
* Remove redundant .ToDictionary()
* Simpify the property xmldoc
* Name tuple variables in OrganizationUsersController.Get
* Name returned tuple objects in GetDetailsByIdWithCollectionsAsync method in OrganizationUserRepository
* Refactor MembersController.Get to destructure tuple returned by GetDetailsByIdWithCollectionsAsync
* Add test for OrganizationUsersController.Get to assert ManagedByOrganization is set accordingly
* Allow for binning of comb IDs by date and value
* Introduce notification hub pool
* Replace device type sharding with comb + range sharding
* Fix proxy interface
* Use enumerable services for multiServiceNotificationHub
* Fix push interface usage
* Fix push notification service dependencies
* Fix push notification keys
* Fixup documentation
* Remove deprecated settings
* Fix tests
* PascalCase method names
* Remove unused request model properties
* Remove unused setting
* Improve DateFromComb precision
* Prefer readonly service enumerable
* Pascal case template holes
* Name TryParse methods TryParse
* Apply suggestions from code review
Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
* AllClients is a set of clients and must be deduplicated
* Fix registration start time
* Add logging to initialization of a notification hub
* more logging
* Add lower level logging for hub settings
* Log when connection is resolved
* Improve log message
* Log pushes to notification hub
* temporarily elevate log messages for visibility
* Log in multi-service when relaying to another push service
* Revert to more reasonable logging free of user information
* Fixup merge
Deleting user was extracted to a command in #4803, this updates that work to use just the device ids as I did elsewhere in abd67e8ec
* Do not use bouncy castle exception types
* Add required services for logging
---------
Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
Co-authored-by: bnagawiecki <107435978+bnagawiecki@users.noreply.github.com>
* Add check for managed user before purging account
* Rename IOrganizationRepository.GetByClaimedUserDomainAsync to GetByVerifiedUserEmailDomainAsync and refactor to return a list. Remove ManagedByOrganizationId from ProfileResponseMode. Add ManagesActiveUser to ProfileOrganizationResponseModel
* Rename the property ManagesActiveUser to UserIsManagedByOrganization
* Remove whole class #nullable enable and add it to specific places
* Remove unnecessary .ToList()
* Refactor IUserService methods GetOrganizationsManagingUserAsync and IsManagedByAnyOrganizationAsync to not return nullable objects. Update ProfileOrganizationResponseModel.UserIsManagedByOrganization to not be nullable
* Update error message when unable to purge vault for managed account
* Add HasConfirmedOwnersExceptQuery class, interface and unit tests
* Register IHasConfirmedOwnersExceptQuery for dependency injection
* Replace OrganizationService.HasConfirmedOwnersExceptAsync with HasConfirmedOwnersExceptQuery
* Refactor DeleteManagedOrganizationUserAccountCommand to use IHasConfirmedOwnersExceptQuery
* Fix unit tests
* Extract IOrganizationService.RemoveUserAsync into IRemoveOrganizationUserCommand; Update unit tests
* Extract IOrganizationService.RemoveUsersAsync into IRemoveOrganizationUserCommand; Update unit tests
* Refactor RemoveUserAsync(Guid organizationId, Guid userId) to use ValidateDeleteUser
* Refactor RemoveOrganizationUserCommandTests to use more descriptive method names
* Refactor controller actions to accept Guid directly instead of parsing strings
* Add unit tests for removing OrganizationUser by UserId
* Refactor remove OrganizationUser by UserId method
* Add summary to IHasConfirmedOwnersExceptQuery
* Added /domain/sso/verified to organization controller
* Restricting sproc to only return verified domains if the org has sso. Adding name. corrected route. removed not found exception. Adding the sproc definition to the SQL project
* Move existing Billing SQL files into dbo folder
I noticed that every other team had a nested dbo folder under their team folder while Billing did not. This change replicates that.
* Add SQL files for ClientOrganizationMigrationRecord table
* Add SQL Server migration for ClientOrganizationMigrationRecord table
* Add ClientOrganizationMigrationRecord entity and repository interface
* Add ClientOrganizationMigrationRecord Dapper repository
* Add ClientOrganizationMigrationRecord EF repository
* Add EF migrations for ClientOrganizationMigrationRecord table
* Implement migration process
* Wire up new Admin tool to migrate providers
* Run dotnet format
* Updated coupon and credit application per product request
* AC-3057-3058: Fix expiration date and enabled from webhook processing
* Run dotnet format
* AC-3059: Fix assigned seats during migration
* Updated AllocatedSeats in the case plan already exists
* Update migration scripts to reflect current date
* PM-11123: Notification Status Details view
* PM-11123: Test Typo
* PM-11123: New line missing
* PM-11123: Delete unnecessary field
* PM-11123: Moved NotificationStatusDetails to Models/Data
* Add new columns to `dbo.Organization` & its references
* Feed existing data into new `dbo.Organization` column
* Update Entity Framework database definitions
* Move new EF columns out of the core entity definition
* Generate Entity Framework migrations
* Feed existing data into new `Organization` Entity Framework columns
* Add a where clause to SQL migration
* PM-11123: Service layer
* PM-11123: Service layer for Notification Center
* PM-11123: Throw error on unsupported requirement
* PM-11123: Missing await
* PM-11123: Cleanup
* PM-11123: Unit Test coverage
* PM-11123: Flipping the authorization logic to be exact match of fail, formatting
* PM-11123: Async warning
* PM-11123: Using AuthorizeOrThrowAsync, removal of redundant set new id
* PM-11123: UT typo
* PM-11123: UT fix
* Add HasVerifiedDomainsAsync method to IOrganizationDomainService
* Add GetManagedUserIdsByOrganizationIdAsync method to IOrganizationUserRepository and the corresponding queries
* Fix case on the sproc OrganizationUser_ReadManagedIdsByOrganizationId parameter
* Update the EF query to use the Email from the User table
* dotnet format
* Fix IOrganizationDomainService.HasVerifiedDomainsAsync by checking that domains have been Verified and add unit tests
* Rename IOrganizationUserRepository.GetManagedUserIdsByOrganizationAsync
* Fix domain queries
* Add OrganizationUserRepository integration tests
* Add summary to IOrganizationDomainService.HasVerifiedDomainsAsync
* chore: Rename IOrganizationUserRepository.GetManagedUserIdsByOrganizationAsync to GetManyIdsManagedByOrganizationIdAsync
* Add IsManagedByAnyOrganizationAsync method to IUserRepository
* Add integration tests for UserRepository.IsManagedByAnyOrganizationAsync
* Refactor to IUserService.IsManagedByAnyOrganizationAsync and IOrganizationService.GetUsersOrganizationManagementStatusAsync
* chore: Refactor IsManagedByAnyOrganizationAsync method in UserService
* Refactor IOrganizationService.GetUsersOrganizationManagementStatusAsync to return IDictionary<Guid, bool>
* Extract IOrganizationService.GetUsersOrganizationManagementStatusAsync into a query
* Update comments in OrganizationDomainService to use proper capitalization
* Move OrganizationDomainService to AdminConsole ownership and update namespace
* feat: Add support for organization domains in enterprise plans
* feat: Add HasOrganizationDomains property to OrganizationAbility class
* refactor: Update GetOrganizationUsersManagementStatusQuery to use IApplicationCacheService
* Remove HasOrganizationDomains and use UseSso to check if Organization can have Verified Domains
* Refactor UserService.IsManagedByAnyOrganizationAsync to simply check the UseSso flag
* Add new event types for organization user deletion and voluntary departure
* Add DeleteManagedOrganizationUserAccountCommand to remove user and delete account
* Refactor DeleteManagedOrganizationUserAccountCommand to use orgUser.Id instead of orgUser.UserId.Value
* Add DeleteManagedOrganizationUserAccountCommandTests
* Add an endpoint to the OrganizationUsersController to delete a user account managed by an organization
* Add unit tests for OrganizationUsersController.DeleteAccount
* Add an endpoint to the OrganizationUsersController to bulk delete user accounts managed by an organization
* Add unit tests for OrganizationUsersController.BulkDeleteAccount
* Gate new endpoints behind feature flag
* Remove duplicate migration
* Remove unnecessary _userService.GetProperUserId
* Add PremiumUserSale
* Add PremiumUserBillingService
* Integrate into UserService behind FF
* Update invoice.created handler to bill newly created PayPal customers
* Run dotnet format
* Add OrganizationUserMiniDetails endpoint, models and authorization
* Restrict access to current OrganizationUserUserDetails endpoint
Both are behind feature flags
* check to see if the org allows access to collections/ciphers to owners for events
* linter
* add check for organization value before attempting to use it
* refactor logic to check for org abilities
* remove checks for organization abilities
- The previous logic would block events from being collected when a cipher was unassigned
* check for organization when recording an event from owner/admin
* Refactor UserService to add GetOrganizationManagingUserAsync method to retrive the organization that manages a user
* Refactor SyncController and AccountsController to include ManagedByOrganizationId in profile response
* Add HasVerifiedDomainsAsync method to IOrganizationDomainService
* Add GetManagedUserIdsByOrganizationIdAsync method to IOrganizationUserRepository and the corresponding queries
* Fix case on the sproc OrganizationUser_ReadManagedIdsByOrganizationId parameter
* Update the EF query to use the Email from the User table
* dotnet format
* Fix IOrganizationDomainService.HasVerifiedDomainsAsync by checking that domains have been Verified and add unit tests
* Rename IOrganizationUserRepository.GetManagedUserIdsByOrganizationAsync
* Fix domain queries
* Add OrganizationUserRepository integration tests
* Add summary to IOrganizationDomainService.HasVerifiedDomainsAsync
* chore: Rename IOrganizationUserRepository.GetManagedUserIdsByOrganizationAsync to GetManyIdsManagedByOrganizationIdAsync
* Add IsManagedByAnyOrganizationAsync method to IUserRepository
* Add integration tests for UserRepository.IsManagedByAnyOrganizationAsync
* Refactor to IUserService.IsManagedByAnyOrganizationAsync and IOrganizationService.GetUsersOrganizationManagementStatusAsync
* chore: Refactor IsManagedByAnyOrganizationAsync method in UserService
* Refactor IOrganizationService.GetUsersOrganizationManagementStatusAsync to return IDictionary<Guid, bool>
* Extract IOrganizationService.GetUsersOrganizationManagementStatusAsync into a query
* Update comments in OrganizationDomainService to use proper capitalization
* Move OrganizationDomainService to AdminConsole ownership and update namespace
* feat: Add support for organization domains in enterprise plans
* feat: Add HasOrganizationDomains property to OrganizationAbility class
* refactor: Update GetOrganizationUsersManagementStatusQuery to use IApplicationCacheService
* Remove HasOrganizationDomains and use UseSso to check if Organization can have Verified Domains
* Refactor UserService.IsManagedByAnyOrganizationAsync to simply check the UseSso flag
* Add new event types for organization user deletion and voluntary departure
* Add DeleteManagedOrganizationUserAccountCommand to remove user and delete account
* Refactor DeleteManagedOrganizationUserAccountCommand to use orgUser.Id instead of orgUser.UserId.Value
* Add DeleteManagedOrganizationUserAccountCommandTests
* Remove duplicate sql migration script
* Update DeleteManagedOrganizationUserAccountCommand methods to cover all existing checks on OrganizationService
* Add unit tests for all user checks
* Refactor DeleteManagedOrganizationUserAccountCommand
* Set nullable enable annotation on DeleteManagedOrganizationUserAccountCommand
* Fix possible null reference
* Refactor DeleteManagedOrganizationUserAccountCommand.cs for improved event logging
* Use UserRepository.GetByIdAsync instead of UserService.GetUserByIdAsync
* Refactor DeleteManagedOrganizationUserAccountCommand.cs for improved error messages
* Refactor DeleteManagedOrganizationUserAccountCommand.cs for improved event logging, error handling and reduce database calls
* Rename unit tests to correctly describe expected outcome
* PM-11123: Device Type mapping
* PM-11123: Moving ClientType out of NotificationCenter, naming clash with Identity ClientType
* PM-11123: Rename ClientType in ICurrentContext to match the type
* Changes to make all teams and ent plan visible
Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
* Resolve the typeo
---------
Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
* PM-11969 - Add new logic for registering a user via an AcceptEmergencyAccessInviteToken
* PM-11969 - Unit test new RegisterUserViaAcceptEmergencyAccessInviteToken method.
* PM-11969 - Integration test new method