* models, entity, and stored procs updated to work with EmailHashes with migrations
* configure data protection for EmailHashes
* update SendAuthenticationQuery to use EmailHashes and perform validation
* respond to Claude's comments and update tests
* fix send.sql alignment
Co-authored-by: mkincaid-bw <mkincaid@bitwarden.com>
---------
Co-authored-by: Alex Dragovich <46065570+itsadrago@users.noreply.github.com>
Co-authored-by: mkincaid-bw <mkincaid@bitwarden.com>
* Scenes should return resulting data in the result object
The result is for data that cannot be known by the client requesting the scene and the mangle map used for mangling input values to enable parallelizing tests
* Fix filenames
* SingleUserScene now has a return value of various created User data
* 1/100 too frequent for false test failures
* Add restore and revoke to public api
* Follow naming conventions
* Use POST instead of PUT
* hello claude
* Update test names
* Actually fix test names
* Add JsonConstructor attr
* Fix test
* Initial refactor
* Add WebauthnPRFOptions to syncResponse
* MAYBE: Use KM owned ResponseModel?
* REVERT ^- Keep using PrfUnlockOptions for simplicity
This reverts commit 5a34e7dfa8.
* UserDecryptionOptions: Only send one credential
* format
* Update UserDecryptionOptions.cs
* format
* Added feature flag (#6600)
* Enhance MasterPasswordPolicyData with validation attributes
Added data annotations for MinComplexity and MinLength properties to enforce validation rules. MinComplexity must be between 0 and 4, and MinLength must be between 12 and 128.
* Implement model validation in PolicyDataValidator and enhance error handling
Added a ValidateModel method to enforce validation rules for policy data. Updated error messages to provide clearer feedback on validation failures. Enhanced unit tests to cover new validation scenarios for MinLength and MinComplexity properties.
* Update PoliciesControllerTests to reflect new validation rules for MinComplexity and MinLength
Modified test cases to use updated values for MinComplexity (4) and MinLength (128). Added new tests to verify that excessive values for these properties return BadRequest responses. Ensured consistency across integration tests for both Admin and Public controllers.
* Enhance MasterPasswordPolicyData with XML documentation for properties
Added XML documentation comments for MinComplexity and MinLength properties to clarify their purpose and constraints. This improves code readability and provides better context for developers using the model.
* Add unit tests for PolicyDataValidator to validate minLength and minComplexity rules
Implemented new test cases to verify the behavior of the ValidateAndSerialize method in PolicyDataValidator. Tests cover scenarios for minimum and maximum values, as well as edge cases for invalid inputs, ensuring robust validation for MasterPassword policy data.
* feat(emergency-access) [PM-29584]: Add email template.
* refactor(emergency-access) [PM-29584]: Move Emergency Access to Auth/UserFeatures.
* refactor(emergency-access) [PM-29584]: Move EmergencyAccess tests to UserFeatures space.
* feat(emergency-access) [PM-29584]: Add compiled EmergencyAccess templates.
* test(emergency-access) [PM-29584]: Add mailer-specific tests.
* refactor(emergency-access) [PM-29584]: Move mail to UserFeatures area.
* feat(emergency-access) [PM-29584]: Update link for help pages, not web vault.
* test(emergency-access) [PM-29584]: Update mail tests for new URL and single responsibility.
* refactor(emergency-access) [PM-29584]: Add comments for added test.
This config may be used when a load balancer in front of Bitwarden is
first verifying an auth cookie issued by an IdP before proxying the
request to Bitwarden.
* Fix null reference when restoring invited users in Free orgs
Add null check before querying for other free org ownership. Invited
users don't have a UserId yet, causing NullReferenceException.
* Add regression test for restoring revoked invited users with null UserId.
* Exclude invited users from claimed domain checks.
These users should be excluded by the JOIN on
UserId, but it's a known issue that some invited
users have this FK set.
* Add sproc to create multiple default collections.
SqlBulkCopy implementation is overkill for most cases.
This provides a lighter weight sproc implementation for smaller
data sets.
* DRY up collection arrangement
* DRY up tests because bulk and non-bulk share same behavior
* use EF native AddRange instead of bulk insert, because
we expect smaller data sizes on self-host
* Add Entity Framework migration validation to verify_migrations script
Enhances dev/verify_migrations.ps1 to validate EF migration files in addition to SQL migrations. The script now validates migrations in util/MySqlMigrations, util/PostgresMigrations, and util/SqliteMigrations directories.
Validation includes:
- Correct naming format (YYYYMMDDHHMMSS_Description.cs)
- Both .cs and .Designer.cs files exist as pairs
- Chronological ordering of timestamps
- Excludes DatabaseContextModelSnapshot.cs files
The script provides comprehensive reporting for all migration types with a summary showing which validations passed or failed.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* Fix: Validate all EF migration files instead of silently ignoring malformed names
Previously, migration files that didn't match the expected pattern were silently
ignored during validation. This could allow incorrectly named files to slip through.
Now the script explicitly tracks and reports any migration files that don't match
the required YYYYMMDDHHMMSS_Description.cs format, ensuring all new migration files
are properly validated.
Addresses feedback from PR review to prevent malformed migration files from being
overlooked.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
* Add some integration tests for the Server project
* Not sure why this project got removed?
* Format
* capture debug output
* Update tests to work with the now legacy WebHostBuilder
- I accidentally had the updated Program locally and that was why tests were working for me locally
* Formatting...again
* feat(sso-persisted-grants) [PM-23572]: Stub PersistedGrantStore.
* feat(sso-persisted-grants) [PM-23572]: Update service reigtration with named cache.
* feat(sso-persisted-grants) [PM-23572]: Add unit tests for DistributedCachePersistedGrantStore.
* feat(sso-persisted-grants) [PM-23572]: Add additional tests.
* feat(sso-persisted-grants) [PM-23572]: Add some additional clarifying comments on ExtendedCache vs InMemoryCaching for Duende.
* feat(sso-persistent-grants) [PM-23572]: Spelling in a comment for cache key name.
* feat(sso-persisted-grants) [PM-23572]: Add cache key constant and remove explicit skip distributed cache on set for default configuration.
---------
Co-authored-by: bnagawiecki <107435978+bnagawiecki@users.noreply.github.com>