* 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
* Remove gRPC and convert PricingClient to HttpClient wrapper
* Add PlanType.GetProductTier extension
Many instances of StaticStore use are just to get the ProductTierType of a PlanType, but this can be derived from the PlanType itself without having to fetch the entire plan.
* Remove invocations of the StaticStore in non-Test code
* Deprecate StaticStore entry points
* Run dotnet format
* Matt's feedback
* Run dotnet format
* Rui's feedback
* Run dotnet format
* Replacements since approval
* Run dotnet format
* 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>
* Include preferred push technology in config response
SignalR will be the fallback, but clients should attempt web push first if offered and available to the client.
* Register web push devices
* Working signing and content encrypting
* update to RFC-8291 and RFC-8188
* Notification hub is now working, no need to create our own
* Fix body
* Flip Success Check
* use nifty json attribute
* Remove vapid private key
This is only needed to encrypt data for transmission along webpush -- it's handled by NotificationHub for us
* Add web push feature flag to control config response
* Update src/Core/NotificationHub/NotificationHubConnection.cs
Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
* Update src/Core/NotificationHub/NotificationHubConnection.cs
Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
* fixup! Update src/Core/NotificationHub/NotificationHubConnection.cs
* Move to platform ownership
* Remove debugging extension
* Remove unused dependencies
* Set json content directly
* Name web push registration data
* Fix FCM type typo
* Determine specific feature flag from set of flags
* Fixup merged tests
* Fixup tests
* Code quality suggestions
* Fix merged tests
* Fix test
---------
Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
* Add command interface and implementation for disabling organizations
* Register organization disable command for dependency injection
* Add unit tests for OrganizationDisableCommand
* Refactor subscription handlers to use IOrganizationDisableCommand for disabling organizations
* Remove DisableAsync method from IOrganizationService and its implementation in OrganizationService
* Remove IOrganizationService dependency from SubscriptionDeletedHandler
* Remove commented TODO for sending email to owners in OrganizationDisableCommand
* feat(newDeviceVerification) : Initial update to email
* fix : email copying over extra whitespace when using keyboard short cuts
* test : Fixing tests for new device verificaiton email format
* PM-10600: Notification push notification
* PM-10600: Sending to specific client types for relay push notifications
* PM-10600: Sending to specific client types for other clients
* PM-10600: Send push notification on notification creation
* PM-10600: Explicit group names
* PM-10600: Id typos
* PM-10600: Revert global push notifications
* PM-10600: Added DeviceType claim
* PM-10600: Sent to organization typo
* PM-10600: UT coverage
* PM-10600: Small refactor, UTs coverage
* PM-10600: UTs coverage
* PM-10600: Startup fix
* PM-10600: Test fix
* PM-10600: Required attribute, organization group for push notification fix
* PM-10600: UT coverage
* PM-10600: Fix Mobile devices not registering to organization push notifications
We only register devices for organization push notifications when the organization is being created. This does not work, since we have a use case (Notification Center) of delivering notifications to all users of organization. This fixes it, by adding the organization id tag when device registers for push notifications.
* PM-10600: Unit Test coverage for NotificationHubPushRegistrationService
Fixed IFeatureService substitute mocking for Android tests.
Added user part of organization test with organizationId tags expectation.
* PM-10600: Unit Tests fix to NotificationHubPushRegistrationService after merge conflict
* PM-10600: Organization push notifications not sending to mobile device from self-hosted.
Self-hosted instance uses relay to register the mobile device against Bitwarden Cloud Api. Only the self-hosted server knows client's organization membership, which means it needs to pass in the organization id's information to the relay. Similarly, for Bitwarden Cloud, the organizaton id will come directly from the server.
* PM-10600: Fix self-hosted organization notification not being received by mobile device.
When mobile device registers on self-hosted through the relay, every single id, like user id, device id and now organization id needs to be prefixed with the installation id. This have been missing in the PushController that handles this for organization id.
* PM-10600: Broken NotificationsController integration test
Device type is now part of JWT access token, so the notification center results in the integration test are now scoped to client type web and all.
* PM-10600: Merge conflicts fix
* merge conflict fix
* PM-10600: Push notification with full notification center content.
Notification Center push notification now includes all the fields.
* PM-10564: Push notification updates to other clients
Cherry-picked and squashed commits:
d9711b60316e69c8a0ce01c814595e3885885d5f1285a7e994fcf346985f28ff53c29357804ae27c1c9339b686
* PM-15084: Push global notification creation to affected clients
Cherry-picked and squashed commits:
ed5051e0eb181f3e4ae649fe7c93fda8efb45a637b4122c837d21d4a67b3186a09bb921531f564b5
* PM-15084: Log warning when invalid notification push notification sent
* explicit Guid default value
* push notification tests in wrong namespace
* Installation push notification not received for on global notification center message
* wrong merge conflict
* wrong merge conflict
* installation id type Guid in push registration request
* Add organization enable command implementation
* Add unit tests for OrganizationEnableCommand
* Add organization enable command registration for dependency injection
* Refactor payment and subscription handlers to use IOrganizationEnableCommand for organization enabling
* Remove EnableAsync methods from IOrganizationService and OrganizationService
* Add xmldoc to IOrganizationEnableCommand
* Refactor OrganizationEnableCommand to consolidate enable logic and add optional expiration
* PM-10600: Notification push notification
* PM-10600: Sending to specific client types for relay push notifications
* PM-10600: Sending to specific client types for other clients
* PM-10600: Send push notification on notification creation
* PM-10600: Explicit group names
* PM-10600: Id typos
* PM-10600: Revert global push notifications
* PM-10600: Added DeviceType claim
* PM-10600: Sent to organization typo
* PM-10600: UT coverage
* PM-10600: Small refactor, UTs coverage
* PM-10600: UTs coverage
* PM-10600: Startup fix
* PM-10600: Test fix
* PM-10600: Required attribute, organization group for push notification fix
* PM-10600: UT coverage
* PM-10600: Fix Mobile devices not registering to organization push notifications
We only register devices for organization push notifications when the organization is being created. This does not work, since we have a use case (Notification Center) of delivering notifications to all users of organization. This fixes it, by adding the organization id tag when device registers for push notifications.
* PM-10600: Unit Test coverage for NotificationHubPushRegistrationService
Fixed IFeatureService substitute mocking for Android tests.
Added user part of organization test with organizationId tags expectation.
* PM-10600: Unit Tests fix to NotificationHubPushRegistrationService after merge conflict
* PM-10600: Organization push notifications not sending to mobile device from self-hosted.
Self-hosted instance uses relay to register the mobile device against Bitwarden Cloud Api. Only the self-hosted server knows client's organization membership, which means it needs to pass in the organization id's information to the relay. Similarly, for Bitwarden Cloud, the organizaton id will come directly from the server.
* PM-10600: Fix self-hosted organization notification not being received by mobile device.
When mobile device registers on self-hosted through the relay, every single id, like user id, device id and now organization id needs to be prefixed with the installation id. This have been missing in the PushController that handles this for organization id.
* PM-10600: Broken NotificationsController integration test
Device type is now part of JWT access token, so the notification center results in the integration test are now scoped to client type web and all.
* PM-10600: Merge conflicts fix
* merge conflict fix
* PM-10600: Push notification with full notification center content.
Notification Center push notification now includes all the fields.
* PM-10564: Push notification updates to other clients
Cherry-picked and squashed commits:
d9711b60316e69c8a0ce01c814595e3885885d5f1285a7e994fcf346985f28ff53c29357804ae27c1c9339b686
* null check fix
* logging using template formatting
* PM-10600: Notification push notification
* PM-10600: Sending to specific client types for relay push notifications
* PM-10600: Sending to specific client types for other clients
* PM-10600: Send push notification on notification creation
* PM-10600: Explicit group names
* PM-10600: Id typos
* PM-10600: Revert global push notifications
* PM-10600: Added DeviceType claim
* PM-10600: Sent to organization typo
* PM-10600: UT coverage
* PM-10600: Small refactor, UTs coverage
* PM-10600: UTs coverage
* PM-10600: Startup fix
* PM-10600: Test fix
* PM-10600: Required attribute, organization group for push notification fix
* PM-10600: UT coverage
* PM-10600: Fix Mobile devices not registering to organization push notifications
We only register devices for organization push notifications when the organization is being created. This does not work, since we have a use case (Notification Center) of delivering notifications to all users of organization. This fixes it, by adding the organization id tag when device registers for push notifications.
* PM-10600: Unit Test coverage for NotificationHubPushRegistrationService
Fixed IFeatureService substitute mocking for Android tests.
Added user part of organization test with organizationId tags expectation.
* PM-10600: Unit Tests fix to NotificationHubPushRegistrationService after merge conflict
* PM-10600: Organization push notifications not sending to mobile device from self-hosted.
Self-hosted instance uses relay to register the mobile device against Bitwarden Cloud Api. Only the self-hosted server knows client's organization membership, which means it needs to pass in the organization id's information to the relay. Similarly, for Bitwarden Cloud, the organizaton id will come directly from the server.
* PM-10600: Fix self-hosted organization notification not being received by mobile device.
When mobile device registers on self-hosted through the relay, every single id, like user id, device id and now organization id needs to be prefixed with the installation id. This have been missing in the PushController that handles this for organization id.
* PM-10600: Broken NotificationsController integration test
Device type is now part of JWT access token, so the notification center results in the integration test are now scoped to client type web and all.
* PM-10600: Merge conflicts fix
* merge conflict fix
* PM-10600: Push notification with full notification center content.
Notification Center push notification now includes all the fields.
* PM-10600: Notification push notification
* PM-10600: Sending to specific client types for relay push notifications
* PM-10600: Sending to specific client types for other clients
* PM-10600: Send push notification on notification creation
* PM-10600: Explicit group names
* PM-10600: Id typos
* PM-10600: Revert global push notifications
* PM-10600: Added DeviceType claim
* PM-10600: Sent to organization typo
* PM-10600: UT coverage
* PM-10600: Small refactor, UTs coverage
* PM-10600: UTs coverage
* PM-10600: Startup fix
* PM-10600: Test fix
* PM-10600: Required attribute, organization group for push notification fix
* PM-10600: UT coverage
* PM-10600: Fix Mobile devices not registering to organization push notifications
We only register devices for organization push notifications when the organization is being created. This does not work, since we have a use case (Notification Center) of delivering notifications to all users of organization. This fixes it, by adding the organization id tag when device registers for push notifications.
* PM-10600: Unit Test coverage for NotificationHubPushRegistrationService
Fixed IFeatureService substitute mocking for Android tests.
Added user part of organization test with organizationId tags expectation.
* PM-10600: Unit Tests fix to NotificationHubPushRegistrationService after merge conflict
* PM-10600: Organization push notifications not sending to mobile device from self-hosted.
Self-hosted instance uses relay to register the mobile device against Bitwarden Cloud Api. Only the self-hosted server knows client's organization membership, which means it needs to pass in the organization id's information to the relay. Similarly, for Bitwarden Cloud, the organizaton id will come directly from the server.
* PM-10600: Fix self-hosted organization notification not being received by mobile device.
When mobile device registers on self-hosted through the relay, every single id, like user id, device id and now organization id needs to be prefixed with the installation id. This have been missing in the PushController that handles this for organization id.
* PM-10600: Broken NotificationsController integration test
Device type is now part of JWT access token, so the notification center results in the integration test are now scoped to client type web and all.
* PM-10600: Merge conflicts fix
* merge conflict fix
* [PM-17562] Add Azure Service Bus for Distributed Events
* Fix failing test
* Addressed issues mentioned in SonarQube
* Respond to PR feedback
* Respond to PR feedback - make webhook opt-in, remove message body from log
* [PM-17168] Add push notification for revoked and restored organization users
* Add feature flag for push notification on user revoke/restore actions
* Add tests for user revocation and restoration with push sync feature flag enabled
* 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
* 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.