Commit Graph

1181 Commits

Author SHA1 Message Date
MtnBurrit0
364896f10d Merge branch 'main' into fix/seeder-postgres 2026-04-10 10:22:55 -06:00
Micaiah Martin
e6d003bc64 Correct comment accuracy 2026-04-10 10:14:33 -06:00
Micaiah Martin
5613cf986e Fix CollectionUser and CollectionGroup table names across all DB providers 2026-04-10 10:09:04 -06:00
Rui Tomé
ec027342b0 [PM-22450] Bump date on migration script file CollectionBumpRevisionDateOnAccessChange (#7436) 2026-04-10 07:57:45 -07:00
Jimmy Vo
0bb818bc97 [PM-34147] Add GetManyConfirmedAcceptedDetailsByUserAsync to IOrganizationUserRepository (#7399) 2026-04-10 09:28:28 -04:00
Rui Tomé
3dd72f6118 [PM-22450] Bump Collection.RevisionDate on edits and access changes (#7380)
* Fix UpdateCollectionCommand to set RevisionDate using TimeProvider and update corresponding tests. Adjust tests to verify correct RevisionDate assignment during collection updates.

* Enhance BulkAddCollectionAccessCommand to include revision date in access updates. Update ICollectionRepository and its implementations to accept revision date parameter. Modify stored procedure to update collection revision dates accordingly. Add tests to verify correct behavior of access creation and revision date updates.

* Update GroupRepository and stored procedures to bump RevisionDate for affected collections during group creation and updates. Enhance integration tests to verify that collection revision dates are correctly updated when groups are created or modified.

* Implement revision date updates for affected collections in OrganizationUserRepository and related stored procedures. Add integration tests to ensure revision dates are correctly bumped during organization user creation and updates.

* Update database migration script

* Update migration script summary

* Refactor OrganizationUserReplaceTests to create collection first

* Refactor stored procedures to use Common Table Expressions (CTEs) for updating RevisionDate of affected collections. This change improves readability and maintainability by consolidating the logic for identifying affected collections in Group_UpdateWithCollections and OrganizationUser_UpdateWithCollections procedures.

* Enhance OrganizationUser_CreateManyWithCollectionsAndGroups stored procedure to accept RevisionDate parameter for updating affected collections. Update OrganizationUserRepository to utilize the provided RevisionDate when available, ensuring accurate revision date management during organization user operations.

* Refactor OrganizationUser_CreateManyWithCollectionsGroups and migration script to utilize temporary table for CollectionUser data insertion. This change improves performance and maintains consistency in updating RevisionDate for affected collections.

* Refactor OrganizationUserRepository to consistently use RevisionDate from created OrganizationUsers when updating affected collections. This change enhances the accuracy of revision date management across the repository.

* Refactor tests to ensure consistent handling of RevisionDate across Group and Collection repositories. Update assertions to compare RevisionDate directly, improving accuracy in revision date management during tests.

* Restore BOM in Group_UpdateWithCollections and OrganizationUser_UpdateWithCollections

* Refactor GroupRepository and OrganizationUserRepository to improve handling of RevisionDate. Updated collection filtering logic to use HashSet for efficiency and ensured that affected collections are filtered by OrganizationId, enhancing accuracy in revision date management.

* Bump migration script date

* Remove internal set from RevisionDate on Group and OrganizationUser

The Dapper repositories use a System.Text.Json serialize/deserialize
round-trip to build *WithCollections objects. System.Text.Json silently
skips properties with non-public setters, so RevisionDate was reverting
to DateTime.UtcNow instead of preserving the value set in C#.

* Refactor OrganizationUser_CreateManyWithCollectionsGroups and migration script to improve the logic for updating RevisionDate. The update now uses INNER JOINs to ensure accurate filtering of collections based on OrganizationId and CollectionUser data, enhancing the precision of revision date management.

* Fix sprocs styling

* Added early return to OrganizationUserRepository.CreateManyAsync if the supplied parameter is empty
2026-04-10 07:27:27 +01:00
Rui Tomé
e10b13f0eb [PM-34178] Add entities, repository and database migrations for Organization Invite Link feature (#7407)
* Add feature flag for Organization Invite Links

* Add OrganizationInviteLink database entity

* Add OrganizationInviteLink table sql script and also OrganizationInviteLinkView that reads from it

* Add OrganizationInviteLink stored procedures for CRUD operations

* Add SQL migration script

* Add EF migrations

* Add EF configurations

* Add IOrganizationInviteLinkRepository and integration tests

* Add OrganizationInviteLinkRepository Dapper implementation

* refactor(tests): Update OrganizationInviteLinkRepositoryTests to use [Theory] attribute for test cases
2026-04-09 15:22:38 +01:00
Jimmy Vo
45ac58b7b5 [PM-34146] Add GetManyConfirmedAcceptedByUserIdAsync(Guid userId) to the IPolicyRepository interface (#7392) 2026-04-09 10:21:09 -04:00
renovate[bot]
65defa6b24 [deps] DbOps: Update dbup-sqlserver to v7 (#7218)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: rkac-bw <148072202+rkac-bw@users.noreply.github.com>
2026-04-09 08:02:09 -06:00
Matt Gibson
5596ffce0d [pm-34486] require basic auth on seeder api endpoints (#7368)
* [pm-34486] require basic auth on seeder api endpoints

* Fixup tests with basic auth
2026-04-03 07:22:23 +02:00
Mick Letofsky
0624981ab6 Rename CLI endpoint to Preset instead of Seed (#7340) 2026-03-30 15:17:54 +02:00
Mick Letofsky
17cf23f8f4 Clarify potential misleading comment (#7339) 2026-03-30 09:07:29 -04: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
Justin Baur
550968bf41 Update to IHostBuilder style (#6843)
* 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

* Update to `IHostBuilder` style

* Formatting
2026-03-27 11:09:05 -04: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
Jared McCannon
c321080daf [PM-32067] - Add Provider Ability View (#7200)
* Added provider ability

* Correcting sproc

* fixed name
2026-03-26 08:59:21 -05: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
Jared McCannon
463ca89710 [PM-32066] - Add Org Ability View (#7194)
* Added sproc, view, repo methods, and tests
2026-03-23 08:09:22 -05:00
Mick Letofsky
df3aadb09e Add collection, folder, and favorite assignments for fixture presets (#7267) 2026-03-20 21:04:21 +01:00
Jared McCannon
5f1cdd5080 [PM-33585] - Add null check for bump revision date (#7268)
* Adding where not null for user id to be used in the bump revision date call.

* Or alter
2026-03-20 12:25:13 -05:00
Ike
1bc5f4ec1e [PM-21926] [PM-30350] [PM-32389] Read salt from database (#7230)
feat: add MasterPasswordSalt to database responses and DTOs

- Add Dapper migration scripts and update SQL project
- Include MasterPasswordSalt in database response models and DTOs
- Add null coalescing to User entity for MasterPasswordSalt
- Update EF queries to return MasterPasswordSalt
- Rename migrations for consistency
- Add test coverage for affected repositories
- Update EmergencyAccessTakeOverResponseModel tests
2026-03-18 16:18:16 -04:00
Mick Letofsky
cfdd6dfe50 PM-32077 - Add override to KDF iterations from RustSdk for Seeder (#7225) 2026-03-17 09:45:07 +01:00
Thomas Rittson
99454f5fe7 [PM-33216] Finalize RequireSsoPolicyRequirement (#7173)
* Add more efficient sproc to retrieve PolicyDetails
  for a single user. This closely matches the existing sproc
  used by PolicyService and should be performant enough
  to be used in the login flow

* Maintain feature flag for this critical path
2026-03-17 08:30:51 +10:00
sven-bitwarden
e5fec6af6d [PM-31920] Remove Unused Sprocs (#7060)
* Remove old/unused sprocs

* Consistency
2026-03-16 11:13:29 -05:00
Mick Letofsky
ba242d6d11 PM-33591 - Parallelize CreateUsersStep and GeneratePersonalCiphersStep (#7226) 2026-03-16 15:20:11 +01:00
aj-bw
f72e857584 pin image to sha (#7215) 2026-03-15 21:01:12 -04:00
Amy Galles
c9a1f1e7ef create new dockerfile for SeederApi (#7072)
* create new dockerfile for SeederApi

* troubleshoot cargo issues

* troubleshoot cargo issues

* Ensure Rustup run on build env for appropriate target

* Musl targets do not support cdylibs

* Ensure default triple set to target

* Set target triple rather than update default host

* Change build platforms per project

* Switch to debian since we can't use musl

* Debian build for seeder should work with arm targets

* Move app stage to distroless

* remove SeederApi from server publish section

* suppress unrelated warnings"

* ruling out builds as error source

* override platforms for SeederApi

* troubleshoot matrix

* add extra step for evaluating platforms

* fix syntax error

* exclude unrelated error

* exclude unrelated error

* exclude unrelated error

* exclude unrelated error

* exclude unrelated error

* temporarily reduce number of builds

* exclude unrelated error

* remove temporary block on other builds

* remove unused builds from dockerfile

* add nginx location for seeder, wrap it behind an if check defaulting to false. This was discuss with Matt G, as this will enable QA usage of it without repetitive intervention with config files and reloading the nginx service etc. Handlebars will continously overwrite the nginx conf file on update

* opted to remove conditional location to seederApi, instead include additional conf files in the same directory allowing for extensibility and not directly placing the non-prod seeder location in the config builder

---------

Co-authored-by: Matt Gibson <mgibson@bitwarden.com>
Co-authored-by: AJ Mabry <81774843+aj-bw@users.noreply.github.com>
2026-03-13 16:08:15 -04:00
Mick Letofsky
662828a16a Decouple seeder cipher encryption from internal vault crates (#7211) 2026-03-13 14:35:42 +01:00
mkincaid-bw
8688cfc024 Fixed invalid syntax in OrganizationUser_UpdateMany (#6923) 2026-03-12 16:25:33 -07:00
Mick Letofsky
20d94c37dd Add density profiles to Seeder CLI (#7205) 2026-03-12 15:04:07 +01:00
Mick Letofsky
3b9db315fd Add 9 scale presets and consolidated seeder docs (#7193)
* Add 9 scale presets and consolidated seeder docs
2026-03-11 17:16:41 +01:00
Mick Letofsky
bf40668fc8 Seeder - Adding density distributions (#7191) 2026-03-10 16:22:23 +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
Mick Letofsky
465cbf3fb3 Reorganize seeder presets into purpose-based folders and remove obsolete presets (#7176) 2026-03-10 06:16:10 +01:00
Samuel Warfield
d86b7fa584 [PM-27864] Add PQC TLS Support (#6547)
* Add PQC TLS Support

* Update util/Setup/NginxConfigBuilder.cs

Co-authored-by: Addison Beck <github@addisonbeck.com>

* Update util/Setup/NginxConfigBuilder.cs

Co-authored-by: Addison Beck <github@addisonbeck.com>

* Update util/Setup/NginxConfigBuilder.cs

Co-authored-by: Addison Beck <github@addisonbeck.com>

* Update util/Setup/NginxConfigBuilder.cs

Co-authored-by: Addison Beck <github@addisonbeck.com>

* Update util/Setup/Templates/NginxConfig.hbs

Co-authored-by: Vince Grassia <593223+vgrassia@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Vince Grassia <593223+vgrassia@users.noreply.github.com>

---------

Co-authored-by: Addison Beck <github@addisonbeck.com>
Co-authored-by: Vince Grassia <593223+vgrassia@users.noreply.github.com>
2026-03-09 13:06:57 -04:00
Ike
0d88aa1ca1 [PM-21925] Add MasterPasswordSalt Column to User Table (#6950)
feat: add MasterPasswordSalt column to User table

- Add MasterPasswordSalt column to User table in both Dapper and EF implementations
- Update User stored procedures (Create, Update, UpdateMasterPassword) to handle salt column
- Add EF migrations and update UserView with dependent views
- Set MaxLength constraint on MasterPasswordSalt column
- Update UserRepository implementations to manage salt field
- Add comprehensive test coverage for salt handling and normalization
2026-03-05 11:47:08 -05:00
Vijay Oommen
4785e62715 [PM-28531] Remove old proc and use new one (#7110) 2026-03-04 16:21:52 -06:00
Graham Walker
0a14d95779 PM-32517 Create Migration for Azure Blob Storage (#7111)
* PM-32517 initial migration commit

* pm-32517 fixing integration unit test

* PM-32517 removing .claude changes

* PM-32517 changing implementation of migration test

* PM-32517 adding type for ReportFile

* PM-32517 adding report file type

* PM-32517 changing unit tests

* PM-32517 adding new statement in migration script
2026-03-04 11:17:28 -06:00
mkincaid-bw
cc12c72854 Update SQL version to SQL 2022 CU22. (#6926) 2026-03-03 08:24:17 -08:00
Mick Letofsky
1961bb5cc9 Craft density modeling for Seeded vaults (#7102) 2026-02-27 18:07:49 +01:00
Matt Gibson
9ca1874723 Scene to create a folder for a user (#7099) 2026-02-27 09:35:42 +01:00
MtnBurrit0
25df3c381c Update Nginx base image to stable-alpine3.23 (#7091) 2026-02-26 14:09:11 -07:00
Jared Snider
18973a4f63 Auth/PM-32035 - Emergency Access - DeleteEmergencyAccessCommand refactor (#7054)
* PM-32035 - EmergencyAccessService - fix interface docs, method docs, and tests to cover grantee / grantor deletion which is supported today.

* PM-32035 - EmergencyAccessService - mark existing delete as deprecated

* PM-32035 - EmergencyAccess readme docs - fix deletion docs

* PM-32035 - Add new EmergencyAccessDetails_ReadByUserIds stored proc

* PM-32035 - Add migration script for EmergencyAccessDetails_ReadByUserIds

* PM-32035 - Build out GetManyDetailsByUserIdsAsync in repository layer plus add tests

* PM-32035 - EmergencyAccessRepo - DeleteManyAsync - remove grantee revision bump as not necessary since no EA sync data exists + update tests

* PM-32035 - Fix incorrect nullability annotation on EmergencyAccessDetails.GrantorEmail. Both the SQL view and EF projection use a LEFT JOIN to the User table, meaning the value can be null if the grantor's account no longer exists. Changed to string? and removed the required modifier since the class is only ever materialized from database queries, never directly instantiated.

* PM-32035 - Refactor DeleteEmergencyAccess command to offer new DeleteAllByUserIdAsync and DeleteAllByUserIdsAsync methods. Need to build out DeleteByIdAndUserIdAsync with a new stored proc.

* PM-32035 - Build out IEmergencyAccessRepository.GetDetailsByIdAsync because we need such a method in order to meet the product requirements to send grantor email notifications for normal deletions in the future.

* PM-32035 - Wire up DeleteEmergencyAccessCommand.DeleteByIdAndUserIdAsync to use new repository method emergencyAccessRepository.GetDetailsByIdAsync so we can send notifications. Now, it is full replacement for the existing emergency access service deletion method + has the new notification functionaliy requested.

* PM-32035 - Add more test coverage for DeleteByIdAndUserIdAsync

* PM-32035 - Fix missing GranteeAvatarColor and GrantorAvatarColor projections in EmergencyAccessDetailsViewQuery. The EF view query omitted both avatar color fields from its Select projection, causing the integration tests to fail on all non-SqlServer databases (MySql, Postgres, Sqlite) where EF is used instead of Dapper.

* PM-32035 - Rename migration after main merge revealed collision

* PM-32035 - Rename migration script

* PM-32035 - PR feedback - add ticket + todos to deprecated delete async method.

* PM-32035 - DeleteEmergencyAccessCommand - add logs if we don't have user data required to send email notifications.

* PM-32035 - PR Feedback - rename EmergencyAccessDetails_ReadByUserIds to EmergencyAccessDetails_ReadManyByUserIds
2026-02-26 12:49:26 -05:00
Mick Letofsky
d57428b684 Fix out of date seed endpoint example (#7075) 2026-02-25 14:48:28 +01:00
Mick Letofsky
86445b16d8 Incrementing our sdk-internal references to their latest released versions (#7074) 2026-02-25 12:33:00 +01:00
Mick Letofsky
3abb672903 Refactoring legacy Seeder Recipes (#7069) 2026-02-25 06:46:19 +01:00