1
0
mirror of https://github.com/bitwarden/server synced 2025-12-06 00:03:34 +00:00
Commit Graph

6157 Commits

Author SHA1 Message Date
Jared Snider
531af410f9 pm-24210 (#6142) 2025-07-30 12:18:27 -04:00
Rui Tomé
5816ed6600 [PM-23141] Fix: Users unable to edit ciphers after being confirmed into organization (#6097)
* Refactor ConfirmOrganizationUserCommand to push registration after DB save

* Assert device push registration handling in ConfirmOrganizationUserCommandTests
2025-07-30 12:00:48 +01:00
Ruyut
2b0a639b95 fix: remove the duplicate name field (#6133) 2025-07-30 09:28:51 +00:00
Brant DeBow
a84e5554fb [PM-17562] Refactor event integration methods / declarations in ServiceCollectionExtensions (#6118)
* [PM-17562] Refactor event integration methods / declarations in ServiceCollectionExtensions

* Refactored ServiceCollectionExtensions to use TryAdd and still launch unique listeneer services

* Updated unit tests to match new generic format for Listeners

* Fix method spacing

* Update README to reflect new integration setup in ServiceCollectionExtensions

* Move interfaces to I prefix; fix typo in subscription

* Fix reference to IIntegrationListenerConfiguration
2025-07-29 11:22:21 -04:00
Rui Tomé
43372b7168 [PM-20010] Fix purge logic to skip claimed user check for organization vault (#6107)
* Implement unit tests for PostPurge method in CiphersController to handle various scenarios

* Refactor PostPurge method in CiphersController to use Guid for organizationId parameter and update related unit tests

* Refactor PostPurge method in CiphersController to skip checking if user is claimed if its purging the org vault
2025-07-29 16:17:16 +01:00
aj-bw
47237fa88f add missing tzdata library (#6136) 2025-07-29 10:41:03 -04:00
Rui Tomé
b00e689ff6 [PM-22558] Update IOrganizationUserRepository.ReplaceAsync to preserve existing access to collections of the type DefaultUserCollection (#6037)
* feat: exclude DefaultUserCollection from GetManyByOrganizationIdWithPermissionsAsync

Updated EF implementation, SQL procedure, and unit test to verify that default user collections are filtered from results

* Update the public CollectionsController.Get method to return a NotFoundResult for collections of type DefaultUserCollection.

* Add unit tests for the public CollectionsController

* Update ICollectionRepository.GetManyByOrganizationIdAsync to exclude results of the type DefaultUserCollection

Modified the SQL stored procedure and the EF query to reflect this change and added a new integration test to ensure the functionality works as expected.

* Refactor CollectionsController to remove unused IApplicationCacheService dependency

* Update IOrganizationUserRepository.GetDetailsByIdWithCollectionsAsync to exclude DefaultUserCollections

* Update IOrganizationUserRepository.GetManyDetailsByOrganizationAsync to exclude DefaultUserCollections

* Undo change to GetByIdWithCollectionsAsync

* Update integration test to verify exclusion of DefaultUserCollection in OrganizationUserRepository.GetDetailsByIdWithCollectionsAsync

* Clarify documentation in ICollectionRepository to specify that GetManyByOrganizationIdWithAccessAsync returns only shared collections belonging to the organization.

* Update IOrganizationUserRepository.ReplaceAsync to preserve existing access to collections of the type DefaultUserCollection
2025-07-29 15:04:45 +01:00
Rui Tomé
6dea40c868 [PM-23987] Fix saving to default collections by updating collection lookup (#6122)
* Refactor ICollectionRepository.GetManyByOrganizationIdAsync logic to include default user collections

* Add stored procedure Collection_ReadSharedCollectionsByOrganizationId to retrieve collections by organization ID, excluding default user collections.

* Add GetManySharedCollectionsByOrganizationIdAsync method to ICollectionRepository and its implementations to retrieve collections excluding default user collections.

* Add unit test for GetManySharedCollectionsByOrganizationIdAsync method in CollectionRepositoryTests to verify retrieval of collections excluding default user collections.

* Refactor controllers to use GetManySharedCollectionsByOrganizationIdAsync for retrieving shared collections

* Update unit tests to use GetManySharedCollectionsByOrganizationIdAsync for verifying shared collections retrieval

* Revert CiphersController.CanEditItemsInCollections to use GetManyByOrganizationIdAsync for retrieving organization collections

* Update stored procedures to retrieve only DefaultUserCollection by modifying the WHERE clause in Collection_ReadSharedCollectionsByOrganizationId.sql and its corresponding migration script.

* Update EF CollectionRepository.GetManySharedCollectionsByOrganizationIdAsync to filter collections by SharedCollection

* Update OrganizationUserRepository.GetManyDetailsByOrganizationAsync_vNext to only include Shared collections

* Update comments in stored procedure and migration script to clarify filtering for SharedCollections only
2025-07-29 15:04:00 +01:00
Rui Tomé
52ef3ef7a5 [PM-19195] Remove deprecated stored procedures (#6128) 2025-07-29 14:22:09 +01:00
aj-bw
3f508cd43b add read actions (#6137) 2025-07-29 11:58:17 +02:00
renovate[bot]
df61bd5ccd [deps] Tools: Update aws-sdk-net monorepo (#6131)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-29 11:25:44 +02:00
Maciej Zieniuk
abfb3a27b1 [PM-23242] Added UserDecryption with MasterPasswordUnlock as part of /sync response (#6102)
* Added MasterPasswordUnlock to UserDecryptionOptions as part of identity response

* Added UserDecryption with MasterPasswordUnlock as part of /sync response
2025-07-28 09:38:15 -07:00
Maciej Zieniuk
59e7bc7438 Added MasterPasswordUnlock to UserDecryptionOptions as part of identity response (#6093) 2025-07-28 17:34:42 +02:00
aj-bw
d407c164b6 BRE-917 Update to Alpine base (#5976)
* testing-wolfi

* testing alpine

* fix gosu download

* fix Admin dockerfile

* update dockerfiles

* alpine-compatible-entrypoint-script-for-api-test

* make-entrypoint-scripts-alpine-compatible

* testing nginx with alpine

* cleaning up comments from dockerfile from testing

* restore accidentally deleted icon

* remove unused file

* pin alpine, update apk add no cache

* remove comments from testing

* test shadow implementtaion for entrypoints

* add shadow package, revert entrypoints, change from bash to shell for entry

* add icu to setup container, update helpers to use shell

* update migrator utility

* add missing krb5 libraries
2025-07-28 10:56:20 -04:00
Alex Morask
db4beb47f7 Enable disabled provider on successful update payment method invocation (#6129) 2025-07-28 09:26:11 -05:00
Github Actions
cff34b9194 Bumped version to 2025.7.2 2025-07-28 14:21:49 +00:00
Justin Baur
7e80e01747 [PM-21948] Warn on deprecated logging methods (#6101)
* Add warnings and scaffold tests

* Do some private reflection

* Add tests for warnings

* Add explainer comment

* Remove Reference to Azure CosmosDb Sink

* Don't warn on old file location

* Update test names

* Add syslog test

* dotnet format

* Add lazy syslog fix

* Add longer wait for file

* Make syslog test local only

* Switch to shortened URL
2025-07-25 17:44:51 -04:00
Brandon Treston
04d66a54a4 register MasterPasswordPolicyRequirementFactory (#6125) 2025-07-25 15:55:34 +00:00
Brandon Treston
571111e897 [PM-18239] Master password policy requirement (#5936)
* wip

* initial implementation

* add tests

* more tests, fix policy Enabled

* remove exempt statuses

* test EnforcedOptions is populated

* clean up, add test

* fix test, add json attributes for deserialization

* fix attribute casing

* fix test

---------

Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>
2025-07-25 10:14:16 -04:00
Alex Morask
c503ecbefc [PM-21827] Implement mechanism to suspend currently unpaid providers (#6119)
* Manually suspend provider and set cancel_at when we receive 'suspend_provider' metadata update

* Run dotnet format'
2025-07-24 11:50:09 -05:00
Ike
05398ad8a4 [PM-22736] Send password hasher (#6112)
* feat: 
  - Add SendPasswordHasher class and interface
  - DI for SendPasswordHasher to use Marker class allowing us to use custom options for the SendPasswordHasher without impacting other PasswordHashers.
* test: Unit tests for SendPasswordHasher implementation
* doc: docs for interface and comments

Co-authored-by: Maciej Zieniuk <167752252+mzieniukbw@users.noreply.github.com>
2025-07-24 12:49:15 -04:00
Stephon Brown
76d1a2e875 [PM-23287] Enable Provider When Subscription Is Paid (#6113)
* test : add tests for provider update

* feat: add provider update logic and dependencies

* fix: remove duplicate dependencies

* refactor: updated switch logic for helper method

* test: add feature flag to tests

* feat: add feature flag for changes
2025-07-24 11:46:16 -04:00
cyprain-okeke
2cf7208eb3 [PM 21897]Add Manual Enable/Disable Override for Providers in Admin Portal (#6072)
* Add the changes for the enable provider

* remove the wanted permission added

* Added a unit testing for the updateAsync
2025-07-24 16:12:25 +01:00
Alex Morask
2d1f914eae [PM-24067] Check for unverified bank account in free trial / inactive subscription warning (#6117)
* [NO LOGIC] Move query to core

* Check for unverified bank account in free trial and inactive subscription warnings

* Run dotnet format

* fix test

* Run dotnet format

* Remove errant file
2025-07-24 09:59:23 -05:00
Brant DeBow
988b994624 [PM-17562] Add GET endpoints for event integrations (#6104)
* [PM-17562] Add GET endpoints for event integrations

* Default to null for Service

* Respond to PR Feedback
2025-07-23 14:24:59 -04:00
Alex Morask
829c3ed1d7 [PM-21821] Provider portal takeover states (#6109)
* Add feature flag

* Disable provider and schedule cancellation when subscription goes unpaid

* Run dotnet format

* Only set provider subscription cancel_at when subscription is going from paid to unpaid

* Update tests
2025-07-23 08:25:37 -05:00
Rui Tomé
141f8bf8b2 [PM-21031] Update Members Get Endpoint Optimization feature flag key to match LaunchDarkly (#6115) 2025-07-23 13:20:04 +00:00
Rui Tomé
acd556d56f [PM-21031] Optimize GET Members endpoint performance (#5907)
* Add new feature flag for Members Get Endpoint Optimization

* Add a new version of OrganizationUser_ReadByOrganizationIdWithClaimedDomains that uses CTE for better performance

* Add stored procedure OrganizationUserUserDetails_ReadByOrganizationId_V2 for retrieving user details, group associations, and collection associations by organization ID.

* Add the sql migration script to add the new stored procedures

* Introduce GetManyDetailsByOrganizationAsync_vNext and GetManyByOrganizationWithClaimedDomainsAsync_vNext in IOrganizationUserRepository to enhance performance by reducing database round trips.

* Updated GetOrganizationUsersClaimedStatusQuery to use an optimized query when the feature flag is enabled

* Updated OrganizationUserUserDetailsQuery to use optimized queries when the feature flag is enabled

* Add integration tests for GetManyDetailsByOrganizationAsync_vNext

* Add integration tests for GetManyByOrganizationWithClaimedDomainsAsync_vNext to validate behavior with verified and unverified domains.

* Optimize performance by conditionally setting permissions only for Custom user types in OrganizationUserUserDetailsQuery.

* Create UserEmailDomainView to extract email domains from users' email addresses

* Create stored procedure Organization_ReadByClaimedUserEmailDomain_V2 that uses UserEmailDomainView to fetch Email domains

* Add GetByVerifiedUserEmailDomainAsync_vNext method to IOrganizationRepository and its implementations

* Refactor OrganizationUser_ReadByOrganizationIdWithClaimedDomains_V2 stored procedure to use UserEmailDomainView for email domain extraction, improving query efficiency and clarity.

* Enhance IOrganizationUserRepository with detailed documentation for GetManyDetailsByOrganizationAsync method, clarifying its purpose and performance optimizations. Added remarks for better understanding of its functionality.

* Fix missing newline at the end of Organization_ReadByClaimedUserEmailDomain_V2.sql to adhere to coding standards.

* Update the database migration script to include UserEmailDomainView

* Bumped the date on the migration script

* Remove GetByVerifiedUserEmailDomainAsync_vNext method and its stored procedure.

* Refactor UserEmailDomainView index creation to check for existence before creation

* Update OrganizationUser_ReadByOrganizationIdWithClaimedDomains_V2 to use CTE and add indexes

* Remove creation of unique clustered index from UserEmailDomainView and related migration script adjustments

* Update indexes and sproc

* Fix index name when checking if it already exists

* Bump up date on migration script
2025-07-23 10:04:20 +01:00
Brandon Treston
947ae8db51 [PM-19145] refactor organization service.import async (#5800)
* initial lift and shift

* extract function RemoveExistingExternalUsers

* Extract function RemoveExistingUsers()

* extract function OverwriteExisting()

* create new model for sync data

* extract add users to function, rename

* rename OrganizatinUserInvite for command, implement command

* implement command

* refactor groups logic

* fix imports

* remove old tests, fix imports

* fix namespace

* fix CommandResult useage

* tests wip

* wip

* wip

* remove redundant code, remove looping db call, refactor tests

* clean up

* remove looping db call with bulk method

* clean up

* remove orgId param to use id already in request

* change param

* cleanup params

* remove IReferenceEventService

* fix test

* fix tests

* cr feedback

* remove _timeProvider

* add xmldoc, refactor to make InviteOrganizationUsersCommand vNext instead of default

* switch back to command

* re-add old ImportAsync impl

* fix test

* add feature flag

* cleanup

* clean up

* fix tests

* wip

* wip

* add api integration tests for users WIP

* groups integration tests

* cleanup

* fix error from merging main

* fix tests

* cr feedback

* fix test

* fix test
2025-07-22 17:30:25 -04:00
Tom
6278fe7bc5 Removing the unused ciritcal and notification feature flags for dirt (#6068) 2025-07-22 13:58:26 -04:00
Alex Morask
04031a94c2 [PM-23804] Add logging to AdjustSeatsAsync to identify Stripe/Organization seat disrecpancy (#6098)
* Add logging for seat scale

* Run dotnet format
2025-07-22 10:08:20 -05:00
cyprain-okeke
8a5823bff7 [PM 18701]Optional payment modal after signup (#6014)
* Add endpoint to swap plan frequency

* Add endpoint to swap plan frequency

* Resolve pr comments

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

* Refactor the code

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

* Refactor for  thr update change frequency

* Add Automatic modal opening

* catch for organization paying with PayPal

---------

Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
2025-07-22 15:57:58 +01:00
Brant DeBow
f4e1e2f1f7 [PM-17562] Add support for null/all event type (#6100)
* [PM-17562] Add support for null/all event type

* Address PR Feedback

* Adjusted SQL scripts per feedback
2025-07-22 10:02:13 -04:00
Matt Bishop
bdadf2af01 Document database projects and complete EDD support (#5855)
* Document database projects and complete EDD support

* Remove an old remnant of a now-unused 'future' state

* Sync finalization scripts

* Fix conflict

* Fix some script issues
2025-07-21 16:43:30 -04:00
Tom
3024576181 Wildcard for dirt subdirectories (#6096) 2025-07-21 15:04:16 -04:00
Vijay Oommen
4963911d7e [PM-23756] Report summary endpoints- mocked (#6092) 2025-07-21 13:44:40 -05:00
aj-bw
765c02b7d2 [BRE-1018] improve database test error messaging (#6103)
* improve database test error messaging

* removing repetitive logic
2025-07-21 12:16:16 -04:00
Justin Baur
b0b2b94fc9 Remove X509ChainCustomization Feature (#6108)
* Remove X509ChainCustomization Feature

* `dotnet format`
2025-07-21 11:54:00 -04:00
Rui Tomé
4464bfe900 [PM-15159] Create SelfHostedOrganizationSignUp command (#6089)
* Add SelfHostedOrganizationSignUpCommand for organization sign-up process

Method extracted from OrganizationService

* Register SelfHostedOrganizationSignUpCommand for dependency injection

* Add unit tests for SelfHostedOrganizationSignUpCommand

* Refactor SelfHostedOrganizationLicensesController to use ISelfHostedOrganizationSignUpCommand

* Remove SignUpAsync method and related validation from IOrganizationService and OrganizationService

* Move ISelfHostedOrganizationSignUpCommand into a separate file and update references

* Enable null safety in SelfHostedOrganizationSignUpCommand and update ISelfHostedOrganizationSignUpCommand interface to reflect nullable types for organizationUser and collectionName.
2025-07-21 14:35:41 +01:00
cyprain-okeke
79661dd5f5 [PM 22967] Add change to enable organization after unlink (#6086)
* Add change to enable organization after unlink

* PM-22967 remove comments
2025-07-21 14:17:12 +01:00
renovate[bot]
ae61150db5 [deps] Tools: Update aws-sdk-net monorepo (#6106)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-21 09:14:04 +00:00
Rui Tomé
30300bc59b [PM-22103] Exclude default collections from admin apis (#6021)
* feat: exclude DefaultUserCollection from GetManyByOrganizationIdWithPermissionsAsync

Updated EF implementation, SQL procedure, and unit test to verify that default user collections are filtered from results

* Update the public CollectionsController.Get method to return a NotFoundResult for collections of type DefaultUserCollection.

* Add unit tests for the public CollectionsController

* Update ICollectionRepository.GetManyByOrganizationIdAsync to exclude results of the type DefaultUserCollection

Modified the SQL stored procedure and the EF query to reflect this change and added a new integration test to ensure the functionality works as expected.

* Refactor CollectionsController to remove unused IApplicationCacheService dependency

* Update IOrganizationUserRepository.GetDetailsByIdWithCollectionsAsync to exclude DefaultUserCollections

* Update IOrganizationUserRepository.GetManyDetailsByOrganizationAsync to exclude DefaultUserCollections

* Undo change to GetByIdWithCollectionsAsync

* Update integration test to verify exclusion of DefaultUserCollection in OrganizationUserRepository.GetDetailsByIdWithCollectionsAsync

* Clarify documentation in ICollectionRepository to specify that GetManyByOrganizationIdWithAccessAsync returns only shared collections belonging to the organization.

* Add Arrange, Act, and Assert comments to CollectionsControllerTests
2025-07-18 13:00:54 +01:00
Ike
828003f101 [PM-19055] Add OTP Token Provider that is not dependent on the User entity (#6081)
* feat(pm-19055) : 
  - Add generic OTP generator. This OTP generator is not linked to .NET Identity giving us flexibility.
  - Update `OtpTokenProvider` to accept configuration object to keep interface clean.
  - Implement `OtpTokenProvider` in DI as open generic for flexibility.
* test: 100% test coverage for `OtpTokenProvider`
* doc: Added readme for `OtpTokenProvider`
2025-07-17 17:44:20 -04:00
Alex Morask
ec70a18bda [NO LOGIC] [PM-21100] Organize billing organization code (#6099)
* [NO LOGIC] Organize Billing organization code

* Run dotnet format
2025-07-17 12:02:25 -05:00
Matt Bishop
9a501f95c8 Move more SQL files that were placed in the wrong location (#6094) 2025-07-17 09:55:21 -04:00
Brant DeBow
5fc7f4700c [PM-17562] Add in-memory cache for event integrations (#6085)
* [PM-17562] Add in-memory cache for event integrations

* Fix Sql error

* Fix failing test

* Add additional tests for new cache service

* PR suggestions addressed
2025-07-16 11:41:08 -04:00
Rui Tomé
e9d4403773 [PM-20167] Refactor: Remove flagged logic for FeatureFlagKeys.SeparateCustomRolePermissions 2025-07-16 16:36:22 +01:00
Maciej Zieniuk
45370623e9 Feature flag for ForceUpdateKDFSettings (#6087) 2025-07-15 16:12:09 +02:00
renovate[bot]
5270fba44d [deps] Auth: Update sass to v1.89.2 (#5863)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-15 10:02:51 -04:00
Oscar Hinton
42ff09b84f [PM-22423] Add MJML (#5941)
Scaffolds MJML and adds some initial templates and components.

Of interest are:

* src/Core/MailTemplates/Mjml/components/hero.js demonstrates how to create a custom MJML component. In our case it's a hero component with our logo, a title, a call to action button and an image.
* src/Core/MailTemplates/Mjml/components/head.mjml defines some common styling.
* src/Core/MailTemplates/Mjml/components/footer.mjml social links and footer.
2025-07-15 15:53:29 +02:00