1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-08 14:38:15 -05:00

5667 Commits

Author SHA1 Message Date
Matt Andreko
8287d0a968
Replace secret checking logic with branch detection logic (#5454) 2025-03-10 15:57:56 -04:00
Jonas Hendrickx
ac25ec4519
[PM-19002] Extract billing code from AccountsController (#5477) 2025-03-10 18:14:22 +01:00
Ike
913da4a629
[PM-15015] Add Country Name to auth request from request headers (#5471)
* feat(pm-15015) : 
  * Add `CountryName` column to AuthRequest Table in Database, and refreshing AuthRequestView
  * Modify database stored procedures and Entity Framework migrations for AuthRequest Repositories
  * Add property to `ICurrentContext` and response models.
2025-03-10 12:16:43 -04:00
Daniel James Smith
031e188e82
Remove extension-refresh feature flag (#5410)
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2025-03-10 11:53:07 -04:00
Rui Tomé
6e7c5b172c
[PM-18087] Add cipher permissions to response models (#5418)
* Add Manage permission to UserCipherDetails and CipherDetails_ReadByIdUserId

* Add Manage property to CipherDetails and UserCipherDetailsQuery

* Add integration test for CipherRepository Manage permission rules

* Update CipherDetails_ReadWithoutOrganizationsByUserId to include Manage permission

* Refactor UserCipherDetailsQuery to include detailed permission and organization properties

* Refactor CipherRepositoryTests to improve test organization and readability

- Split large test method into smaller, focused methods
- Added helper methods for creating test data and performing assertions
- Improved test coverage for cipher permissions in different scenarios
- Maintained existing test logic while enhancing code structure

* Refactor CipherRepositoryTests to consolidate cipher permission tests

- Removed redundant helper methods for permission assertions
- Simplified test methods for GetCipherPermissionsForOrganizationAsync, GetManyByUserIdAsync, and GetByIdAsync
- Maintained existing test coverage for cipher manage permissions
- Improved code readability and reduced code duplication

* Add integration test for CipherRepository group collection manage permissions

- Added new test method GetCipherPermissionsForOrganizationAsync_ManageProperty_RespectsCollectionGroupRules
- Implemented helper method CreateCipherInOrganizationCollectionWithGroup to support group-based collection permission testing
- Verified manage permissions are correctly applied based on group collection access settings

* Add @Manage parameter to Cipher stored procedures

- Updated CipherDetails_Create, CipherDetails_CreateWithCollections, and CipherDetails_Update stored procedures
- Added @Manage parameter with comment "-- not used"
- Included new stored procedure implementations in migration script
- Consistent with previous work on adding Manage property to cipher details

* Update UserCipherDetails functions to reorder Manage and ViewPassword columns

* [PM-18086] Add CanRestore and CanDelete authorization methods.

* [PM-18086] Address code review feedback.

* [PM-18086] Add missing part.

* [PM-18087] Add CipherPermissionsResponseModel for cipher permissions

* Add GetManyOrganizationAbilityAsync method to application cache service

* Add organization ability context to cipher response models

This change introduces organization ability context to various cipher response models across multiple controllers. The modifications include:

- Updating CipherResponseModel to include permissions based on user and organization ability
- Modifying CiphersController methods to fetch and pass organization abilities
- Updating SyncController to include organization abilities in sync response
- Adding organization ability context to EmergencyAccessController response generation

* Remove organization ability context from EmergencyAccessController

This change simplifies the EmergencyAccessController by removing unnecessary organization ability fetching and passing. Since emergency access only retrieves personal ciphers, the organization ability context is no longer needed in the response generation.

* Remove unused IApplicationCacheService from EmergencyAccessController

* Refactor EmergencyAccessViewResponseModel constructor

Remove unnecessary JsonConstructor attribute and simplify constructor initialization for EmergencyAccessViewResponseModel

* Refactor organization ability retrieval in CiphersController

Extract methods to simplify organization ability fetching for ciphers, reducing code duplication and improving readability. Added two private helper methods:
- GetOrganizationAbilityAsync: Retrieves organization ability for a single cipher
- GetManyOrganizationAbilitiesAsync: Retrieves organization abilities for multiple ciphers

* Update CiphersControllerTests to use GetUserByPrincipalAsync

Modify test methods to:
- Replace GetProperUserId with GetUserByPrincipalAsync
- Use User object instead of separate userId
- Update mocking to return User object
- Ensure user ID is correctly set in test scenarios

* Refactor CipherPermissionsResponseModel to use constructor-based initialization

* Refactor CipherPermissionsResponseModel to use record type and init-only properties

* [PM-18086] Undo files

* [PM-18086] Undo files

* Refactor organization abilities retrieval in cipher-related controllers and models

- Update CiphersController to use GetOrganizationAbilitiesAsync instead of individual methods
- Modify CipherResponseModel and CipherDetailsResponseModel to accept organization abilities dictionary
- Update CipherPermissionsResponseModel to handle organization abilities lookup
- Remove deprecated organization ability retrieval methods
- Simplify sync and emergency access response model handling of organization abilities

* Remove GetManyOrganizationAbilityAsync method

- Delete unused method from IApplicationCacheService interface
- Remove corresponding implementation in InMemoryApplicationCacheService
- Continues cleanup of organization ability retrieval methods

* Update CiphersControllerTests to include organization abilities retrieval

- Add organization abilities retrieval in test setup for PutCollections_vNext method
- Ensure consistent mocking of IApplicationCacheService in test scenarios

* Update error message for missing organization ability

---------

Co-authored-by: Jimmy Vo <huynhmaivo82@gmail.com>
2025-03-10 15:27:30 +00:00
cyprain-okeke
88e91734f1
[PM-17594]Remove feature flag self-host license refactor (#5372)
* Remove the feature flag

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

* Resolve the failing test

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

---------

Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
Co-authored-by: Conner Turnbull <133619638+cturnbull-bitwarden@users.noreply.github.com>
2025-03-10 11:46:44 +01:00
Github Actions
f26f14165c Bumped version to 2025.3.0 2025-03-10 10:28:50 +00:00
Justin Baur
bd7a0a8ed8
Codespaces improvements (#4969)
* Skip one_time_setup in GH Codespaces

* Make .env File Optional

* Wrap Path in Single Quotes

* Comment out .env File

* Add Modify Database Task

* Work on modify_database.ps1

* Add space

* Remove compose version

* Do changes in community as well

* Do required: false

* Reverse check

* Remove printenv

* Skip DB changes

* Remove docker outside of docker feature

* Remove newlines
2025-03-09 16:56:04 -04:00
jrmccannon
d8264a9085
Fixed some changes. 2025-03-07 14:43:12 -06:00
jrmccannon
e4aa740a28
Fixed some compilation errors. 2025-03-07 12:46:59 -06:00
jrmccannon
42c76c0e64
missed value 2025-03-07 12:36:49 -06:00
jrmccannon
9378acbd0d
changes from main 2025-03-07 12:35:35 -06:00
jrmccannon
88923b5e6e
Merge branch 'main' into jmccannon/ac/pm-16811-scim-invite-optimization
# Conflicts:
#	src/Core/Models/Commands/CommandResult.cs
2025-03-07 12:33:31 -06:00
jrmccannon
9dab9160a5
Removed unused request model 2025-03-07 12:23:38 -06:00
jrmccannon
4317276f5d
Dto rename. Moved from static methods to ctors 2025-03-07 10:03:47 -06:00
jrmccannon
cb2bc574e3
Renamed dto and added ctor 2025-03-07 09:03:43 -06:00
jrmccannon
46ee99a5a1
Separated into separate files. 2025-03-07 08:56:55 -06:00
Daniel James Smith
34358acf61
Fix user context on importing into individual vaults (#5465)
Pass in the current userId instead of trying to infer it from the folders or ciphers passed into the ImportCiphersCommand

Kudos go to @MJebran who pointed this out on https://github.com/bitwarden/server/pull/4896

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2025-03-07 15:09:54 +01:00
Jonas Hendrickx
c589f9a330
[BEEEP] [PM-18518] Cleanup StripePaymentService (#5435) 2025-03-07 09:52:04 +01:00
Jared McCannon
6cb97d9bf9
[PM-18972] - Fix query for Org By User Domain (#5474)
* Changed query to avoid table scan. Added index to speed up query as well.
2025-03-07 12:32:21 +10:00
Github Actions
bea0d0d76f Bumped version to 2025.2.4 2025-03-06 21:51:25 +00:00
Maciej Zieniuk
8628206fa9
ArgumentNullException: Value cannot be null in POST /push/register (#5472) 2025-03-06 22:13:02 +01:00
Alex Morask
cb1c12794f
Derive item add on status from price metadata (#5389) 2025-03-06 13:44:10 -05:00
jrmccannon
adec0b0122
turned into a switch statement 2025-03-06 11:04:12 -06:00
jrmccannon
3d92fcb08b
Moved into class 2025-03-06 11:01:30 -06:00
Jimmy Vo
c82908f40b
[PM-15621] Add functionality to map command results to HTTP responses. (#5467) 2025-03-06 11:16:58 -05:00
Jonas Hendrickx
7281dd9b58
[PM-18163] Remove feature flag 'AC-1795_updated-subscription-status-section' (#5411) 2025-03-06 13:19:18 +01:00
Github Actions
ac1d5b1a69 Bumped version to 2025.2.3 2025-03-05 23:05:04 +00:00
jrmccannon
49e5e73d12
undoing this 2025-03-05 16:30:08 -06:00
jrmccannon
56c7cc8bf4
Rename of OrgDto 2025-03-05 16:21:40 -06:00
jrmccannon
53168717fb
Fixing bad merge. 2025-03-05 16:08:11 -06:00
jrmccannon
6f7b0b3e0e
Updated to use new pricing client. Supressed null dereference errors. 2025-03-05 15:48:12 -06:00
jrmccannon
f8c08de2db
Merge branch 'main' into jmccannon/ac/pm-16811-scim-invite-optimization
# Conflicts:
#	src/Core/AdminConsole/Services/Implementations/OrganizationService.cs
#	test/Infrastructure.IntegrationTest/AdminConsole/Repositories/OrganizationUserRepositoryTests.cs
2025-03-05 15:24:13 -06:00
jrmccannon
c7cc9527f4
Moved FromOrganization mapper method to a constructor 2025-03-05 15:04:50 -06:00
jrmccannon
611ad8c343
Moved to private method. Made ScimInvite inherit the single invite base model. Moved create methods to constructors. A few more CR changes included. 2025-03-05 14:55:41 -06:00
Alex Morask
88ffde930f
Check to see if cancellation comment is populated before disablement checks (#5468) 2025-03-05 15:29:51 -05:00
Alex Morask
fa90991270
[PM-12601] Add discount to MSP during creation in Admin Portal (#5391)
* Add Provider DiscountId to database and Stripe customer

* Fix tests

* Add missing EF migrations

* Run dotnet format
2025-03-05 14:59:15 -05:00
Jonas Hendrickx
10756ca35e
[PM-5872] Credit load intermittently fails (#5424) 2025-03-05 16:22:16 +01:00
Todd Martin
267f306c85
Updated server version to 2025.2.2 (#5466) 2025-03-05 09:55:12 -05:00
Brandon Treston
3c0f723403
remove feature flag (#5462) 2025-03-05 09:42:39 -05:00
jrmccannon
085dbffed1
switched to initialization block 2025-03-05 08:21:30 -06:00
jrmccannon
4ff27fd668
created response model and split interface out. 2025-03-05 07:42:09 -06:00
Todd Martin
1efc105028
fix(New Device Verification): [PM-18906] Removed flagging from BW Portal 2025-03-05 08:31:43 -05:00
Github Actions
a9739c2b94 Bumped version to 2025.3.0 2025-03-05 04:57:09 +00:00
jrmccannon
5d4f58aacb
Switching over to a local factory. 2025-03-04 15:26:13 -06:00
Jared McCannon
356ae1063a
Fixed last dereference. (#5457) 2025-03-04 13:52:07 -06:00
Jared McCannon
cb68ef711a
Added optional param to exclude orgs from cipher list. (#5455) 2025-03-04 08:21:02 -06:00
Jared McCannon
0d89409abd
[PM-18076] - Fix compiler warnings (#5451)
* fixed warnings in UpdateOrganizationUserCommand.cs

* Removed null dereference and multiple enumeration warning.

* Removed unused param. Imported type for xml docs

* imported missing type.

* Added nullable block around method.
2025-02-28 09:21:30 -06:00
Jimmy Vo
63f1c3cee3
[PM-18086] Add CanRestore and CanDelete authorization methods. (#5407) 2025-02-27 16:30:25 -05:00
Daniel García
326ecebba1
Fix SDK bindings generation (#5450) 2025-02-27 17:43:07 +01:00