Commit Graph

1160 Commits

Author SHA1 Message Date
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
Thomas Rittson
e3c392badb [PM-32131] Add UseMyItems organization ability (#7014)
Purpose: UseMyItems is a new organization ability / plan flag
which is automatically enabled where UsePolicies is enabled,
but can be selectively disabled to disable My Items creation
when the Organization Data Ownership policy is turned on.

- new organization table column with all sprocs and views updated
- data migration to enable the feature for all organizations that already use policies (replicating existing behaviour)
- data and api models updated
- added to organization license file so it can be preserved in self-hosted instances
- note that we don't have a plan feature defined for this yet, so it is set based on UsePolicies to match the migration logic. Billing Team have a ticket to add this
2026-02-24 19:52:28 -07:00
Mick Letofsky
0d8b920550 Seeder simplifying and extending seeds (#7065) 2026-02-24 17:28:49 +00:00
Mick Letofsky
60bbf00160 Seeder/resolve owner roster quirk (#7059) 2026-02-24 07:47:29 +01:00
Mick Letofsky
a0af85a1f0 Resolving bug with Mangler and Organizations (#7057) 2026-02-23 14:47:25 +01:00
Mick Letofsky
73756d0d08 Bring our QA Setup data files into the Seeder as presets (#7046)
* Importing test fixtures from test repo into the Seeder
* Needed to ensure that we assigned permission to collections; not just made them.
2026-02-23 12:01:05 +01:00
Maciej Zieniuk
6a7b8f5a89 [PM-31052][PM-32469] Add V2UpgradeToken for key rotation without logout (#6995)
* User V2UpgradeToken for key rotation without logout

* reset old v2 upgrade token on manual key rotation

* sql migration fix

* missing table column

* missing view update

* tests for V2UpgradeToken clearing on manual key rotation

* V2 to V2 rotation causes logout. Updated wrapped key 1 to be a valid V2 encrypted string in tests.

* integration tests failures - increase assert recent for date time type from 2 to 5 seconds (usually for UpdatedAt assertions)

* repository test coverage

* migration script update

* new EF migration scripts

* broken EF migration scripts fixed

* refresh views due to User table alternation
2026-02-20 20:19:14 +01:00
Matt Bishop
c7785cd491 Add startup art to seeder utility (#7045) 2026-02-20 08:06:45 +01:00
Mick Letofsky
507c3a105c Refactoring structure of the CLI to be more maintainable long-term (#7042)
* Refactoring structure of the CLI to be more maintainable long-term
* Remove obvious comments & put back XML comments
2026-02-19 18:40:48 +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
Alex Morask
cfd5bedae0 [PM-31040] Replace ISetupIntentCache with customer-based approach (#6954)
* docs(billing): add design document for replacing SetupIntent cache

* docs(billing): add implementation plan for replacing SetupIntent cache

* feat(db): add gateway lookup stored procedures for Organization, Provider, and User

* feat(db): add gateway lookup indexes to Organization, Provider, and User table definitions

* chore(db): add SQL Server migration for gateway lookup indexes and stored procedures

* feat(repos): add gateway lookup methods to IOrganizationRepository and Dapper implementation

* feat(repos): add gateway lookup methods to IProviderRepository and Dapper implementation

* feat(repos): add gateway lookup methods to IUserRepository and Dapper implementation

* feat(repos): add EF OrganizationRepository gateway lookup methods and index configuration

* feat(repos): add EF ProviderRepository gateway lookup methods and index configuration

* feat(repos): add EF UserRepository gateway lookup methods and index configuration

* chore(db): add EF migrations for gateway lookup indexes

* refactor(billing): update SetupIntentSucceededHandler to use repository instead of cache

* refactor(billing): simplify StripeEventService by expanding customer on SetupIntent

* refactor(billing): query Stripe for SetupIntents by customer ID in GetPaymentMethodQuery

* refactor(billing): query Stripe for SetupIntents by customer ID in HasPaymentMethodQuery

* refactor(billing): update OrganizationBillingService to set customer on SetupIntent

* refactor(billing): update ProviderBillingService to set customer on SetupIntent and query by customer

* refactor(billing): update UpdatePaymentMethodCommand to set customer on SetupIntent

* refactor(billing): remove bank account support from CreatePremiumCloudHostedSubscriptionCommand

* refactor(billing): remove OrganizationBillingService.UpdatePaymentMethod dead code

* refactor(billing): remove ProviderBillingService.UpdatePaymentMethod

* refactor(billing): remove PremiumUserBillingService.UpdatePaymentMethod and UserService.ReplacePaymentMethodAsync

* refactor(billing): remove SubscriberService.UpdatePaymentSource and related dead code

* refactor(billing): update SubscriberService.GetPaymentSourceAsync to query Stripe by customer ID

Add Task 15a to plan - this was a missed requirement for updating
GetPaymentSourceAsync which still used the cache.

* refactor(billing): complete removal of PremiumUserBillingService.Finalize and UserService.SignUpPremiumAsync

* refactor(billing): remove ISetupIntentCache and SetupIntentDistributedCache

* chore: remove temporary planning documents

* chore: run dotnet format

* fix(billing): add MaxLength(50) to Provider gateway ID properties

* chore(db): add EF migrations for Provider gateway column lengths

* chore: run dotnet format

* chore: rename SQL migration for chronological order
2026-02-18 13:20:25 -06:00
Mick Letofsky
81120bd24e Enhance seeder allowing for a user-defined password (#7021) 2026-02-18 06:48:05 +01:00
Kyle Denney
f0c69cedc2 [PM-30108] import discount from stripe (#6982)
* [PM-30108] import discount from stripe

* fix repo tests

* pr feedback

* wrap discounts in feature flag

* claude pr feedback
2026-02-17 12:57:14 -06:00
Mick Letofsky
07049b367a Seeder Enhancements - Phase 3 (#6973) 2026-02-17 07:42:53 +01:00
Matt Gibson
cde8ceca31 Add query for email verification link (#6984)
* Add query for email verification link

* PR comments
2026-02-12 15:16:50 +00:00
Matt Gibson
902be7dfb8 Require password when seeding a new user (#6978) 2026-02-10 19:01:50 +00:00
Alex Dragovich
6d43cc43e3 [PM-31684] Remove email hashing for send access (#6945)
* [PM-31684] Remove email hashing for send access

* [PM-31684] switching the order of migration files

* [PM-31684] adding more migrations

* [PM-31684] Removing anon access emails field  and reusing emails field

* [PM-31684] cleanup before adding migrations back

* [PM-31684] restore original snapshots

* [PM-31684] restore original postgres snapshots

* [PM-31684] adding migrations

* [PM-31684] removing encryption attributes from emails request model

* [PM-31684] adding missing stored proc alters

* [PM-31684] Improved formatting for stored proc defs

* [PM-31684] adding necessary comment back

* [PM-31684] adding case-insensitive check on the server for send auth
2026-02-09 12:58:57 -08:00
sven-bitwarden
70c01bcfb2 [PM-25106] Refactor Misleading Stored Procedure/Repository Language (#6890)
* Begin migration to appropriately named sprocs

* Update method and parameter names

* Remove incorrect change

* Changes EF to match collection type comparison

* Adds integration test verifying excluded collections

* Changes EF to match collection type comparison

* Fix whitespacing

* Fix dedented if
2026-02-09 09:25:10 -06:00
cyprain-okeke
67ba9bcca5 [PM 30100][Server] Subscription Discount Database Infrastructure (#6936)
* Implement the detail Subscription Discount Database Infrastructure

* Change string to string list

* fix lint error

* Create all missing database object definition files

* Regenerate EF migrations with Designer files

The previous migrations were missing .Designer.cs files. This commit:
- Removes the incomplete migration files
- Regenerates all three provider migrations (MySQL, Postgres, SQLite) with proper Designer files
- Updates DatabaseContextModelSnapshot.cs for each provider

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix failing database

* Resolve the lint  warnings

* Resolve the database failure

* Fix the build Lint

* resolve the dbops reviews

* Add the default value

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-02-06 18:24:26 +01:00
Mick Letofsky
4eb9c4cf3c Enhance seeder with additional cipher types and architectural refactorings (#6935) 2026-02-04 19:27:09 +01:00
Ike
68e67e1853 [PM-26376] Emergency Access Delete Command (#6857)
* feat: Add initial DeleteEmergencyContactCommand

* chore: remove nullable enable and add comments

* test: add tests for new delete command

* test: update tests to test IMailer was called.

* feat: add delete by GranteeId and allow for multiple grantors to be contacted.

* feat: add DeleteMany stored procedure for EmergencyAccess

* test: add database tests for new SP

* feat: commands use DeleteManyById for emergencyAccessDeletes

* claude: send one email per grantor instead of a bulk email to all grantors. Modified tests to validate.

* feat: change revision dates for confirmed grantees; 

* feat: add AccountRevisionDate bump for grantee users in the confirmed status

* test: update integration test to validate only confirmed users are updated as well as proper deletion of emergency access
2026-02-03 16:43:44 -05:00
Mick Letofsky
5941e830d2 Refactor to correctly implement statics and remove hardcoded organization keys (#6924) 2026-01-30 16:03:56 +01:00