1
0
mirror of https://github.com/bitwarden/server synced 2025-12-27 13:43:18 +00:00
Commit Graph

27 Commits

Author SHA1 Message Date
Hinton
43cf41657c Some more docs 2025-12-16 20:50:56 +01:00
Hinton
46f14784cf Merge branch 'main' of github.com:bitwarden/server into arch/seeder-api
# Conflicts:
#	util/Seeder/Recipes/OrganizationWithUsersRecipe.cs
2025-12-16 16:48:29 +01: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
Hinton
dff45c137d Add documentation 2025-11-13 13:14:43 +01:00
Hinton
840307fe4a Document queries and scenes 2025-11-13 11:45:11 +01:00
Matt Gibson
f2116734a2 Use a header to track seeded data. This has benefits client side in simplicity and allows us to track entities added during a test, as long as they include the play id header. 2025-11-10 18:17:41 -08:00
Matt Gibson
878b78b51e Stricter scene and query types
SeederAPI only serves Scenes, Recipes are inteded to be used locally only.
2025-10-29 12:27:15 -07:00
Hinton
16ee5cfaad Merge branch 'main' of github.com:bitwarden/server into arch/seeder-api
# Conflicts:
#	bitwarden-server.sln
#	util/Seeder/Factories/UserSeeder.cs
2025-10-21 17:47:52 -04: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
Hinton
1daf9ad892 Add queries, rename seed to scene 2025-10-18 15:55:48 -04:00
Hinton
fd41332e4c Refactor recipies into scenes 2025-10-17 11:47:19 -04:00
Hinton
1137857eba Add recipe for getting emergency access invites 2025-10-11 10:26:13 -07:00
Hinton
45ba8f83df Add support for setting email verified and premium in seed 2025-10-10 12:11:30 -07:00
Matt Gibson
13d666a8b0 Fixup user mangling 2025-10-09 17:53:11 -07:00
Hinton
9c4c88fa34 Wire up SDK 2025-10-09 17:32:41 -07:00
Hinton
44aef68c31 Merge branch 'arch/seeder-sdk' of github.com:bitwarden/server into arch/seeder-api
# Conflicts:
#	util/Seeder/Factories/UserSeeder.cs
2025-10-09 15:53:47 -07:00
Matt Gibson
431a708914 Delete all seeded data
Fixup single user recipe to inform of seeded entities
2025-10-09 15:36:29 -07:00
Matt Gibson
f4342e207b Add SingleUserRecipe for seeding a single known user 2025-10-09 11:14:17 -07:00
Hinton
12ad758f72 Add dedicated functions instead of updating existing 2025-10-09 09:59:14 -07:00
Hinton
92f2555b5c Refactor to track entities rather than manually writing destroy 2025-10-07 16:54:08 -07:00
Hinton
79f5d8f147 Add support for destroying seeded data 2025-10-07 14:59:17 -07:00
Hinton
3ad308138e Speed up KDF 2025-07-31 16:39:12 +02:00
Hinton
3132e09e21 Wire up crypto logic for sharing org key 2025-07-31 14:48:48 +02:00
Hinton
75f11f68ac Generate valid keys using rust 2025-07-31 10:20:53 +02:00
Hinton
072f9f2278 Add hash password 2025-07-28 18:40:54 +02:00
Hinton
418dbb374c SDK integration in db seeder 2025-07-01 17:21:26 +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