* changes to implement the email
* Refactoring and fix the unit testing
* refactor the code and remove used method
* Fix the failing test
* Update the email templates
* remove the extra space here
* Refactor the descriptions
* Fix the wrong subject header
* Add the in the hyperlink rather than just Help center
* Add constant for CipherRepositoryBulkResourceCreation in FeatureFlagKeys
* Add bulk creation methods for Ciphers, Folders, and CollectionCiphers in BulkResourceCreationService
- Implemented CreateCiphersAsync, CreateFoldersAsync, CreateCollectionCiphersAsync, and CreateTempCiphersAsync methods for bulk insertion.
- Added helper methods to build DataTables for Ciphers, Folders, and CollectionCiphers.
- Enhanced error handling for empty collections during bulk operations.
* Refactor CipherRepository to utilize BulkResourceCreationService
- Introduced IFeatureService to manage feature flag checks for bulk operations.
- Updated methods to conditionally use BulkResourceCreationService for creating Ciphers, Folders, and CollectionCiphers based on feature flag status.
- Enhanced existing bulk copy logic to maintain functionality while integrating feature flag checks.
* Add InlineFeatureService to DatabaseDataAttribute for feature flag management
- Introduced EnabledFeatureFlags property to DatabaseDataAttribute for configuring feature flags.
- Integrated InlineFeatureService to provide feature flag checks within the service collection.
- Enhanced GetData method to utilize feature flags for conditional service registration.
* Add tests for bulk creation of Ciphers in CipherRepositoryTests
- Implemented tests for bulk creation of Ciphers, Folders, and Collections with feature flag checks.
- Added test cases for updating multiple Ciphers to validate bulk update functionality.
- Enhanced existing test structure to ensure comprehensive coverage of bulk operations in the CipherRepository.
* Refactor BulkResourceCreationService to use dynamic types for DataColumns
- Updated DataColumn definitions in BulkResourceCreationService to utilize the actual types of properties from the cipher object instead of hardcoded types.
- Simplified the assignment of nullable properties to directly use their values, improving code readability and maintainability.
* Update BulkResourceCreationService to use specific types for DataColumns
- Changed DataColumn definitions to use specific types (short and string) instead of dynamic types based on cipher properties.
- Improved handling of nullable properties when assigning values to DataTable rows, ensuring proper handling of DBNull for null values.
* Refactor CipherRepositoryTests for improved clarity and consistency
- Renamed test methods to better reflect their purpose and improve readability.
- Updated test data to use more descriptive names for users, folders, and collections.
- Enhanced test structure with clear Arrange, Act, and Assert sections for better understanding of test flow.
- Ensured all tests validate the expected outcomes for bulk operations with feature flag checks.
* Update CipherRepositoryBulkResourceCreation feature flag key
* Refactor DatabaseDataAttribute usage in CipherRepositoryTests to use array syntax for EnabledFeatureFlags
* Update CipherRepositoryTests to use GenerateComb for generating unique IDs
* Refactor CipherRepository methods to accept a boolean parameter for enabling bulk resource creation based on feature flags. Update tests to verify functionality with and without the feature flag enabled.
* Refactor CipherRepository and related services to support new methods for bulk resource creation without boolean parameters.
* Move PushType to Platform Folder
- Move the PushType next to the rest of push notification code
- Specifically exclude it from needing Platform code review
- Add tests establishing rules Platform has for usage of this enum, making it safe to have no owner
* Move NotificationHub code into Platform/Push directory
* Update NotificationHub namespace imports
* Add attribute for storing push type metadata
* Rename Push Engines to have PushEngine suffix
* Move Push Registration items to their own directory
* Push code move
* Add expected usage comment
* Add Push feature registration method
- Make method able to be called multipes times with no ill effects
* Add Push Registration service entrypoint and tests
* Use new service entrypoints
* Test changes
* [PM-21878] also update gateway/stripe fields for business units
* pr feedback: replacing switch with extension method
* [PM-21878] prevent invalid stripe ids from crashing the edit provider page
* pr feedback: adding service methods to validate stripe ids
and added unit tests for the new methods
* pr feedback: move validation to SubscriberService and cleanup
* pr feedback: use subscriber service to remove dependency on stripe adapter
* Add TaxRegistrationsListAsync to StripeAdapter
* Update GetOrganizationWarningsQuery, add GetProviderWarningsQuery to support tax ID warning
* Add feature flag to control web display
* Run dotnet format'
* Add IResendOrganizationInviteCommand and ResendOrganizationInviteCommand implementation
* Add unit tests for ResendOrganizationInviteCommand to validate invite resend functionality
* Refactor Organizations, OrganizationUsers, and Members controllers to use IResendInviteCommand for invite resending functionality
* Fix Organizations, OrganizationUsers, and Members controllers to replace IResendInviteCommand with IResendOrganizationInviteCommand
* Remove ResendInviteAsync method from IOrganizationService and its implementation in OrganizationService to streamline invite management functionality.
* Add IResendOrganizationInviteCommand registration in OrganizationServiceCollectionExtensions
* Update the OrganizationUserController integration Confirm tests to handle the Owner type
* Refactor ConfirmOrganizationUserCommand to simplify side-effect handling in organization user confirmation.
Update IPolicyRequirementQuery to return eligible org user IDs for policy enforcement.
Update tests for method signature changes and default collection creation logic.
* Refactor UpdateOrganizationUserCommand to validate and filter out DefaultUserCollections during user updates.
* Enhance UpdateOrganizationUserCommandTests to filter out DefaultUserCollections during user updates, ensuring only shared collections are processed. Updated test logic to reflect new filtering behavior.
* Add integration test for updating organization user with existing default collection. The test verifies successful updates to user permissions, group access, and collection access, ensuring correct handling of shared and default collections.
* Refactor UpdateOrganizationUserCommand to separate the collection validation and DefaultUserCollection filtering
* Refactored integration test setup/assertion for clarity
* Implement GetByOrganizationAsync method in PolicyRequirementQuery and add corresponding unit tests
* Refactor ConfirmOrganizationUserCommand for clarity and add bulk support
* Update ConfirmOrganizationUserCommandTests to use GetByOrganizationAsync for policy requirement queries
* Add DefaultUserCollectionName property to OrganizationUserBulkConfirmRequestModel with encryption attributes
* Update ConfirmUsersAsync method to include DefaultUserCollectionName parameter in OrganizationUsersController
* Add EnableOrganizationDataOwnershipPolicyAsync method to OrganizationTestHelpers
* Add integration tests for confirming organization users in OrganizationUserControllerTests
- Implemented Confirm_WithValidUser test to verify successful confirmation of a single user.
- Added BulkConfirm_WithValidUsers test to ensure multiple users can be confirmed successfully.
* Refactor organization user confirmation integration tests to also test when the organization data ownership policy is disabled
* Refactor ConfirmOrganizationUserCommand to consolidate confirmation side effects handling
- Replaced single and bulk confirmation side effect methods with a unified HandleConfirmationSideEffectsAsync method.
- Updated related logic to handle confirmed organization users more efficiently.
- Adjusted unit tests to reflect changes in the collection creation process for confirmed users.
* Refactor OrganizationUserControllerTests to simplify feature flag handling and consolidate test logic
- Removed redundant feature flag checks in Confirm and BulkConfirm tests.
- Updated tests to directly enable the Organization Data Ownership policy without conditional checks.
- Ensured verification of DefaultUserCollection for confirmed users remains intact.
* Refactor OrganizationUserControllerTests to enhance clarity and reduce redundancy
- Simplified user creation and confirmation logic in tests by introducing helper methods.
- Consolidated verification of confirmed users and their associated collections.
- Removed unnecessary comments and streamlined test flow for better readability.
* test: add new test harnesses
* feat: update autoscale limit logic for SM Subscription Command
* fix: remove redundant helper methods
* fix: add periods to second sentence of templates
* Adding job to update stripe subscriptions and increment seat count when inviting a user.
* Updating name
* Added ef migrations
* Fixing script
* Fixing procedures. Added repo tests.
* Fixed set stored procedure. Fixed parameter name.
* Added tests for database calls and updated stored procedures
* Fixed build for sql file.
* fixing sproc
* File is nullsafe
* Adding view to select from instead of table.
* Updating UpdateSubscriptionStatus to use a CTE and do all the updates in 1 statement.
* Setting revision date when incrementing seat count
* Added feature flag check for the background job.
* Fixing nullable property.
* Removing new table and just adding the column to org. Updating to query and command. Updated tests.
* Adding migration script rename
* Add SyncSeats to Org.sql def
* Adding contraint name
* Removing old table files.
* Added tests
* Upped the frequency to be at the top of every 3rd hour.
* Updating error message.
* Removing extension method
* Changed to GuidIdArray
* Added xml doc and switched class to record
* Refactor ConfirmOrganizationUserCommand to push registration after DB save
* Assert device push registration handling in ConfirmOrganizationUserCommandTests
* [PM-17562] Refactor event integration methods / declarations in ServiceCollectionExtensions
* Refactored ServiceCollectionExtensions to use TryAdd and still launch unique listeneer services
* Updated unit tests to match new generic format for Listeners
* Fix method spacing
* Update README to reflect new integration setup in ServiceCollectionExtensions
* Move interfaces to I prefix; fix typo in subscription
* Fix reference to IIntegrationListenerConfiguration
* Add warnings and scaffold tests
* Do some private reflection
* Add tests for warnings
* Add explainer comment
* Remove Reference to Azure CosmosDb Sink
* Don't warn on old file location
* Update test names
* Add syslog test
* dotnet format
* Add lazy syslog fix
* Add longer wait for file
* Make syslog test local only
* Switch to shortened URL
* feat:
- Add SendPasswordHasher class and interface
- DI for SendPasswordHasher to use Marker class allowing us to use custom options for the SendPasswordHasher without impacting other PasswordHashers.
* test: Unit tests for SendPasswordHasher implementation
* doc: docs for interface and comments
Co-authored-by: Maciej Zieniuk <167752252+mzieniukbw@users.noreply.github.com>
* [NO LOGIC] Move query to core
* Check for unverified bank account in free trial and inactive subscription warnings
* Run dotnet format
* fix test
* Run dotnet format
* Remove errant file
* Add SelfHostedOrganizationSignUpCommand for organization sign-up process
Method extracted from OrganizationService
* Register SelfHostedOrganizationSignUpCommand for dependency injection
* Add unit tests for SelfHostedOrganizationSignUpCommand
* Refactor SelfHostedOrganizationLicensesController to use ISelfHostedOrganizationSignUpCommand
* Remove SignUpAsync method and related validation from IOrganizationService and OrganizationService
* Move ISelfHostedOrganizationSignUpCommand into a separate file and update references
* Enable null safety in SelfHostedOrganizationSignUpCommand and update ISelfHostedOrganizationSignUpCommand interface to reflect nullable types for organizationUser and collectionName.
* feat(pm-19055) :
- Add generic OTP generator. This OTP generator is not linked to .NET Identity giving us flexibility.
- Update `OtpTokenProvider` to accept configuration object to keep interface clean.
- Implement `OtpTokenProvider` in DI as open generic for flexibility.
* test: 100% test coverage for `OtpTokenProvider`
* doc: Added readme for `OtpTokenProvider`
* Created ReadAllOrganizationUsersBasicInformationRequirement for use with Authorize attribute.
* Removed unused req and Handler and tests. Moved to new auth attribute
* Moved tests to integration tests with new response.
* Removed tests that were migrated to integration tests.
* Made string params Guids instead of parsing them manually in methods.
* Admin and Owner added to requirement.
* Added XML docs for basic get endpoint. Removed unused. Added another auth check. Inverted if check.
* Removed unused endpoint
* Added tests for requirement
* Added checks for both User and Custom
* Added org id check to validate the user being requested belongs to the org in the route.
* typo
* Resolve JSON serialization bug in OneOf converters and organize pricing models
* Support free organizations for payment method and billing address flows
* Run dotnet format
* Moved license models to billing
* Moved LicensingService to billing
* Moved license command and queries to billing
* Moved LicenseController to billing
* Add feature flag
* Further establish billing command pattern and use in PreviewTaxAmountCommand
* Add billing address models/commands/queries/tests
* Update TypeReadingJsonConverter to account for new union types
* Add payment method models/commands/queries/tests
* Add credit models/commands/queries/tests
* Add command/query registrations
* Add new endpoints to support new command model and payment functionality
* Run dotnet format
* Add InjectUserAttribute for easier AccountBillilngVNextController handling
* Add InjectOrganizationAttribute for easier OrganizationBillingVNextController handling
* Add InjectProviderAttribute for easier ProviderBillingVNextController handling
* Add XML documentation for billing command pipeline
* Fix StripeConstants post-nullability
* More nullability cleanup
* Run dotnet format
* [PM-17562] Add HEC integration support
* Re-ordered parameters per PR suggestion
* Apply suggestions from code review
Co-authored-by: Matt Bishop <mbishop@bitwarden.com>
* Refactored webhook request model validation to be more clear
---------
Co-authored-by: Matt Bishop <mbishop@bitwarden.com>
* Refactor Collections and OrganizationExport Controllers to Remove ICollectionService Dependency
* Remove ICollectionService registration from ServiceCollectionExtensions
* Remove CollectionServiceTests file as part of the ongoing refactor to eliminate ICollectionService.
* Remove ICollectionService and its implementation in CollectionService as part of the ongoing refactor to eliminate the service.
* Add CreateCollectionCommand and associated interface with validation logic
* Implement CreateCollectionCommand to handle collection creation with organization checks and access permissions.
* Introduce ICreateCollectionCommand interface for defining the collection creation contract.
* Add unit tests for CreateCollectionCommand to validate various scenarios including permission checks and error handling.
* Add UpdateCollectionCommand and associated interface with validation logic
* Implement UpdateCollectionCommand to handle collection updates with organization checks and access permissions.
* Introduce IUpdateCollectionCommand interface for defining the collection update contract.
* Add unit tests for UpdateCollectionCommand to validate various scenarios including permission checks and error handling.
* Add scoped services for collection commands
* Register ICreateCollectionCommand and IUpdateCollectionCommand in the service collection for handling collection creation and updates.
* Refactor CollectionsController to use command interfaces for collection creation and updates
* Updated CollectionsController to utilize ICreateCollectionCommand and IUpdateCollectionCommand for handling collection creation and updates, replacing calls to ICollectionService.
* Adjusted related unit tests to verify the new command implementations.
* Refactor ICollectionService and CollectionService to remove SaveAsync method
* Removed the SaveAsync method from ICollectionService and its implementation in CollectionService.
* Updated related tests in CollectionServiceTests to reflect the removal of SaveAsync, ensuring existing functionality remains intact.
* Remove unused organization repository dependency from CollectionServiceTests
* Add validation to CreateCollectionCommand to prevent creation of DefaultUserCollection type
* Implemented a check in CreateCollectionCommand to throw a BadRequestException if a collection of type DefaultUserCollection is attempted to be created.
* Added a unit test to verify that the exception is thrown with the correct message when attempting to create a collection of this type.
* Add validation to DeleteCollectionCommand to prevent deletion of DefaultUserCollection type
* Implemented checks in DeleteAsync and DeleteManyAsync methods to throw a BadRequestException if a collection of type DefaultUserCollection is attempted to be deleted.
* Added unit tests to verify that the exceptions are thrown with the correct messages when attempting to delete collections of this type.
* Add validation in UpdateCollectionCommand to prevent editing DefaultUserCollection type
* Implemented a check in UpdateAsync to throw a BadRequestException if a collection of type DefaultUserCollection is attempted to be updated.
* Added a unit test to verify that the exception is thrown with the correct message when attempting to update a collection of this type.
* Add validation in UpdateOrganizationUserCommand to prevent modification of DefaultUserCollection type
* Implemented a check to throw a BadRequestException if an attempt is made to modify member access for collections of type DefaultUserCollection.
* Added a unit test to ensure the exception is thrown with the correct message when this condition is met.
* Add validation in UpdateGroupCommand to prevent modification of DefaultUserCollection type
* Implemented a check to throw a BadRequestException if an attempt is made to modify group access for collections of type DefaultUserCollection.
* Added a unit test to ensure the exception is thrown with the correct message when this condition is met.
* Add validation in BulkAddCollectionAccessCommand to prevent addition of collections of DefaultUserCollection type
* Implemented a check to throw a BadRequestException if an attempt is made to add access to collections of type DefaultUserCollection.
* Added a unit test to ensure the exception is thrown with the correct message when this condition is met.
* Add validation in CollectionService to prevent modification of DefaultUserCollection type
* Implemented a check in DeleteUserAsync to throw a BadRequestException if an attempt is made to modify member access for collections of type DefaultUserCollection.
* Added a unit test to ensure the exception is thrown with the correct message when this condition is met.
* Implement a check to throw a BadRequestException if an attempt is made to modify member access for collections of type DefaultUserCollection.
* Add validation in CollectionsController to prevent deletion of DefaultUserCollection type
* Implemented a check to return a BadRequestObjectResult if an attempt is made to delete a collection of type DefaultUserCollection.
* Remove unused test method for handling DefaultUserCollection in CollectionsControllerTests
* Update UpdateOrganizationUserCommandTests to use OrganizationUserType for user updates
* [PM-17562] Add integration filter support
* Repond to PR feedback; Remove Date-related filters
* Use tables to format the filter class descriptions
* [PM-17562] Add database support for integration filters (#5988)
* [PM-17562] Add database support for integration filters
* Respond to PR review - fix database scripts
* Further database updates; fix Filters to be last in views, stored procs, etc
* Fix for missing nulls in stored procedures in main migration script
* Reorder Filters to the bottom of OrganizationIntegrationConfiguration
* Separate out the creation of filters from the IntegrationFilterService to IntegrationFIlterFactory
* Move properties to static readonly field
* Fix unit tests failing from merge
---------
Co-authored-by: Matt Bishop <mbishop@bitwarden.com>