1
0
mirror of https://github.com/bitwarden/server.git synced 2025-05-31 00:00:34 -05:00

5866 Commits

Author SHA1 Message Date
Daniel James Smith
93962debd6
Fix test that relied on reference events throwing 2025-05-29 13:56:01 +02:00
Daniel James Smith
ea308f51df
Remove gathering and reporting of ReferenceEvents 2025-05-29 12:58:44 +02:00
Rui Tomé
829ce86066
[PM-18238] Add RequireTwoFactorPolicyRequirement (#5840)
* Add RequireTwoFactorPolicyRequirement and its factory with unit tests

* Implemented RequireTwoFactorPolicyRequirement to enforce two-factor authentication policies.
* Created RequireTwoFactorPolicyRequirementFactory to generate policy requirements based on user status.
* Added unit tests for the factory to validate behavior with various user statuses and policy details.

* Enhance AcceptOrgUserCommand to use IPolicyRequirementQuery for two-factor authentication validation

* Update ConfirmOrganizationUserCommand to use RequireTwoFactorPolicyRequirement to check for 2FA requirement

* Implement CanAcceptInvitation and CanBeConfirmed methods in RequireTwoFactorPolicyRequirement; update tests to reflect new logic for two-factor authentication policy handling.

* Refactor AcceptOrgUserCommand to enforce two-factor authentication policy based on feature flag; update validation logic and tests accordingly.

* Enhance ConfirmOrganizationUserCommand to validate two-factor authentication policy based on feature flag; refactor validation logic and update related tests for improved policy handling.

* Remove unused method and its dependencies from OrganizationService.

* Implement CanBeRestored method in RequireTwoFactorPolicyRequirement to determine user restoration eligibility based on two-factor authentication status; add corresponding unit tests for various scenarios.

* Update RestoreOrganizationUserCommand to use IPolicyRequirementQuery for two-factor authentication policies checks

* Remove redundant vNext tests

* Add TwoFactorPoliciesForActiveMemberships property to RequireTwoFactorPolicyRequirement and corresponding unit tests for policy retrieval based on user status

* Refactor UserService to integrate IPolicyRequirementQuery for two-factor authentication policy checks

* Add XML documentation for TwoFactorPoliciesForActiveMemberships property in RequireTwoFactorPolicyRequirement to clarify its purpose and return value.

* Add exception documentation for ValidateTwoFactorAuthenticationPolicyAsync method in ConfirmOrganizationUserCommand to clarify error handling for users without two-step login enabled.

* Update comments in AcceptOrgUserCommand and ConfirmOrganizationUserCommand to clarify handling of two-step login and 2FA policy checks.

* Add RequireTwoFactorPolicyRequirementFactory to PolicyServiceCollectionExtensions

* Refactor two-factor authentication policy checks in AcceptOrgUserCommand and ConfirmOrganizationUserCommand to streamline validation logic and improve clarity. Update RequireTwoFactorPolicyRequirement to provide a method for checking if two-factor authentication is required for an organization. Adjust related unit tests accordingly.

* Add PolicyRequirements namespace

* Update comments in AcceptOrgUserCommand and ConfirmOrganizationUserCommand to clarify two-factor authentication policy requirements and exception handling.

* Refactor RequireTwoFactorPolicyRequirement to return tuples of (OrganizationId, OrganizationUserId) for active memberships requiring two-factor authentication. Update UserService and related tests to reflect this change.

* Refactor AcceptOrgUserCommand: delegate feature flag check to the ValidateTwoFactorAuthenticationPolicyAsync method

* Skip policy check if two-step login is enabled for the user

* Refactor ConfirmOrganizationUserCommand to streamline two-factor authentication policy validation logic

* Refactor AcceptOrgUserCommand to simplify two-factor authentication check by removing intermediate variable

* Update documentation in RequireTwoFactorPolicyRequirement to clarify the purpose of the IsTwoFactorRequiredForOrganization

* Refactor AcceptOrgUserCommandTests to remove redundant two-factor authentication checks and simplify test setup

* Refactor AcceptOrgUserCommand and ConfirmOrganizationUserCommand to streamline two-factor authentication checks by removing redundant conditions and simplifying logic flow.

* Rename removeOrgUserTasks variable in UserService

* Refactor RestoreOrganizationUserCommand to simplify two-factor authentication compliance checks by consolidating logic into a new method, IsTwoFactorRequiredForOrganizationAsync.

* Remove outdated two-factor authentication validation documentation from AcceptOrgUserCommand

* Invert two-factor compliance check in RestoreOrganizationUserCommand to ensure correct validation of organization user policies.

* Refactor UserService to enhance two-factor compliance checks by optimizing organization retrieval and logging when no organizations require two-factor authentication.
2025-05-29 07:40:30 +01:00
Thomas Rittson
c7b0c30370
Bump account revision date in OrgUserRepository (#5884)
Match equivalent MSSQL logic. Also ensures that the revision date
is bumped when the user is revoked.
2025-05-29 07:30:23 +10:00
Todd Martin
fe6181f55f
fix(identity): [PM-21975] Add Security Stamp claim to persisted grant
* Added Security Stamp claim to refresh_token

* Linting

* Added better comments.

* Added clarification to naming of new method.

* Updated comments.

* Added more comments.

* Misspelling
2025-05-28 16:44:18 -04:00
Shane Melton
9ad2d61303
[PM-22146] Remove reference to JSON_PATH_EXISTS for old migration scripts for SH instances running older SQL Server versions (#5894) 2025-05-28 11:31:07 -07:00
Shane Melton
e19bee4195
[PM-22146] Replace JSON_PATH_EXISTS with JSON_QUERY to support older MSSQL versions (#5891) 2025-05-28 10:21:55 -07:00
Github Actions
e241949601 Bumped version to 2025.5.2 2025-05-28 17:04:11 +00:00
aj-bw
1e7d02bca2
BRE-857/collect-code-references-fails-against-tags (#5885)
* update code-references file to also check tags

* fix line
2025-05-28 12:43:15 -04:00
Brandon Treston
cd994f72bf
change verbiage, add column to table (#5888) 2025-05-28 12:06:25 -04:00
cd-bitwarden
31b6b47eac
[PM-20650] Adding feature flag to server for Remove Card Item Type policy (#5830)
* Adding feature flag to server for Remove Card Item Type policy

* Updating new feature flag name
2025-05-28 10:37:10 -04:00
Ike
4f326da8da
[PM- 19438] emergency access docs (#5846)
* doc: adding readme and comments to code for emergency access feature.
* fix: renaming variable names to better match vocabulary around emergency access.
2025-05-28 10:27:34 -04:00
Vince Grassia
fbc8e06c99
Update Renovate config (#5882) 2025-05-27 14:24:31 -04:00
renovate[bot]
359d002881
[deps] Tools: Update MailKit to 4.12.1 (#5881)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Daniel James Smith <2670567+djsmith85@users.noreply.github.com>
2025-05-27 18:59:05 +02:00
renovate[bot]
c39b6dea98
[deps] DbOps: Update Microsoft.Azure.Cosmos to 3.51.0 (#5866)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-27 11:31:18 -04:00
Rui Tomé
fe0c14e803
[PM-19282] Update SsoUser ExternalId column size to 300 (#5750)
* [PM-19282] Update SsoUser ExternalId column size to 300

* [PM-19282] Add migration to update SsoUser ExternalId column size to 300 for MySQL, PostgreSQL, and SQLite

* [PM-19282] Update SsoUser ExternalId column size conditionally based on existing schema

* Bumped date on migration script name
2025-05-27 15:18:23 +01:00
Brant DeBow
f3e637cf2d
[PM-17562] Add support for retries on event integrations (#5795)
* [PM-17562] Add support for retires on event integrations

* Add additional test coverage

* Fixed missing await call

* Remove debug organization id

* Respond to PR feedback

* Change NotBeforeUtc to DelayUntilDate. Adjust comments.

* Respond to PR feedback
2025-05-27 08:28:50 -04:00
✨ Audrey ✨
c989abdb82
[PM-21917] Introduce SendAuthenticationQuery (#5857) 2025-05-27 08:25:27 -04:00
Justin Baur
542941818a
Disallow non ascii in equivalent domain (#5852)
* Test malicious domain change

* Add tests to detect non-ascii characters

* Revert "Test malicious domain change"

This reverts commit 0602bf6d844b611304aba139e9f49cd38594273a.

* Remove confusing comment from when I was going to detect problems differently

* Update test/Core.Test/Utilities/StaticStoreTests.cs

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

* Update test/Core.Test/Utilities/StaticStoreTests.cs

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

---------

Co-authored-by: Matt Bishop <mbishop@bitwarden.com>
2025-05-23 10:31:10 -04:00
Thomas Rittson
198d96e155
[PM-21612] [Unified] Fix unhandled error when editing an invited member (#5817)
* Check for UserId instead of passing potentially default value to
  bump account revision date method.

* Pass explicit UserId into CipherRepository.CreateAsync method
  used for imports.
2025-05-23 11:45:41 +10:00
Thomas Rittson
83478f9c69
[PM-13274] [Unified] Add integration tests for creating and updating collections (#5814) 2025-05-23 11:27:37 +10:00
Matt Gibson
328b84eea0
Add-userid-to-encryption-methods (#5838)
* Add userId to auth success response

* Validate user that encrypted a cipher matches the user posting the request

* Remove userId from auth success

we don't want to expand this response model
2025-05-22 15:49:14 -04:00
renovate[bot]
77865f071a
[deps] Auth: Lock file maintenance (#5747)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-22 13:33:46 -04:00
renovate[bot]
34414a0610
[deps] Auth: Update sass to v1.88.0 (#5684)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ike <137194738+ike-kottlowski@users.noreply.github.com>
2025-05-22 17:02:23 +00:00
renovate[bot]
dd60769499
[deps] Auth: Update bootstrap to v5.3.6 (#5687)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-22 12:24:55 -04:00
renovate[bot]
ad22f77aba
[deps] Auth: Update webpack to v5.99.8 (#5728)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-22 11:17:17 -04:00
renovate[bot]
ad8b1d9143
[deps] Auth: Update sass-loader to v16.0.5 (#5689)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ike <137194738+ike-kottlowski@users.noreply.github.com>
2025-05-22 09:51:38 -04:00
cyprain-okeke
1ec06faf7d
[PM 21889] 500 Response on POST billing/restart-subscription (#5851)
* Resolve the 500 errors on restart subscription

* Rename the variable name
2025-05-21 21:28:37 +01:00
Alex Morask
18d146406c
[PM-21099] (NO LOGIC) Organize Billing provider code (#5819)
* [NO LOGIC] Organize Billing provider code

* Run dotnet format

* Run dotnet format'

* Fixed using after merge

* Fixed test usings after merge
2025-05-21 09:04:30 -04:00
Alex Morask
e994bf2117
[PM-21383] Use Stripe to get provider pricing for display when feature flag is on (#5842)
* Use ProviderPriceAdapter when getting provider subscription

* Update test
2025-05-21 08:10:34 -04:00
Vince Grassia
3aa9812353
Fix actionlint issues (#5841) 2025-05-20 12:44:01 -04:00
Brandon Treston
790173d1c7
remove feature flag (#5837) 2025-05-20 10:33:40 -04:00
Rui Tomé
725a793863
[PM-15161] Create ProviderClientOrganizationSignUpCommand command (#5764)
* Extract OrganizationService.SignupClientAsync into new ResellerClientOrganizationSignUpCommand

* Refactor ResellerClientOrganizationSignUpCommand to remove unused dependencies and simplify SignupClientAsync method signature

* Add unit tests for ResellerClientOrganizationSignUpCommand

* Rename SignUpProviderClientOrganizationCommand

* Rename ProviderClientOrganizationSignUpCommand

* Register ProviderClientOrganizationSignUpCommand for dependency injection

* Refactor ProviderService to use IProviderClientOrganizationSignUpCommand for organization signup process

* Refactor error handling in ProviderClientOrganizationSignUpCommand to use constants for error messages

* Remove SignupClientAsync method from IOrganizationService and OrganizationService, along with associated unit tests
2025-05-20 14:35:47 +01:00
Graham Walker
818934487f
PM-18939 refactoring send service to 'cqrs' (#5652)
* PM-18939 refactoring send service to 'cqrs'

* PM-18939 fixing import issue with sendValidationService

* PM-18939 fixing code based on PR comments

* PM-18339 reverting to previous code in test

* PM-18939 adding XMLdocs to services

* PM-18939 reverting send validation methods

* PM-18939 updating code to match main

* PM-18939 reverting validateUserCanSaveAsync to match main

* PM-18939 fill our param and return sections of XMLdocs

* PM-18939 updating XMLdocs based on PR comments

* Update src/Core/Tools/SendFeatures/Commands/Interfaces/IAnonymousSendCommand.cs

Co-authored-by:  Audrey  <ajensen@bitwarden.com>

* Update src/Core/Tools/SendFeatures/Commands/Interfaces/INonAnonymousSendCommand.cs

Co-authored-by:  Audrey  <ajensen@bitwarden.com>

* Update src/Core/Tools/SendFeatures/Commands/Interfaces/INonAnonymousSendCommand.cs

Co-authored-by:  Audrey  <ajensen@bitwarden.com>

* Update src/Core/Tools/SendFeatures/Services/Interfaces/ISendStorageService.cs

Co-authored-by:  Audrey  <ajensen@bitwarden.com>

* PM-18939 adding commits to change tuple to enum type

* PM-18939 resetting stream position to 0 when uploading file

* PM-18939 updating XMLdocs based on PR comments

* PM-18939 updating XMLdocs

* PM-18939 removing circular dependency

* PM-18939 fixing based on comments

* PM-18939 updating method name and documentation

---------

Co-authored-by:  Audrey  <ajensen@bitwarden.com>
2025-05-19 22:59:30 -05:00
Alex Morask
7b3e2a80f4
[PM-21092] Set tax exemption to reverse charge for non-US business-use customers (#5812)
* Set automatic tax to enabled and tax exempt to reverse where applicable when ff is on

* Fix and add tests

* Run dotnet format

* Run dotnet format

* PM-21745: Resolve defect

* PM-21770: Resolve defect

* Run dotnet format'
2025-05-19 14:53:48 -04:00
Ike
a07cce26f3
[PM-19444] Emergency access device verification email fix (#5833)
* fix: turn off New Device Verification when emergency access takeover is exercised; Also some Docs

* test: add tests for EmergencyAccessService
2025-05-19 11:59:15 -04:00
Conner Turnbull
b2c8c0230f
Ignoring newer properties when generating the license's signature (#5832) 2025-05-19 10:54:11 -04:00
cyprain-okeke
a36db63998
Check for payment method before subscription (#5631) 2025-05-19 10:16:35 -04:00
Github Actions
0928e656cc Bumped version to 2025.5.1 2025-05-19 10:40:03 +00:00
Brandon Treston
b3f7265129
[PM-21727] Add feature to plan and license constructor (#5834)
* add feature to plan

* add license to ctor for old license file creation method
2025-05-16 17:30:51 -04:00
Todd Martin
fad91d8614
fix(captcha): [PM-21707] Add back captchaBypassToken stub value 2025-05-16 15:11:28 -04:00
Brandon Treston
cbf49b915b
[PM-11622] Implement UseOrganizationDomains (#5822)
* implement UseOrganizationDomains

* fix undefined error
2025-05-16 12:51:22 -04:00
cyprain-okeke
51e489ac9d
[PM 21081][Defect] Admin Sponsored Families not working in Self Host after uploading license file (#5818)
* Resolve the licence issue

Signed-off-by: Cy Okeke <cokeke@bitwarden.com>

* resolve the pr comment

* Remove unnecessary directives

Signed-off-by: Cy Okeke <cokeke@bitwarden.com>

---------

Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
2025-05-16 16:05:47 +01:00
cyprain-okeke
b48a09a338
Resolve the revoke for more than one Sponsorship (#5827) 2025-05-16 15:23:09 +01:00
Patrick-Pimentel-Bitwarden
8d2629fe58
Auth/pm 17111/add browser to list of approving clients (#5825)
* refactor(update-auth-approving-clients): [PM-17111] Add Browser to List of Approving Clients - Refactored how it works to fit different priorities.
2025-05-16 09:50:32 -04:00
bitwarden-charlie
67f745ebc4
chore/SRE-583 Deprecate usage of Auth-Email Header (#5709)
* chore/SRE-583 Deprecate usage of Auth-Email Header

* SRE-583 cleanup function and references

* SRE-583 cleanup tests

---------

Co-authored-by: sneakernuts <671942+sneakernuts@users.noreply.github.com>
2025-05-16 07:45:04 -06:00
Alex Morask
d72d721684
Set BU trial length to 4 (#5824) 2025-05-16 09:00:40 -04:00
Thomas Rittson
3bf4f11c3a
Add MariaDB as development and test database (#5816) 2025-05-16 13:55:13 +10:00
Justin Baur
bbbc7a6422
Add docker related files to platform ownership (#5820) 2025-05-15 19:13:55 -04:00
Jordan Aasen
97fbf21977
[PM-20543] - remove restrict-provider-access feature flag (#5700)
* remove restrict-provider-access feature flag

* remove feature flag

* re-add flag

* remove unnecessary tests

* fix bad merge

* fix bad merge

* remove RestrictProviderAccess key
2025-05-15 14:00:48 -07:00