1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-27 06:08:48 -05:00

5970 Commits

Author SHA1 Message Date
Rui Tomé
ec8b724aeb
Merge branch 'main' into ac/pm-22101/enforce-restrictions-on-default-collection 2025-06-27 11:19:47 +01:00
Brant DeBow
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
Alex Morask
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
renovate[bot]
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
tangowithfoxtrot
82aa47ad42
fix(events): re-add kerberos tools to container image (#6007) 2025-06-26 07:49:30 -07:00
Brant DeBow
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
cyprain-okeke
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
Daniel James Smith
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
Andy Pixley
71aae24246
[BRE-848] Fixing release workflow permissions (#6002) 2025-06-25 14:39:35 -04:00
tangowithfoxtrot
5d9071da1f
fix: failed db migrations due to missing kerberos tools (#6005) 2025-06-25 10:20:42 -07:00
rr-bw
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
Rui Tome
0ac72cf2c9
Update UpdateOrganizationUserCommandTests to use OrganizationUserType for user updates 2025-06-25 14:30:43 +01:00
Rui Tome
74e604347b
Remove unused test method for handling DefaultUserCollection in CollectionsControllerTests 2025-06-25 14:29:59 +01:00
Rui Tome
aa655b6024
Merge branch 'main' into ac/pm-22101/enforce-restrictions-on-default-collection 2025-06-25 14:17:57 +01:00
SmithThe4th
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
Vijay Oommen
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
Nick Krantz
51e93c7323
add end user activation feature flag (#5989) 2025-06-24 13:02:07 -05:00
cyprain-okeke
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
Bernd Schoolmann
34580f0472
Remove key rotation v1 (#5939) 2025-06-24 16:32:38 +02:00
Brandon Treston
70703cb3b0
[PM-20633] rename personal ownership (#5978)
* rename personal ownership

* rename enums, files, tests
2025-06-24 10:29:09 -04:00
Vijay Oommen
86a4ce5a51
[PM-20576] OrganizationReport - Queries and Command (#5983) 2025-06-24 09:13:43 -05:00
Rui Tomé
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
Rui Tomé
cc07f13c7c
[PM-22442] Remove unused user management methods from CollectionsController (#5969) 2025-06-24 10:21:48 +01:00
Rui Tomé
77bf849d85
[PM-22105] Extract CollectionService.SaveAsync into commands (#5959)
* 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
2025-06-24 10:19:48 +01:00
Justin Baur
2da1b43c10
Devcontainer restart enhancements (#5965)
* Add environment variable options to quickly start the devcontainer

Co-authored-by: tangowithfoxtrot <tangowithfoxtrot@users.noreply.github.com>

* Fix DEV_CERT_CONTENTS

---------

Co-authored-by: tangowithfoxtrot <tangowithfoxtrot@users.noreply.github.com>
2025-06-23 20:23:23 -04:00
Graham Walker
173db0a2dd
PM-20574 & PM-20575 Adding Risk Insight Report tables, repositories, and migrations (#5839)
* 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-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-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

* Update 2025-06-13-00_OrganizationReport.sql

---------

Co-authored-by: voommen-livefront <voommen@livefront.com>
2025-06-23 12:12:04 -05:00
Jared McCannon
d2410747d0
[PM-22503] Fix manage cipher permission (#5972)
* Added new tests to validate that the ciphers are being grouped and filtered correctly when assigned to multiple collections and changing order of grouping properties.
2025-06-23 11:11:32 -05:00
Colton Hurst
cdfe51f9d6
[PM-22783] Add windows-desktop-autotype feature flag (#5990) 2025-06-20 14:02:48 -04:00
Andy Pixley
b13c950328
[BRE-848] Adding Workflow Permissions (#5985) 2025-06-20 12:15:38 -04:00
Addison Beck
91b4ef756b
build(ci): remove the need to cherry pick version bumps to rc (#5977) 2025-06-18 16:47:30 +02:00
Nick Krantz
05d74754d2
add PM22134SdkCipherListView feature flag (#5980) 2025-06-18 09:29:48 -05:00
Brant DeBow
502ab4b645
[PM-17562] Fix flickering unit test - WebhookIntegrationHandlerTests (#5973)
* [PM-17562] Fix flickering unit test - WebhookIntegrationHandlerTests

* Adjust to using TimeProvider and exact time matches

* Refactored RabittMqIntegrationListenerService and Tests to align on TimeProvider. Cleaned up tests that do not need to use DateTime.UtcNow
2025-06-18 10:09:47 -04:00
Justin Baur
6800bc57f3
[PM-18555] Main part of notifications refactor (#5757)
* More tests

* More  tests

* Add non-guid tests

* Introduce slimmer services

* Implement IPushEngine on services

* Implement IPushEngine

* Fix tests

* Format

* Switch to `Guid` on `PushSendRequestModel`

* Remove TODOs
2025-06-17 13:30:56 -04:00
Vincent Salucci
6dc26f4be6
chore: remove external id feature flag, refs PM-18634 (#5974) 2025-06-17 10:55:42 -05:00
✨ Audrey ✨
a3c5741164
[PM-22610] validate file within max length; log deletion of invalid uploads (#5960) 2025-06-17 15:07:26 +00:00
Patrick Honkonen
0a5dc04d9e
[PM-22458] Add user managed privileged apps FF for Android (#5935) 2025-06-17 14:48:11 +00:00
Alexey Zilber
17507446a4
Added SendGridApiHost to Globals (#5961)
* Added SendGridApiHost to Globals

* Added SendGridApiHost for test coverage
2025-06-17 21:35:38 +08:00
Brant DeBow
a529492d1d
[PM-17562] Update documentation for event integrations (#5924)
* [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

* Fix the formatting for inlined code snippets

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

---------

Co-authored-by: Matt Bishop <mbishop@bitwarden.com>
2025-06-17 08:38:16 -04:00
Rui Tomé
5ffa937914
[PM-22098] Create default collection when organization member is confirmed (#5944)
* Add RequiresDefaultCollection method to PersonalOwnershipPolicyRequirement

* Add CreateDefaultLocation feature flag to Constants.cs

* Add DefaultUserCollectionName property to OrganizationUserConfirmRequestModel with encryption attributes

* Update PersonalOwnershipPolicyRequirement instantiation in tests to use constructor with parameters instead of property assignment

* Enhance ConfirmOrganizationUserCommand to support default user collection creation. Added logic to check if a default collection is required based on organization policies and feature flags. Updated ConfirmUserAsync method signature to include an optional defaultUserCollectionName parameter. Added corresponding tests to validate the new functionality.

* Refactor Confirm method in OrganizationUsersController to use Guid parameters directly, simplifying the code. Updated ConfirmUserAsync call to include DefaultUserCollectionName from the input model.

* Move logic for handling confirmation side effects into a separate method

* Refactor PersonalOwnershipPolicyRequirement to use enum for ownership state

- Introduced PersonalOwnershipState enum to represent allowed and restricted states.
- Updated PersonalOwnershipPolicyRequirement constructor and properties to utilize the new enum.
- Modified related classes and tests to reflect changes in ownership state handling.
2025-06-17 12:20:22 +01:00
Tom
b8244908ec
[PM-20112] Member access stored proc and splitting the query (#5943) 2025-06-16 16:32:36 -05:00
Github Actions
66d1c70dc6 Bumped version to 2025.6.2 2025-06-16 13:09:36 +00:00
Rui Tome
308e8f4d72
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.
2025-06-16 13:15:12 +01:00
Rui Tome
bcb90f2913
Implement a check to throw a BadRequestException if an attempt is made to modify member access for collections of type DefaultUserCollection. 2025-06-16 13:09:00 +01:00
Jimmy Vo
4a12120950
[PM-19703] Fix admin count logic to exclude current organization (#5918) 2025-06-13 16:27:48 -04:00
Rui Tome
4d36e87b6f
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.
2025-06-13 15:00:01 +01:00
Rui Tome
f1afc653e3
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.
2025-06-13 14:51:59 +01:00
Rui Tome
e76763fcb2
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.
2025-06-13 14:51:15 +01:00
Rui Tome
947ba9ec8f
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.
2025-06-13 14:50:39 +01:00
Rui Tome
6ec844a7a6
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.
2025-06-13 14:49:56 +01:00
Rui Tome
bf9f7709ae
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.
2025-06-13 14:49:10 +01:00