* Create organization deletion command with logic extracted from OrganizationService
* Add unit tests for OrganizationDeleteCommand
* Register OrganizationDeleteCommand for dependency injection
* Refactor organization deletion logic to use IOrganizationDeleteCommand and remove legacy IOrganizationService.DeleteAsync method
* Add organization deletion initiation command and refactor service usage
* Enhance organization deletion commands with detailed XML documentation
* Refactor organization command registration to include sign-up and deletion methods
* PM-16261 move ImportCiphersAsync to the tools team and create services using CQRS design pattern
* PM-16261 fix renaming methods and add unit tests for succes and bad request exception
* PM-16261 clean up old code from test
* Enforce free organization limit when updating user
* Add test for throwing error on accepting admin user joining multiple free organizations
* Add test for throwing BadRequest when free organization admin attempts to sign up for another free organization
* Fix user ID handling in UpdateOrganizationUserCommand for free organizations
* Rename parameter 'user' to 'organizationUser' in UpdateUserAsync method for clarity
* Fix two-factor authentication revocation logic and update related tests
* Refine test for RevokeNonCompliantOrganizationUserCommand to assert single user revocation
* feat(NewDeviceVerification) :
- Added constant to constants in Bit.Core because the cache key format needs to be shared between the Identity Server and the MVC project Admin.
- Updated DeviceValidator class to handle checking cache for user information to allow pass through.
- Updated and Added tests to handle new flow.
- Adding exception flow to admin project. Added tests for new methods in UserService.
feat(NewDeviceVerification) :
* Created database migration scripts for VerifyDevices column in [dbo].[User].
* Updated DeviceValidator to check if user has opted out of device verification.
* Added endpoint to AccountsController.cs to allow editing of new User.VerifyDevices property.
* Added tests for new methods and endpoint.
* Updating queries to track [dbo].[User].[VerifyDevices].
* Updated DeviceValidator to set `User.EmailVerified` property during the New Device Verification flow.
* chore: set up a `CODEOWNERS` space for platform
* chore: move sql objects for `Installation` to platform's domain
* chore: move `Installation` and `PushRelay` code to platform's domain
* PM-10563: Notification Center API
* PM-10563: continuation token hack
* PM-10563: Resolving merge conflicts
* PM-10563: Unit Tests
* PM-10563: Paging simplification by page number and size in database
* PM-10563: Request validation
* PM-10563: Read, Deleted status filters change
* PM-10563: Plural name for tests
* PM-10563: Request validation to always for int type
* PM-10563: Continuation Token returns null on response when no more records available
* PM-10563: Integration tests for GET
* PM-10563: Mark notification read, deleted commands date typos fix
* PM-10563: Integration tests for PATCH read, deleted
* PM-10563: Request, Response models tests
* PM-10563: EditorConfig compliance
* PM-10563: Extracting to const
* PM-10563: Update db migration script date
* PM-10563: Update migration script date
* Add JSON-based stored procedure for updating account revision dates and modify existing procedure to use it
* Refactor SingleOrgPolicyValidator to revoke only non-compliant organization users and update related tests
* Add new RegenerateUserAsymmetricKeysCommand
* add new command tests
* Add regen controller
* Add regen controller tests
* add feature flag
* Add push notification to sync new asymmetric keys to other devices
feat(NewDeviceVerification): Added a resend new device OTP endpoint and method for the IUserService as well as wrote test for new methods for the user service.
* Added CQRS pattern
* Added the GetManyByUserIdAsync signature to the repositiory
* Added sql sproc
Created user defined type to hold status
Created migration file
* Added ef core query
* Added absract and concrete implementation for GetManyByUserIdStatusAsync
* Added integration tests
* Updated params to status
* Implemented new query to utilize repository method
* Added controller for the security task endpoint
* Fixed lint issues
* Added documentation
* simplified to require single status
modified script to check for users with edit rights
* Updated ef core query
* Added new assertions
* simplified to require single status
* fixed formatting
* Fixed sql script
* Removed default null
* Added OperationAuthorizationRequirement for secruity task
* Added and registered MarkTaskAsCompletedCommand
* Added unit tests for the command
* Added complete endpoint
* removed false value
* Implement UserLeaveAsync in IRemoveOrganizationUserCommand and refactor OrganizationsController to use it
* Edit summary message for IRemoveOrganizationUserCommand.UserLeaveAsync
* Refactor RemoveOrganizationUserCommand.RemoveUsersAsync to log in bulk
---------
Co-authored-by: Matt Bishop <mbishop@bitwarden.com>
* Revoking users when enabling single org and 2fa policies. Fixing tests.
* Added migration.
* Wrote tests and fixed bugs found.
* Patch build process
* Fixing tests.
* Added unit test around disabling the feature flag.
* Updated error message to be public and added test for validating the request.
* formatting
* Added some tests for single org policy validator.
* Fix issues from merge.
* Added sending emails to revoked non-compliant users.
* Fixing name. Adding two factor policy email.
* Send email when user has been revoked.
* Correcting migration name.
* Fixing templates and logic issue in Revoke command.
* Moving interface into its own file.
* Correcting namespaces for email templates.
* correcting logic that would not allow normal users to revoke non owners.
* Actually correcting the test and logic.
* dotnet format. Added exec to bottom of bulk sproc
* Update src/Core/AdminConsole/OrganizationFeatures/OrganizationUsers/RevokeNonCompliantOrganizationUserCommand.cs
Co-authored-by: Rui Tomé <108268980+r-tome@users.noreply.github.com>
* Updated OrgIds to be a json string
* Fixing errors.
* Updating test
* Moving command result.
* Formatting and request rename
* Realized this would throw a null error from the system domain verification. Adding unknown type to event system user. Adding optional parameter to SaveAsync in policy service in order to pass in event system user.
* Code review changes
* Removing todos
* Corrected test name.
* Syncing filename to record name.
* Fixing up the tests.
* Added happy path test
* Naming corrections. And corrected EF query.
* added check against event service
* Code review changes.
* Fixing tests.
* splitting up tests
* Added templates and email side effect for claiming a domain.
* bringing changes from nc user changes.
* Switched to enqueue mail message.
* Filled in DomainClaimedByOrganization.html.hbs
* Added text document for domain claiming
* Fixing migration script.
* Remove old sproc
* Limiting sending of the email down to users who are a part of the domain being claimed.
* Added test for change
* Renames and fixed up email.
* Fixing up CSS
---------
Co-authored-by: Matt Bishop <mbishop@bitwarden.com>
Co-authored-by: Rui Tomé <108268980+r-tome@users.noreply.github.com>
Co-authored-by: Rui Tome <rtome@bitwarden.com>
* Added the ability to create a JWT on an organization license that contains all license properties as claims
* Added the ability to create a JWT on a user license that contains all license properties as claims
* Added ability to consume JWT licenses
* Resolved generic type issues when getting claim value
* Now validating the jwt signature, exp, and iat
* Moved creation of ClaimsPrincipal outside of licenses given dependecy on cert
* Ran dotnet format. Resolved identity error
* Updated claim types to use string constants
* Updated jwt expires to be one year
* Fixed bug requiring email verification to be on the token
* dotnet format
* Patch build process
---------
Co-authored-by: Matt Bishop <mbishop@bitwarden.com>
* Enhance RemoveOrganizationUserCommand to block removing managed users when account deprovisioning is enabled
* Refactor RemoveUsersAsync method to return just the OrgUserId and update related logic.
* Refactor RemoveOrganizationUserCommand to improve variable naming and remove unused logging method
* Add support for event system user in RemoveUsersAsync method. Refactor unit tests.
* Add xmldoc to IRemoveOrganizationUserCommand methods
* Refactor RemoveOrganizationUserCommand to use TimeProvider for event date retrieval and update unit tests accordingly
* Refactor RemoveOrganizationUserCommand to use constants for error messages
* Refactor unit tests to separate feature flag tests
* refactor: Update parameter names for clarity in RemoveOrganizationUserCommand
* refactor: Rename validation and repository methods for user removal clarity
- Revoking users when enabling single org and 2fa policies.
- Updated emails sent when users are revoked via 2FA or Single Organization policy enablement
Co-authored-by: Matt Bishop <mbishop@bitwarden.com>
Co-authored-by: Rui Tomé <108268980+r-tome@users.noreply.github.com>