* Organization integration creation, update, and deletion database logic
* Additional procs and entity tweaks
* Use check
* Couple newlines
* Forgot to script the two org procs
* WIP changes for Invite User optimization from Scim
* feature flag string
* Added plan validation to PasswordManagerInviteUserValidation. Cleaned up a few things.
* Added Secrets Manager Validations and Tests.
* Added bulk procedure for saving users, collections and groups from inviting. Added test to validate Ef and Sproc
* Created SendOrganizationInvitesCommand and moved some tests from OrgServiceTests. Fixed some tests in org service in relation to moving out SendOrgInviteCommand code.
Added side effects to InviteOrganizationUsersCommand
* First test of new command.
* Added test to verify valid request with a user calls db method and sends the invite
* Added more tests for the updates
* Added integration test around enabling feature and sending invite via scim. Did a bit of refactoring on the SM validation. Fixed couple bugs found.
* Switching over to a local factory.
* created response model and split interface out.
* switched to initialization block
* Moved to private method. Made ScimInvite inherit the single invite base model. Moved create methods to constructors. A few more CR changes included.
* Moved `FromOrganization` mapper method to a constructor
* Updated to use new pricing client. Supressed null dereference errors.
* Fixing bad merge.
* Rename of OrgDto
* undoing this
* Moved into class
* turned into a switch statement
* Separated into separate files.
* Renamed dto and added ctor
* Dto rename. Moved from static methods to ctors
* Removed unused request model
* changes from main
* missed value
* Fixed some compilation errors.
* Fixed some changes.
* Removed comment
* fixed compiler warning.
* Refactored to use new ValidationResult pattern. added mapping method.
* Added throwing of Failure as the previous implementation would have.
* Cleaned up return.
* fixing test.
* Made HasSecretsManagerStandalone return if org doesn't have sm. Added overload for lighter weight model and moved common code to private method.
* Fixed tests.
* Made public method private. added some comments.
* Refactor validation parameter to improve clarity and consistency. Added XML doc
* fixed test
* Removed test only constructor from InviteOrganization
* Separated old and new code explicitly. Moved old code checks down into new code as well. Added error and mapper to Failure<T>
* Variable/Field/Property renames
* Renamed InviteUsersValidation to InviteUsersValidator
* Rename for InvitingUserOrganizationValidation to InvitingUserOrganizationValidator
* PasswordManagerInviteUserValidation to PasswordManagerInviteUserValidator
* Moved XML comment. Added check to see if additional seats are needed.
* Fixing name.
* Updated names.
* Corrected double negation.
* Added groups and collection and users checks.
* Fixed comment. Fixed multiple enumeration. Changed variable name.
* Cleaned up DTO models. Moved some validation steps around. A few quick fixes to address CR concerns. Still need to move a few things yet.
* Fixed naming in subscription update models.
* put back in the request for now.
* Quick rename
* Added provider email addresses as well.
* Removed valid wrapper to pass in to validation methods.
* fix tests
* Code Review changes.
* Removed unused classes
* Using GetPlanOrThrow instead.
* Switches to extension method
* Made Revert and Adjust Sm methods consistent. Corrected string comparer. Added comment for revert sm.
* Fixing compiler complaint.
* Adding XML docs
* Calculated seat addition for SM.
* Fixing compiler complaints.
* Renames for organization.
* Fixing comparison issue.
* Adding error and aligning message.
* fixing name of method.
* Made extension method.
* Rearranged some things. Fixed the tests.
* Added test around validating the revert.
* Added test to validate the provider email is sent if org is managed by a provider.
* Created new errors and removed references in business code to ErrorMessages property. This aligns Invite User code to use Errors instead of ErrorMessages
* Delayed the hasSecretsManagerStandalone call as long as possible.
* Corrected model name. Corrected SM seat calculation. Added test for it.
* Corrected logic and added more tests.
* [PM-17563] Add case for PushType.PendingSecurityTasks
* [PM-17563] Add missing TaskId property to NotificationStatusDetails and NotificationResponseModel
* [PM-17563] Add migration script to re-create NotificationStatusDetailsView to include TaskId column
* [PM-17563] Select explicit columns for NotificationStatusDetailsView and fix migration script
* Moved RestoreUserAsync and RestoreUsersAsync to Command.
* Fixing the bug.
* Added test for bulk method.
* Fixing sonar cube warning.
* SonarQube warning fix.
* Excluding org users we already have.
* Fixed misspelling. Added integration test for method.
* test had the misspelling as well 🤦
* Split out interface. Added admin and confirmed constraints.
* fixed queries and added xml comments and tests.
* Refactor OrganizationUser status update procedure to use a GuidIdArray parameter and remove JSON parsing logic
* Fix OrganizationUser_SetStatusForUsersById procedure and bump script date
* Restore OrganizationUser_SetStatusForUsersById for possible server version rollback. Add new version with the name OrganizationUser_SetStatusForUsersByGuidIdArray
* Add migration script to add stored procedure OrganizationUser_SetStatusForUsersByGuidIdArray to update user status by GUID array
* feat(pm-15015) :
* Add `CountryName` column to AuthRequest Table in Database, and refreshing AuthRequestView
* Modify database stored procedures and Entity Framework migrations for AuthRequest Repositories
* Add property to `ICurrentContext` and response models.
* initial commit of `CipherOrganizationPermission_GetManyByUserId`
* create queries to get all of the security tasks that are actionable by a user
- A task is "actionable" when the user has manage permissions for that cipher
* rename query
* return the user's email from the query as well
* Add email notification for at-risk passwords
- Added email layouts for security tasks
* add push notification for security tasks
* update entity framework to match stored procedure plus testing
* update date of migration and remove orderby
* add push service to security task controller
* rename `SyncSecurityTasksCreated` to `SyncNotification`
* remove duplicate return
* remove unused directive
* remove unneeded new notification type
* use `createNotificationCommand` to alert all platforms
* return the cipher id that is associated with the security task and store the security task id on the notification entry
* Add `TaskId` to the output model of `GetUserSecurityTasksByCipherIdsAsync`
* move notification logic to command
* use TaskId from `_getSecurityTasksNotificationDetailsQuery`
* add service
* only push last notification for each user
* formatting
* refactor `CreateNotificationCommand` parameter to `sendPush`
* flip boolean in test
* update interface to match usage
* do not push any of the security related notifications to the user
* add `PendingSecurityTasks` push type
* add push notification for pending security tasks
* Add Manage permission to UserCipherDetails and CipherDetails_ReadByIdUserId
* Add Manage property to CipherDetails and UserCipherDetailsQuery
* Add integration test for CipherRepository Manage permission rules
* Update CipherDetails_ReadWithoutOrganizationsByUserId to include Manage permission
* Refactor UserCipherDetailsQuery to include detailed permission and organization properties
* Refactor CipherRepositoryTests to improve test organization and readability
- Split large test method into smaller, focused methods
- Added helper methods for creating test data and performing assertions
- Improved test coverage for cipher permissions in different scenarios
- Maintained existing test logic while enhancing code structure
* Refactor CipherRepositoryTests to consolidate cipher permission tests
- Removed redundant helper methods for permission assertions
- Simplified test methods for GetCipherPermissionsForOrganizationAsync, GetManyByUserIdAsync, and GetByIdAsync
- Maintained existing test coverage for cipher manage permissions
- Improved code readability and reduced code duplication
* Add integration test for CipherRepository group collection manage permissions
- Added new test method GetCipherPermissionsForOrganizationAsync_ManageProperty_RespectsCollectionGroupRules
- Implemented helper method CreateCipherInOrganizationCollectionWithGroup to support group-based collection permission testing
- Verified manage permissions are correctly applied based on group collection access settings
* Add @Manage parameter to Cipher stored procedures
- Updated CipherDetails_Create, CipherDetails_CreateWithCollections, and CipherDetails_Update stored procedures
- Added @Manage parameter with comment "-- not used"
- Included new stored procedure implementations in migration script
- Consistent with previous work on adding Manage property to cipher details
* Update UserCipherDetails functions to reorder Manage and ViewPassword columns
* Reorder Manage and ViewPassword properties in cipher details queries
* Bump date in migration script
* Copy PatchGroupCommand to vNext and refactor
* Detect duplicate add requests and return early
* Update read repository method to use HA replica
* Add new write repository method
* Add stored procedure to read organization user details by role
* Add OrganizationUserRepository method to retrieve OrganizationUser details by role
* Enhance AuthRequestService to send notifications to custom users with ManageResetPassword permission
* Enhance AuthRequestServiceTests to include custom user permissions and validate notification email recipients
Only users with Manage/Edit permissions will be allowed to Assign To Collections. If the user has Can Edit Except Password the collections dropdown will be disabled.
---------
Co-authored-by: Matt Bishop <mbishop@bitwarden.com>
Co-authored-by: kejaeger <138028972+kejaeger@users.noreply.github.com>
* Implement endpoints to add existing organization to provider
* Run dotnet format
* Support MOE
* Run dotnet format
* Move ProviderClientsController under AC ownership
* Move ProviderClientsControllerTests under AC ownership
* Jared's feedback
* Added userId check on query
* Added required field to inner select
* PM-16947 - Update to filter inner subquery on user id per discussion with Robert
* Updated to use new query with ROW_NUMBER
* More query optimizations to eliminate returning old requests for a device
* Fixed approval condition to be NULL as 0 means denied.
* Added negation of @ExpirationMinutes
---------
Co-authored-by: Todd Martin <tmartin@bitwarden.com>
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.
fix(auth): [PM-2996] Add Pending Auth Request Data to Devices Response
- New stored procedure to fetch the appropriate data.
- Updated devices controller to respond with the new data.
- Tests written at the controller and repository level.
Resolves PM-2996
* 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
* 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 security tasks feature flag
* Add SQL files
* Add SQL Server migration
* Add Core entity
* Add Dapper repository
* Add EF repository
* Add EF migrations
* Save OrganizationInstallation during GetLicense invocation
* Run dotnet format
- 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>
* 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