1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-28 06:36:15 -05:00

2784 Commits

Author SHA1 Message Date
Conner Turnbull
43f31a312b
Merge branch 'main' into billing/license-refactor 2025-06-26 09:20:19 -04: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
Conner Turnbull
6fbd6ea303
Merge branch 'main' into billing/license-refactor 2025-06-25 10:56:53 -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é
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
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
Colton Hurst
cdfe51f9d6
[PM-22783] Add windows-desktop-autotype feature flag (#5990) 2025-06-20 14:02:48 -04: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
Jimmy Vo
4a12120950
[PM-19703] Fix admin count logic to exclude current organization (#5918) 2025-06-13 16:27:48 -04:00
Conner Turnbull
fa6427f3bf
Moved ValidateOrganizationsAsync out of LicensingService since its only usage was in ValidateOrganizationsJob 2025-06-12 13:50:40 -04:00
Jared McCannon
66a89245f9
[PM-20590] Correcting error provided when scaling provider org (#5951)
* Moved provider org check above organization stripe id checks.
2025-06-12 08:48:15 -05:00
Conner Turnbull
208d70d50e
Merge branch 'main' into billing/license-refactor 2025-06-12 08:47:45 -04:00
Conner Turnbull
b02e47eed7
Moved user license out of user service 2025-06-12 08:47:09 -04:00
Conner Turnbull
1f90def09e
Removed obsolete tag for now 2025-06-12 08:47:02 -04:00
Conner Turnbull
b4adbd7bb8
Removed constructors from OrganizationLicense 2025-06-12 08:47:02 -04:00
Conner Turnbull
a7e160a514
Removed remaining methods out of org and user licenses 2025-06-12 08:47:02 -04:00
Thomas Rittson
64b288035c
Chore: document SutProvider and clean up UserServiceTests (#5879)
* UserServiceTests - use builder pattern for SutProvider to reduce boilerplate
* SutProvider - add xmldoc
2025-06-12 10:21:05 +01:00
Thomas Rittson
463dc1232d
Add xmldoc for OrganizationUser (#5949) 2025-06-12 10:47:41 +10:00
Jimmy Vo
821f66e99f
[PM-22205] Fix logic for sending out revoked email (#5933) 2025-06-11 16:55:42 -04:00
Conner Turnbull
5ed8635f9c
Moved the remaining methods out of BaseLicense. Renamed GetDataBytes to ToByteArray 2025-06-11 09:40:40 -04:00
Conner Turnbull
c405092a1e
Moved VerifySignature out of the licenses and into an extension method 2025-06-11 09:40:40 -04:00
Conner Turnbull
7f28c4ff2f
Moved ComputeHash out of the licenses and into an extension method 2025-06-11 09:40:39 -04:00
Conner Turnbull
d8cb6dcfa9
Removed obsolete methods 2025-06-11 09:40:39 -04:00
Conner Turnbull
411d45ce94
Updated UserLicense to use ValidLicenseVersion 2025-06-11 09:40:39 -04:00
Conner Turnbull
83f088b0fb
Updated expiration, refresh, and isTrial logic to ensure it matches the original logic 2025-06-11 09:40:39 -04:00
Conner Turnbull
a7715632e7
Removed SignatureBytes since it had only one usage 2025-06-11 09:40:39 -04:00
Conner Turnbull
6181d0961c
Updated LicenseIgnore to target Signature instead of Hash 2025-06-11 09:40:39 -04:00
Conner Turnbull
181e2ff551
Moved expires/refresh/trial methods to extension methods to be reused later 2025-06-11 09:40:39 -04:00
Conner Turnbull
6b472882b0
Extracted the core logic of GetDataBytes to be shared between both files 2025-06-11 09:40:39 -04:00
Conner Turnbull
e501d1dd6a
Reordered properties so that they appear in order according to their version number first, then data type, then name 2025-06-11 09:40:39 -04:00
Conner Turnbull
d6b7c5f16b
Updated GetDataBytes to use the new attributes instead of hardcoding the version logic 2025-06-11 09:40:39 -04:00
Conner Turnbull
3aa63d2ce2
Decorated license properties with newly created attributes 2025-06-11 09:40:38 -04:00
Conner Turnbull
c9e9288396
Created LicenseIgnoreAttribute 2025-06-11 09:40:38 -04:00