1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-14 22:27:32 -05:00
Commit Graph

5982 Commits

Author SHA1 Message Date
37cdefbf89 Add #nullable disable to DIRT code (#6059) 2025-07-08 11:48:02 -04:00
85b2a5bd94 Add #nullable disable to billing code (#6054) 2025-07-08 11:46:24 -04:00
50461518e7 Add #nullable disable to vault code (#6053) 2025-07-08 11:46:13 -04:00
fa0c9cb387 Add #nullable disable to platform code (#6057) 2025-07-08 10:25:59 -04:00
7fb7d6fa56 Add #nullable disable to auth code (#6055) 2025-07-08 10:25:41 -04:00
b61063ceb4 Changing seat count for validating secrets manager. (#6035) 2025-07-08 07:54:53 -05:00
799327e933 [deps] DbOps: Update Microsoft.Azure.Cosmos to 3.52.0 (#6044)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-07 18:15:56 -04:00
ead29eed7a chore(feature flag): [PM-18562] Remove installation-last-activity-date from server
* Removed flag.

* Changed to remove variable.
2025-07-07 17:38:52 -04:00
af75fdbe36 [PM-21370] Update Github Action grouping (#5790)
* Update Github Action grouping

* Undid codeowners change.
2025-07-07 16:07:02 -04:00
737f549f82 feat(otp): [PM-18612] Consolidate all email OTP to use 6 digits
* Change email OTP to 6 digits

* Added comment on base class
2025-07-07 15:52:30 -04:00
79ad1dbda0 fix(2fa): [PM-22323] Do not show 2FA warning for 2FA setup and login emails
* Added configuration to not display 2FA setup instruction

* Refactored to new service.

* Linting.

* Dependency injection

* Changed to scoped to have access to ICurrentContext.

* Inverted logic for EmailTotpAction

* Fixed tests.

* Fixed tests.

* More tests.

* Fixed tests.

* Linting.

* Added tests at controller level.

* Linting

* Fixed error in test.

* Review updates.

* Accidentally deleted imports.
2025-07-07 10:56:59 -04:00
240968ef4c Refactor PendingSecurityTasks to RefreshSecurityTasks (#5903)
- Allows for more general use case of security task notifications
2025-07-07 09:24:57 -05:00
5dde9ac924 [deps] Tools: Update aws-sdk-net monorepo (#6039)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-07 11:16:53 +02:00
b17f0ca41c [deps] Tools: Update MailKit to 4.13.0 (#6045)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-07 11:14:55 +02:00
3302f05276 Migrate KM code to have #nullable disable (#6023) 2025-07-03 09:40:55 -04:00
fafdfd6fbd Migrate AC code to have #nullable disable (#6027) 2025-07-03 09:40:34 -04:00
669a5cb372 [SM-1273] Adding new logging for secrets (#5991)
* Adding new logging for secrets

* fixing secrest controller tests

* fixing the tests
2025-07-02 22:28:48 -04:00
b7df8525af PM-23030 adding migration script (#6009)
* PM-23030 adding migration script

* PM-23030 fixing store procedure sql file

* PM-23030 fixing syntax error

* PM-23030 fixing migration

* PM-23030 fixing sql script

* PM-23030 fixing migration order

* PM_23030 fixing migrations

* PM-23030 fixing migration script validation error

* PM-23030 fixing migration

* PM-23030 trying to fix validation error

* PM-23030 fixing migration script

* PM-23030 updating sql scripts to change data type

* PM-23030 adding report key to organization application

* PM-23030 adding report key migration scripts

* PM-23030 adding migration scripts

* PM-23030 changing key column name
2025-07-02 14:56:15 -05:00
c6d38d9db3 Remove unused ctor dependencies from OrgExportController (#6018)
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2025-07-02 08:18:47 -04:00
8d547dcc28 feat(DuckDuckGo): Added DuckDuckGo browser device type 2025-07-01 17:31:22 -04:00
f6cd661e8e [PM-17562] Add HEC integration support (#6010)
* [PM-17562] Add HEC integration support

* Re-ordered parameters per PR suggestion

* Apply suggestions from code review

Co-authored-by: Matt Bishop <mbishop@bitwarden.com>

* Refactored webhook request model validation to be more clear

---------

Co-authored-by: Matt Bishop <mbishop@bitwarden.com>
2025-07-01 08:52:38 -04:00
e8ad23c8bc [PM-22442] Remove CollectionService (#6015)
* Refactor Collections and OrganizationExport Controllers to Remove ICollectionService Dependency

* Remove ICollectionService registration from ServiceCollectionExtensions

* Remove CollectionServiceTests file as part of the ongoing refactor to eliminate ICollectionService.

* Remove ICollectionService and its implementation in CollectionService as part of the ongoing refactor to eliminate the service.
2025-07-01 13:17:53 +01:00
Ike
20bf1455cf [PM-20348] Add pending auth request endpoint (#5957)
* Feat(pm-20348): 
  * Add migration scripts for Read Pending Auth Requests by UserId stored procedure and new `view` for pending AuthRequest. 
  * View only returns the most recent pending authRequest, or none at all if the most recent is answered.
  * Implement stored procedure in AuthRequestRepository for both Dapper and Entity Framework.
  * Update AuthRequestController to query the new View to get a user's most recent pending auth requests response includes the requesting deviceId.

* Doc: 
  * Move summary xml comments to interface.
  * Added comments for the AuthRequestService.

* Test: 
  * Added testing for AuthRequestsController.
  * Added testing for repositories. 
  * Added integration tests for multiple auth requests but only returning the most recent.
2025-06-30 13:17:51 -04:00
899ff1b660 [deps] Tools: Update aws-sdk-net monorepo to v4 (#5874)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-30 17:56:53 +02:00
1da39aa2b8 [PM-22405] Add debugging instrument for finding invalid OrganizationUser state. (#5955) 2025-06-30 09:45:15 -04:00
4eb2134e10 Bumped version to 2025.7.0 2025-06-30 13:12:58 +00:00
386b391dd7 Remove GetManyDetailsByUserAsync & ReplaceAsync DB Calls (#6012) 2025-06-30 08:08:01 -04:00
69b7600eab [PM-20041] Deleting Notifications when Task is completed (#5896)
* mark all notifications associated with a security task as deleted when the task is completed

* fix spelling

* formatting

* refactor "Active" to "NonDeleted"

* refactor "Active" to "NonDeleted" for stored procedure

* only send notifications per user for each notification

* move notification status updates into the DB layer to save on multiple queries and insertions from the C#

* Only return UserIds from db layer

* omit userId from `MarkTaskAsCompletedCommand` query.

The userId from the notification will be used

* update UserIds

* consistency in comments regarding `taskId` and `UserId`
2025-06-27 16:04:47 -05:00
c441fa27dd Removing feature flag (#5997) 2025-06-27 13:13:41 -05:00
8bccf255c0 [PM-22974] Cascade delete NotificationStatus entities (#6011)
* cascade delete NotificationStatus entities

* add userId to test for foreign constraint

* add missing properties for Notification

* add check for foreign key
2025-06-27 11:17:47 -05:00
290fa3ded4 [PM-22101] Enforce restrictions on collections with DefaultUserCollection type (#5968)
* Add CreateCollectionCommand and associated interface with validation logic

* Implement CreateCollectionCommand to handle collection creation with organization checks and access permissions.
* Introduce ICreateCollectionCommand interface for defining the collection creation contract.
* Add unit tests for CreateCollectionCommand to validate various scenarios including permission checks and error handling.

* Add UpdateCollectionCommand and associated interface with validation logic

* Implement UpdateCollectionCommand to handle collection updates with organization checks and access permissions.
* Introduce IUpdateCollectionCommand interface for defining the collection update contract.
* Add unit tests for UpdateCollectionCommand to validate various scenarios including permission checks and error handling.

* Add scoped services for collection commands

* Register ICreateCollectionCommand and IUpdateCollectionCommand in the service collection for handling collection creation and updates.

* Refactor CollectionsController to use command interfaces for collection creation and updates

* Updated CollectionsController to utilize ICreateCollectionCommand and IUpdateCollectionCommand for handling collection creation and updates, replacing calls to ICollectionService.
* Adjusted related unit tests to verify the new command implementations.

* Refactor ICollectionService and CollectionService to remove SaveAsync method

* Removed the SaveAsync method from ICollectionService and its implementation in CollectionService.
* Updated related tests in CollectionServiceTests to reflect the removal of SaveAsync, ensuring existing functionality remains intact.

* Remove unused organization repository dependency from CollectionServiceTests

* Add validation to CreateCollectionCommand to prevent creation of DefaultUserCollection type

* Implemented a check in CreateCollectionCommand to throw a BadRequestException if a collection of type DefaultUserCollection is attempted to be created.
* Added a unit test to verify that the exception is thrown with the correct message when attempting to create a collection of this type.

* Add validation to DeleteCollectionCommand to prevent deletion of DefaultUserCollection type

* Implemented checks in DeleteAsync and DeleteManyAsync methods to throw a BadRequestException if a collection of type DefaultUserCollection is attempted to be deleted.
* Added unit tests to verify that the exceptions are thrown with the correct messages when attempting to delete collections of this type.

* Add validation in UpdateCollectionCommand to prevent editing DefaultUserCollection type

* Implemented a check in UpdateAsync to throw a BadRequestException if a collection of type DefaultUserCollection is attempted to be updated.
* Added a unit test to verify that the exception is thrown with the correct message when attempting to update a collection of this type.

* Add validation in UpdateOrganizationUserCommand to prevent modification of DefaultUserCollection type

* Implemented a check to throw a BadRequestException if an attempt is made to modify member access for collections of type DefaultUserCollection.
* Added a unit test to ensure the exception is thrown with the correct message when this condition is met.

* Add validation in UpdateGroupCommand to prevent modification of DefaultUserCollection type

* Implemented a check to throw a BadRequestException if an attempt is made to modify group access for collections of type DefaultUserCollection.
* Added a unit test to ensure the exception is thrown with the correct message when this condition is met.

* Add validation in BulkAddCollectionAccessCommand to prevent addition of collections of DefaultUserCollection type

* Implemented a check to throw a BadRequestException if an attempt is made to add access to collections of type DefaultUserCollection.
* Added a unit test to ensure the exception is thrown with the correct message when this condition is met.

* Add validation in CollectionService to prevent modification of DefaultUserCollection type

* Implemented a check in DeleteUserAsync to throw a BadRequestException if an attempt is made to modify member access for collections of type DefaultUserCollection.
* Added a unit test to ensure the exception is thrown with the correct message when this condition is met.

* Implement a check to throw a BadRequestException if an attempt is made to modify member access for collections of type DefaultUserCollection.

* Add validation in CollectionsController to prevent deletion of DefaultUserCollection type

* Implemented a check to return a BadRequestObjectResult if an attempt is made to delete a collection of type DefaultUserCollection.

* Remove unused test method for handling DefaultUserCollection in CollectionsControllerTests

* Update UpdateOrganizationUserCommandTests to use OrganizationUserType for user updates
2025-06-27 15:29:34 +01:00
57cd628de8 [PM-17562] Add integration filter support (#5971)
* [PM-17562] Add integration filter support

* Repond to PR feedback; Remove Date-related filters

* Use tables to format the filter class descriptions

* [PM-17562] Add database support for integration filters (#5988)

* [PM-17562] Add database support for integration filters

* Respond to PR review - fix database scripts

* Further database updates; fix Filters to be last in views, stored procs, etc

* Fix for missing nulls in stored procedures in main migration script

* Reorder Filters to the bottom of OrganizationIntegrationConfiguration

* Separate out the creation of filters from the IntegrationFilterService to IntegrationFIlterFactory

* Move properties to static readonly field

* Fix unit tests failing from merge

---------

Co-authored-by: Matt Bishop <mbishop@bitwarden.com>
2025-06-26 16:03:05 -04:00
b951b38c37 [PM-21734] Read claims from ClaimsPrincipal when creating self-hosted organization (#5953)
* Read claims from claims principal when creating self-hosted organization

* Run dotnet format

* Jared's feedback

* Run dotnet format
2025-06-26 14:14:05 -05:00
1c3bf259e9 chore(deps): Platform: Update LaunchDarkly.ServerSdk to 8.9.1
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-26 12:48:27 -04:00
82aa47ad42 fix(events): re-add kerberos tools to container image (#6007) 2025-06-26 07:49:30 -07:00
b418b07f26 [PM-17562] Add support for Auth on Webhook integration requests (#5970)
* [PM-17562] Update documentation for event integrations

* Fix SonarQube suggestion, bring ASB event listener in line with integration listener

* Apply suggestions from code review

Co-authored-by: Matt Bishop <mbishop@bitwarden.com>

* Updates to README - PR fixes, additional context, tense alignment

* Add links to different sections; remove inline code formatting in favor of single bacticks for JSON

* [PM-17562] Add aupport for Auth on Webhook integration requests

* Repsond to PR feedback - move optional params to end, add tests for optional cases

---------

Co-authored-by: Matt Bishop <mbishop@bitwarden.com>
2025-06-26 09:19:49 -04:00
7fd1ccb7a2 [PM-18699] Add trial path to Stripe metadata (#5940)
* Add the market and product initiated change

* Resolve the failing test

* revert the change

* resolve the failing test

* Resolve the failing test

* revert the add skipstrial

* Revert add the new bool SkipTrial

* Revert the changes

* Revert the changes on the organizationsale

* remove the trailsource property

* Remove the CustomerSetup added

* Add the improved code change for trial metadata

* Revert the changes on GetSubscriptionSetup

* Assign the InitiationPath
2025-06-26 13:38:14 +01:00
49816e0926 Remove unused feature flag "item-share" (#6003)
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2025-06-26 08:17:35 -04:00
71aae24246 [BRE-848] Fixing release workflow permissions (#6002) 2025-06-25 14:39:35 -04:00
5d9071da1f fix: failed db migrations due to missing kerberos tools (#6005) 2025-06-25 10:20:42 -07:00
0f12d076ec fix(grantor-policies): [PM-21921] add null check (#5886)
When getting grantor policies, adds a null check so that:
- For a Grantor who is an org Owner, we respond with a `200` and the policies
- For a Grantor is not an org Owner, we respond with a `200` and `null`
2025-06-25 09:30:51 -07:00
2af4e9ccfa [PM-22812] [PM-22985] Attachments get corrupted when downgrading from cipherkeys (#5998)
* Reverted change that didn't include the attachments when updating

* Made change to cipher_update
2025-06-25 09:11:19 -04:00
74964bf170 [PM-20577] OrganizationReport endpoints (#5986)
* PM-20574 fixing namespaces on reporting work that got moved over from tools

* PM-20574 adding tables, stored procedures, and migration files

* PM-20574 adding dapper and ef repos and migrations

* PM-20574 changing table and repo names as requested

* PM-20574 updating sql scripts to new names

* PM-20574 updating sql scripts

* PM-20574 updating migration script for org delete by id

* PM-20574 adding mysql migration

* PM-20574 updating sql migration to fix database test

* PM-20574 fixing migration script

* PM-20574 fixing migration script

* PM-20574 fixing table scripts

* PM-20574 fixing table scripts

* PM-20574 fixing migration script formatting

* PM-20574 fixing syntax in migration script

* PM-20574 fixing file names and extensions

* PM-20574 fixing sql file

* PM-20574 fixing sql

* PM-20574 fixing directory for entities and removing scripts from other databases

* PM-20574 generating new migration scripts

* PM-20574 fixed reference to a stored proc

* PM-20574 adding index in scripts and missing table

* PM-20574 fixing merge conflicts

* PM-20574 set OUTPUT param for Id property in create and update proc

* PM-20574 add CreateDate to the update proc

* PM-20574 amend update proc for OrganizationApplication by adding createDate

* PM-20576 Created OrganizationReportRepo and unit tests

* PM-20576 Commands and Query for OrganizationReport

* PM-20576 added additional unit tests to fix CodeCoverage report

* PM-20574 formatted sql and updated as per PR comments

* PM-20574 updated script to fix build error

* PM-20574 fixed inconsistency in db script

* PM-20577 organization-reports endpoints

* PM-20574 removed revisionDate, update procedures and used views

* PM-20574 removed RevisionDate from designer files

* PM-20574 removed revisionDate column that was missed previously

* PM-20574 added revision date back into the mix

* PM-20574 updated database script to fix build error

* PM-20574 fixed a procedure issue

* PM-20574 fix dB build error

* PM-020574 fixed additional PR comments - files cleaned up

* PM-20574 updated procedure was inconsistent

* PM-20576 added logs and updated errors as per PR comments

* PM-20576 fixed a build error

* PM-20576 removed RevisionDate from Repo and tests

* PM-20576 added dependency

* PM-20576 removed unwanted line from csproj file

---------

Co-authored-by: Graham Walker <gwalker@bitwarden.com>
Co-authored-by: Tom <144813356+ttalty@users.noreply.github.com>
2025-06-24 14:53:04 -05:00
51e93c7323 add end user activation feature flag (#5989) 2025-06-24 13:02:07 -05:00
d33b0ce1cf [PM 18208]Cancel self-serve trials with no payment method (#5916)
* cancel self-serve trials with no payment method

* Remove unnecessary code block

* Update the invoice create  for missing paymentMethod

* Remove the create_invoice implementation

* Remove empty spaces
2025-06-24 16:58:43 +01:00
34580f0472 Remove key rotation v1 (#5939) 2025-06-24 16:32:38 +02:00
70703cb3b0 [PM-20633] rename personal ownership (#5978)
* rename personal ownership

* rename enums, files, tests
2025-06-24 10:29:09 -04:00
86a4ce5a51 [PM-20576] OrganizationReport - Queries and Command (#5983) 2025-06-24 09:13:43 -05:00
494c41e3b1 [PM-15160] Create ResellerClientOrganizationSignUpCommand (#5981)
* Implement ResellerClientOrganizationSignUpCommand for signing up reseller client organizations with email invitations and error handling

* Refactor ProvidersController to replace IOrganizationService with IResellerClientOrganizationSignUpCommand for organization sign-up process

* Remove CreatePendingOrganization method from IOrganizationService and its implementation in OrganizationService

* Add IResellerClientOrganizationSignUpCommand to service collection for organization sign-up

* Add comment to clarify organization deletion process in ResellerClientOrganizationSignUpCommand
2025-06-24 13:33:09 +01:00
cc07f13c7c [PM-22442] Remove unused user management methods from CollectionsController (#5969) 2025-06-24 10:21:48 +01:00