Commit Graph

33 Commits

Author SHA1 Message Date
John Harrington
bef6306ae1 Add passkey and password history to a subset of seeded credentials (#7635)
* initial addition of passwordHistory and fido2Credentials

* distinct RpId and RpName, fix pwd strength fall-through, add tests
2026-05-20 13:57:59 -07:00
Jared Snider
eb9c8c9aa9 Auth/PM-37621 - Fix Device.LastActivityDate surfacing legacy NULL rows as DateTime.UtcNow (#7649)
* PM-37621 - Fix Device.LastActivityDate surfacing legacy NULL rows as DateTime.UtcNow

Dapper's deserializer skips the property setter when a nullable column is
DBNull, leaving the property at its CLR default. The field initializer
`public DateTime? LastActivityDate { get; internal set; } = DateTime.UtcNow`
poisoned that default, so rows whose LastActivityDate column was NULL (e.g.
devices created before the column existed) read back as the current time.

Drop the initializer, relax `internal set` to `set`, and stamp
LastActivityDate explicitly at the two creation call sites
(DeviceValidator.GetDeviceFromRequest and DeviceRequestModel.ToDevice). Adds
an integration regression test that creates a device with an explicit null
LastActivityDate and asserts the read path surfaces null. Augments
DeviceValidatorTests.GetDeviceFromRequest_RawDeviceInfoValid_ReturnsDevice
to lock in the creation-time stamp.

* PM-37621 - DeviceSeeder - creation should set LastActivityDate
2026-05-15 16:34:08 -04:00
Mick Letofsky
4a15d37a40 PM-36416 - Implement master password reprompt seeding (#7598) 2026-05-12 07:44:49 +02:00
Thomas Rittson
55e06e3c2d [PM-36419] [BEEEP] Add collection management settings to seeder (#7576) 2026-05-07 07:36:54 +02:00
Rui Tomé
52d9a9cc88 [PM-35253] Add organization ability UseInviteLinks (#7489)
* Add UseInviteLinks to Organization SQL schema and views

* Add Migrator scripts for UseInviteLinks column and data migration

* Add EF migrations for UseInviteLinks on Organization

* Wire UseInviteLinks through organization domain and repositories

* Add HasInviteLinks plan support and UseInviteLinks license handling

* Expose UseInviteLinks and HasInviteLinks on organization and plan API models

* Update tests for UseInviteLinks and invite-links plan feature

* Update migration script with missing update to Organization_ReadManyByIds

* Move UseInviteLinks column after ExemptFromBillingAutomation

* Bump date on migration scripts
2026-04-30 10:13:50 +01:00
Nick Krantz
39a132d192 [PM-34116][PM-34117] Drivers License and Passport (#7512)
* update minimum version to handle all new item types rather than individual types

* add cipher types for driverslicense and passport

* add request and response models for DriversLicense and Passport

* add events for DriversLicense and Passport

* add seeder

* add additional properties from CXP

* add additional fields
2026-04-28 17:35:01 +00:00
SmithThe4th
bc1818041b [PM-34060] Add bank account item type (#7112)
* Added new bank account type, added minimum version logic and sync filters

* Formatted changes

* changed condition for filtering bank account types

* Fixed tests

* Updated feature flag

* Added comment

* updated feature flag and updated dto

* update ticket for minimum bank account version

* add event types for bank account

* fix client version being null bug

---------

Co-authored-by: Nick Krantz <nick@livefront.com>
2026-04-16 12:32:51 -05:00
Mick Letofsky
6547361e31 PM-33964 - Unify CipherSeeder factories behind CipherSeed domain model. (#7330)
* Unify CipherSeeder factories behind CipherSeed domain model.
2026-03-28 08:08:59 +01:00
Mick Letofsky
612cdb9fa7 PM-34033 - Add user & org API key seeding and improve CLI output (#7324) 2026-03-27 13:38:49 +00:00
Mick Letofsky
5833e34cf6 PM-34033 - Add individual user seeding to preset pipeline (#7304) 2026-03-27 08:14:46 +01:00
Mick Letofsky
f8454bc13a Added RSA keypair pool + Caching to Seeder's RustSdk (#7288) 2026-03-25 13:49:27 +01:00
Matt Gibson
869ba57a2a [PM-34082] Seed passkeys (#7265)
* Seed passkeys

Generates passkey data from minimal inputs or relying party and username

* Allow totp specifying to user login cipher scene

* Fixup test

* Use default values in seed DTOs where possible

* Limit classes to one per file
2026-03-25 07:48:09 +01:00
Matt Gibson
4f37c93349 Arch/cipher scene (#7241)
* User Cipher scene

For now only supports one login cipher

* Fixup batch delete, which fails due to db collisions

* Create cipher scenes for each cipher type

* Remove unnecessary mutex locking

* Include notes in ssh key ciphers

* Add reprompt to ssh keys

* Add deleted and archived options to login cipher seeder

* Remove ArchivedDate for now

* Update util/Seeder/Factories/SshKeyCipherSeeder.cs

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>

* Allow setting favorite in seeder

* Propagate favorites to created cipher

* Propagate delete date to cipher creation

fix favorites, which have to be all caps for detection on the client side

* conditionally set cipher as favorite

* More review comments

---------

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
2026-03-24 12:00:26 -07:00
Mick Letofsky
8310ea1546 Fix 12 silent switch defaults in Seeder with fail-fast throws (#7277) 2026-03-23 18:44:36 +01:00
Mick Letofsky
df3aadb09e Add collection, folder, and favorite assignments for fixture presets (#7267) 2026-03-20 21:04:21 +01:00
Mick Letofsky
cfdd6dfe50 PM-32077 - Add override to KDF iterations from RustSdk for Seeder (#7225) 2026-03-17 09:45:07 +01:00
Mick Letofsky
662828a16a Decouple seeder cipher encryption from internal vault crates (#7211) 2026-03-13 14:35:42 +01:00
Matt Gibson
bf9bc84da4 Existing device scene (#7155)
* Existing device scene

* Prefer usings

* Require namespaces

* Return the device id that is created
2026-03-10 09:33:46 +01:00
Matt Gibson
9ca1874723 Scene to create a folder for a user (#7099) 2026-02-27 09:35:42 +01:00
Mick Letofsky
3abb672903 Refactoring legacy Seeder Recipes (#7069) 2026-02-25 06:46:19 +01:00
Mick Letofsky
a0af85a1f0 Resolving bug with Mangler and Organizations (#7057) 2026-02-23 14:47:25 +01:00
Mick Letofsky
10044397c1 Implement plan types, personal ciphers and fix folder assignment (#7030)
* Implement plan types, personal ciphers and fix folder assignment
2026-02-19 15:47:37 +01:00
Mick Letofsky
07049b367a Seeder Enhancements - Phase 3 (#6973) 2026-02-17 07:42:53 +01:00
Matt Gibson
902be7dfb8 Require password when seeding a new user (#6978) 2026-02-10 19:01:50 +00:00
Mick Letofsky
4eb9c4cf3c Enhance seeder with additional cipher types and architectural refactorings (#6935) 2026-02-04 19:27:09 +01:00
Mick Letofsky
5941e830d2 Refactor to correctly implement statics and remove hardcoded organization keys (#6924) 2026-01-30 16:03:56 +01:00
Mick Letofsky
bfc645e1c1 Add cipher seeding with Rust SDK encryption to enable cryptographically correct test data generation (#6896) 2026-01-30 13:53:24 +01:00
Matt Gibson
edf694b8d4 Use Scene result for SingleUserScene (#6909)
* 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
2026-01-27 21:55:04 +01:00
Oscar Hinton
d1fdaa6a2f Fix lint on main (#6835) 2026-01-14 09:02:49 -05:00
Oscar Hinton
f144828a87 [PM-22263] [PM-29849] Initial PoC of seeder API (#6424)
We want to reduce the amount of business critical test data in the company. One way of doing that is to generate test data on demand prior to client side testing.

Clients will request a scene to be set up with a JSON body set of options, specific to a given scene. Successful seed requests will be responded to with a mangleMap which maps magic strings present in the request to the mangled, non-colliding versions inserted into the database. This way, the server is solely responsible for understanding uniqueness requirements in the database. scenes also are able to return custom data, depending on the scene. For example, user creation would benefit from a return value of the userId for further test setup on the client side.

Clients will indicate they are running tests by including a unique header, x-play-id which specifies a unique testing context. The server uses this PlayId as the seed for any mangling that occurs. This allows the client to decide it will reuse a given PlayId if the test context builds on top of previously executed tests. When a given context is no longer needed, the API user will delete all test data associated with the PlayId by calling a delete endpoint.

---------

Co-authored-by: Matt Gibson <mgibson@bitwarden.com>
2026-01-13 11:10:01 -06:00
Rui Tomé
80ee31b4fe [PM-25015] Add performance tests for Admin Console endpoints (#6235)
* Add GroupsRecipe to manage group creation and user relationships in organizations

* Add CollectionsRecipe to manage collection creation and user relationships in organizations

* Refactor OrganizationUsersControllerPerformanceTests to enhance performance testing and add new test cases

* Add OrganizationDomainRecipe to add verified domains for organizations

* Add more tests to OrganizationUsersControllerPerformanceTests and enhance seeding logic for organizations

- Updated performance tests to use dynamic domain generation for organization users.
- Refactored seeding methods in OrganizationWithUsersRecipe to accept user status and type.
- Modified AddToOrganization methods in CollectionsRecipe and GroupsRecipe to return created IDs.
- Adjusted DbSeederUtility to align with new seeding method signatures.

* Enhance OrganizationSeeder with additional configuration options and update seat calculation in OrganizationWithUsersRecipe to ensure a minimum of 1000 seats.

* Add performance tests for Groups, Organizations, Organization Users, and Provider Organizations controllers

- Introduced `GroupsControllerPerformanceTests` to validate the performance of the PutGroupAsync method.
- Added `OrganizationsControllerPerformanceTests` with multiple tests including DeleteOrganizationAsync, DeleteOrganizationWithTokenAsync, PostStorageAsync, and CreateWithoutPaymentAsync.
- Enhanced `OrganizationUsersControllerPerformanceTests` with DeleteSingleUserAccountAsync and InviteUsersAsync methods to test user account deletion and bulk invitations.
- Created `ProviderOrganizationsControllerPerformanceTests` to assess the performance of deleting provider organizations.

These tests ensure the reliability and efficiency of the respective controller actions under various scenarios.

* Refactor GroupsControllerPerformanceTests to use parameterized tests

- Renamed `GroupsControllerPerformanceTest` to `GroupsControllerPerformanceTests` for consistency.
- Updated `PutGroupAsync` method to use `[Theory]` with `InlineData` for dynamic user and collection counts.
- Adjusted organization user and collection seeding logic to utilize the new parameters.
- Enhanced logging to provide clearer performance metrics during tests.

* Update domain generation in GroupsControllerPerformanceTests for improved test consistency

* Remove ProviderOrganizationsControllerPerformanceTests

* Refactor performance tests for Groups, Organizations, and Organization Users controllers

- Updated method names for clarity and consistency, e.g., `PutGroupAsync` to `UpdateGroup_WithUsersAndCollections`.
- Enhanced test documentation with XML comments to describe the purpose of each test.
- Improved domain generation logic for consistency across tests.
- Adjusted logging to provide detailed performance metrics during test execution.
- Renamed several test methods to better reflect their functionality.

* Refactor performance tests in Organizations and Organization Users controllers

- Updated tests to use parameterized `[Theory]` attributes with `InlineData` for dynamic user, collection, and group counts.
- Enhanced logging to include detailed metrics such as user and collection counts during test execution.
- Marked several tests as skipped for performance considerations.
- Removed unused code and improved organization of test methods for clarity.

* Add bulk reinvite users performance test to OrganizationUsersControllerPerformanceTests

- Implemented a new performance test for the POST /organizations/{orgId}/users/reinvite endpoint.
- Utilized parameterized testing with `[Theory]` and `InlineData` to evaluate performance with varying user counts.
- Enhanced logging to capture request duration and response status for better performance insights.
- Updated OrganizationSeeder to conditionally set email based on user status during seeding.

* Refactor domain generation in performance tests to use OrganizationTestHelpers

- Updated domain generation logic in GroupsControllerPerformanceTests, OrganizationsControllerPerformanceTests, and OrganizationUsersControllerPerformanceTests to utilize the new GenerateRandomDomain method from OrganizationTestHelpers.
- This change enhances consistency and readability across the tests by centralizing domain generation logic.

* Update CollectionsRecipe to have better readability

* Update GroupsRecipe to have better readability

* Refactor authentication in performance tests to use centralized helper method. This change reduces code duplication across Groups, Organizations, and OrganizationUsers controller tests by implementing the `AuthenticateClientAsync` method in a new `PerformanceTestHelpers` class.

* Refactor OrganizationUsersControllerPerformanceTests to filter organization users by OrganizationId.

* Refactor CreateOrganizationUser method to improve handling of user status and key assignment based on invitation and confirmation states.

* Add XML documentation for CreateOrganizationUser method to clarify user status handling
2025-12-05 14:22:00 +00:00
Oscar Hinton
44a82d3b22 [PM-22263] Integate Rust SDK to Seeder (#6150)
Adds a Rust SDK for performing seed related cryptograhic operations. It depends on internal portions of our Rust SDK. Primarily parts of the bitwarden-crypto crate.
2025-10-21 23:46:37 +02:00
Oscar Hinton
5f7e2b8a81 [PM-21075] Initial database seeder (#5703)
Adds a database seeder which can be used standalone using a CLI for seeding your local development environment, or used in unit tests to seed complex scenarios.

---------

Co-authored-by: Robert Y <rkac@bitwarden.com>
2025-05-09 15:00:26 +02:00