1
0
mirror of https://github.com/bitwarden/server.git synced 2025-02-06 00:11:22 +01:00
Commit Graph

752 Commits

Author SHA1 Message Date
gbubemismith
fff7707275
Fixed merge conflicts 2025-01-09 15:24:24 -05:00
Shane Melton
a99f82dddd
[PM-14378] SecurityTask Authorization Handler (#5039)
* [PM-14378] Introduce GetCipherPermissionsForOrganization query for Dapper CipherRepository

* [PM-14378] Introduce GetCipherPermissionsForOrganization method for Entity Framework

* [PM-14378] Add integration tests for new repository method

* [PM-14378] Introduce IGetCipherPermissionsForUserQuery CQRS query

* [PM-14378] Introduce SecurityTaskOperationRequirement

* [PM-14378] Introduce SecurityTaskAuthorizationHandler.cs

* [PM-14378] Introduce SecurityTaskOrganizationAuthorizationHandler.cs

* [PM-14378] Register new authorization handlers

* [PM-14378] Formatting

* [PM-14378] Add unit tests for GetCipherPermissionsForUserQuery

* [PM-15378] Cleanup SecurityTaskAuthorizationHandler and add tests

* [PM-14378] Add tests for SecurityTaskOrganizationAuthorizationHandler

* [PM-14378] Formatting

* [PM-14378] Update date in migration file

* [PM-14378] Add missing awaits

* [PM-14378] Bump migration script date

* [PM-14378] Remove Unassigned property from OrganizationCipherPermission as it was making the query too complicated

* [PM-14378] Update sproc to use Union All to improve query performance

* [PM-14378] Bump migration script date
2025-01-09 12:14:24 -08:00
Jared McCannon
fd195e7cf3
Forgot to remove compliant users from the list. (#5241) 2025-01-09 14:13:29 -06:00
Conner Turnbull
6771f79597
Updated LicensingService to be a singleton again and moved IFeatureService up a frame in the call stack (#5238) 2025-01-09 12:40:16 -05:00
Jared McCannon
e754ae4729
[PM-10319] - Send 2FA Email when policy enabled (#5233)
* Correcting which email is sent when enabling 2FA policy.

* Fixing the test.
2025-01-09 09:35:40 -06:00
Todd Martin
a638f359e9
Revert updates to Microsoft.Extensions dependencies from v9 (#5235)
* Revert "[deps] Tools: Update Microsoft.Extensions.Configuration to v9 (#5072)"

This reverts commit cb7cbb630a.

* Revert "[deps] Tools: Update Microsoft.Extensions.DependencyInjection to v9 (#5073)"

This reverts commit 0b026404db.
2025-01-08 18:04:28 -05:00
Matt Bishop
92d9b88afb
Provide new feature flag context for devices (#5226) 2025-01-08 13:54:34 -05:00
Ike
a84ef0724c
[PM-15614] Allow Users to opt out of new device verification (#5176)
feat(NewDeviceVerification) : 
* Created database migration scripts for VerifyDevices column in [dbo].[User].
* Updated DeviceValidator to check if user has opted out of device verification.
* Added endpoint to AccountsController.cs to allow editing of new User.VerifyDevices property.
* Added tests for new methods and endpoint.
* Updating queries to track [dbo].[User].[VerifyDevices].
* Updated DeviceValidator to set `User.EmailVerified` property during the New Device Verification flow.
2025-01-08 07:31:24 -08:00
Alex Morask
481a766cd2
Remove FF (#5163) 2025-01-08 09:49:24 -05:00
Patrick-Pimentel-Bitwarden
cc96e35072
Auth/pm 2996/add auth request data to devices response model (#5152)
fix(auth): [PM-2996] Add Pending Auth Request Data to Devices Response
- New stored procedure to fetch the appropriate data.
- Updated devices controller to respond with the new data.
- Tests written at the controller and repository level.
Resolves PM-2996
2025-01-07 15:52:53 -05:00
Addison Beck
5ae232e336
chore: expand tests of the new UpdateInstallationCommand (#5227) 2025-01-07 14:58:30 -05:00
cyprain-okeke
eeb1be1dba
[PM-15808]Show suspended org modals for orgs in 'unpaid' & 'canceled' status (#5228)
* Recreate changes on the closed pr

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

* Remove unused references

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

---------

Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
2025-01-07 20:01:40 +01:00
Jimmy Vo
0e801ca622
[pm-5966] Fix Entity Framework query for MySQL (#5170)
Problem: The Entity Framework query was causing a compile-time error.

Changes:
1. Fixed the query.
2. Renamed the variable to replace the comment.
2025-01-07 10:01:23 -05:00
Addison Beck
90f7bfe63d
chore: update LastActivityDate on installation token refresh (#5081) 2025-01-06 13:22:03 -08:00
Addison Beck
cd7c4bf6ce
chore: move Installation and Push to platform's domain folders (#5085)
* chore: set up a `CODEOWNERS` space for platform

* chore: move sql objects for `Installation` to platform's domain

* chore: move `Installation` and `PushRelay` code to platform's domain
2025-01-06 18:10:53 +01:00
Jonas Hendrickx
97e11774e3
[PM-13999] show estimated tax for taxable countries (#5110) 2025-01-02 20:27:53 +01:00
Jonas Hendrickx
bad533af8e
[PM-16611] Failing unit tests due to previous month being incorrectly… (#5207) 2025-01-02 16:07:34 +01:00
cyprain-okeke
d924c6721a
[PM-15814]Alert owners of reseller-managed orgs to renewal events (#5193)
* Changes for the admin console alert

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

* Fix the failing test

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

* Add the feature flag

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

---------

Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
2024-12-31 18:06:29 +01:00
gbubemismith
e3352f4a23
Added unit tests for the command 2024-12-23 18:31:51 -05:00
gbubemismith
74b25da471
Merge commit 'refs/pull/5039/head' of https://github.com/bitwarden/server into vault/PM-14381 2024-12-23 17:02:31 -05:00
gbubemismith
0edb923b00
created ef implementatin for create many and added integration test 2024-12-23 15:52:05 -05:00
renovate[bot]
cb7cbb630a
[deps] Tools: Update Microsoft.Extensions.Configuration to v9 (#5072)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-19 12:57:03 +00:00
renovate[bot]
0b026404db
[deps] Tools: Update Microsoft.Extensions.DependencyInjection to v9 (#5073)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Daniel James Smith <2670567+djsmith85@users.noreply.github.com>
2024-12-19 13:43:44 +01:00
Maciej Zieniuk
21fcfcd5e8
[PM-10563] Notification Center API (#4852)
* PM-10563: Notification Center API

* PM-10563: continuation token hack

* PM-10563: Resolving merge conflicts

* PM-10563: Unit Tests

* PM-10563: Paging simplification by page number and size in database

* PM-10563: Request validation

* PM-10563: Read, Deleted status filters change

* PM-10563: Plural name for tests

* PM-10563: Request validation to always for int type

* PM-10563: Continuation Token returns null on response when no more records available

* PM-10563: Integration tests for GET

* PM-10563: Mark notification read, deleted commands date typos fix

* PM-10563: Integration tests for PATCH read, deleted

* PM-10563: Request, Response models tests

* PM-10563: EditorConfig compliance

* PM-10563: Extracting to const

* PM-10563: Update db migration script date

* PM-10563: Update migration script date
2024-12-18 09:59:50 -05:00
Ike
2e8f2df942
feat(NewDeviceVerification) : (#5153)
feat(NewDeviceVerification) :
Added constat for the cache key in Bit.Core because the cache key format needs to be shared between the Identity Server and the MVC Admin project.
Updated DeviceValidator class to handle checking cache for user information to allow pass through.
Updated and Added tests to handle new flow.
2024-12-17 08:59:39 -08:00
Rui Tomé
b75c63c2c6
[PM-15957] Fix: Domain Claim fails to enable Single Organization Policy, sends no emails and Revokes all users (#5147)
* Add JSON-based stored procedure for updating account revision dates and modify existing procedure to use it

* Refactor SingleOrgPolicyValidator to revoke only non-compliant organization users and update related tests
2024-12-17 15:57:31 +00:00
Shane Melton
9cef90b261
Merge branch 'main' into vault/pm-14378/security-task-auth-handler 2024-12-16 11:53:08 -08:00
Thomas Avery
7637cbe12a
[PM-13362] Add private key regeneration endpoint (#4929)
* Add new RegenerateUserAsymmetricKeysCommand

* add new command tests

* Add regen controller

* Add regen controller tests

* add feature flag

* Add push notification to sync new asymmetric keys to other devices
2024-12-16 12:01:09 -06:00
Ike
c446ac86fe
[PM-12512] Add Endpoint to allow users to request a new device otp (#5146)
feat(NewDeviceVerification): Added a resend new device OTP endpoint and method for the IUserService as well as wrote test for new methods for the user service.
2024-12-16 07:57:56 -08:00
SmithThe4th
141a046a28
[PM-14377] Add PATCH complete endpoint (#5100)
* Added CQRS pattern

* Added the GetManyByUserIdAsync signature to the repositiory

* Added sql sproc

Created user defined type to hold status

Created migration file

* Added ef core query

* Added absract and concrete implementation for GetManyByUserIdStatusAsync

* Added integration tests

* Updated params to status

* Implemented new query to utilize repository method

* Added controller for the security task endpoint

* Fixed lint issues

* Added documentation

* simplified to require single status

modified script to check for users with edit rights

* Updated ef core query

* Added new assertions

* simplified to require single status

* fixed formatting

* Fixed sql script

* Removed default null

* Added OperationAuthorizationRequirement for secruity task

* Added and registered MarkTaskAsCompletedCommand

* Added unit tests for the command

* Added complete endpoint

* removed false value
2024-12-13 14:50:20 -05:00
Shane Melton
b10df9bce9
[PM-14378] Add missing awaits 2024-12-13 10:48:56 -08:00
Rui Tomé
6da7fdc39e
[PM-15547] Revoke managed user on 2FA removal if enforced by organization policy (#5124)
* Revoke managed user on 2FA removal if enforced by organization policy

* Rename TwoFactorDisabling to TwoFactorDisabled in EventSystemUser enum
2024-12-13 11:32:29 +00:00
Shane Melton
6eb33cf763
Merge branch 'main' into vault/pm-14378/security-task-auth-handler 2024-12-12 15:34:48 -08:00
SmithThe4th
a332a69112
[PM-14376] Add GET tasks endpoint (#5089)
* Added CQRS pattern

* Added the GetManyByUserIdAsync signature to the repositiory

* Added sql sproc

Created user defined type to hold status

Created migration file

* Added ef core query

* Added absract and concrete implementation for GetManyByUserIdStatusAsync

* Added integration tests

* Updated params to status

* Implemented new query to utilize repository method

* Added controller for the security task endpoint

* Fixed lint issues

* Added documentation

* simplified to require single status

modified script to check for users with edit rights

* Updated ef core query

* Added new assertions

* simplified to require single status

* fixed formatting

* Fixed sql script

* Removed default null

* Added security tasks feature flag
2024-12-12 14:27:31 -05:00
Ike
867fa848dd
[PM-8220] New Device Verification (#5084)
* feat(BaseRequestValidator): 
Add global setting for new device verification.
Refactor BaseRequestValidator enabling better self-documenting code and better single responsibility principle for validators.
Updated DeviceValidator to handle new device verification, behind a feature flag.
Moved IDeviceValidator interface to separate file.
Updated CustomRequestValidator to act as the conduit by which *Validators communicate authentication context between themselves and the RequestValidators.
Adding new test for DeviceValidator class.
Updated tests for BaseRequestValidator as some functionality was moved to the DeviceValidator class.
2024-12-12 09:08:11 -08:00
Jimmy Vo
a76a9cb800
[PM-14826] Add UsePolicies check to GET endpoints (#5046)
GetByToken and GetMasterPasswordPolicy endpoints provide policy information, so if the organization is not using policies, then we avoid the rest of the logic.
2024-12-12 10:18:11 -05:00
Alex Morask
c852575a9e
[PM-14984] Use provider subscription for MSP managed enterprise license (#5102)
* Use provider subscription when creating license for MSP managed enterprise organization

* Run dotnet format
2024-12-12 07:08:17 -05:00
Shane Melton
d2229232ab
Merge branch 'main' into vault/pm-14378/security-task-auth-handler 2024-12-11 16:48:51 -08:00
Shane Melton
bcf321064c
[PM-14378] Formatting 2024-12-11 16:44:57 -08:00
Shane Melton
ca15550db1
[PM-14378] Add tests for SecurityTaskOrganizationAuthorizationHandler 2024-12-11 16:42:42 -08:00
Shane Melton
b40d1443c7
[PM-15378] Cleanup SecurityTaskAuthorizationHandler and add tests 2024-12-11 16:23:37 -08:00
Shane Melton
4d8023828b
[PM-14378] Add unit tests for GetCipherPermissionsForUserQuery 2024-12-11 15:22:48 -08:00
Alex Morask
2d891b396a
[PM-11127] Write OrganizationInstallation record when license is retrieved (#5090)
* Add SQL files

* Add SQL Server migration

* Add Core entity

* Add Dapper repository

* Add EF repository

* Add EF migrations

* Save OrganizationInstallation during GetLicense invocation

* Run dotnet format
2024-12-11 13:55:00 -05:00
renovate[bot]
94761a8c7b
[deps] Billing: Update FluentAssertions to v7 (#5127)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-10 15:21:26 -05:00
Rui Tomé
127f1fd34d
[PM-10338] Update the Organization 'Leave' endpoint to log EventType.OrganizationUser_Left (#4908)
* Implement UserLeaveAsync in IRemoveOrganizationUserCommand and refactor OrganizationsController to use it

* Edit summary message for IRemoveOrganizationUserCommand.UserLeaveAsync

* Refactor RemoveOrganizationUserCommand.RemoveUsersAsync to log in bulk

---------

Co-authored-by: Matt Bishop <mbishop@bitwarden.com>
2024-12-10 11:14:34 +00:00
Brandon Treston
c591997d01
[PM-13013] add delete many async method to i user repository and i user service for bulk user deletion (#5035)
* Add DeleteManyAsync method and stored procedure

* Add DeleteManyAsync and tests

* removed stored procedure, refactor User_DeleteById to accept multiple Ids

* add sproc, refactor tests

* revert existing sproc

* add bulk delete to IUserService

* fix sproc

* fix and add tests

* add migration script, fix test

* Add feature flag

* add feature flag to tests for deleteManyAsync

* enable nullable, delete only user that pass validation

* revert changes to DeleteAsync

* Cleanup whitespace

* remove redundant feature flag

* fix tests

* move DeleteManyAsync from UserService into DeleteManagedOrganizationUserAccountCommand

* refactor validation, remove unneeded tasks

* refactor tests, remove unused service
2024-12-06 14:40:47 -05:00
Addison Beck
092b0b8bd2
Remove LimitCollectionCreationDeletionSplit feature flag (#4809)
* Remove references to feature flag

* Demote entity property to an EF shadow property

* Add a few excludes to license file tests
2024-12-06 11:46:17 +01:00
Jared McCannon
2333a934a9
[PM-12488] Migrating Cloud Org Sign Up to Command (#5078) 2024-12-06 13:18:02 +10:00
Shane Melton
78ea8b5480
[PM-14378] Formatting 2024-12-05 17:09:51 -08:00
Shane Melton
db5bd64143
[PM-14378] Add integration tests for new repository method 2024-12-05 17:03:20 -08:00