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

6233 Commits

Author SHA1 Message Date
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
Jared McCannon
d3c0dca178 fixing method signature. (#6088) 2025-07-15 08:47:40 -05:00
Jared McCannon
c4965350d1 [PM-12474] Move to authorization to attibutes/handlers/requirements (#6001)
* Created ReadAllOrganizationUsersBasicInformationRequirement for use with Authorize attribute.

* Removed unused req and Handler and tests. Moved to new auth attribute

* Moved tests to integration tests with new response.

* Removed tests that were migrated to integration tests.

* Made string params Guids instead of parsing them manually in methods.

* Admin and Owner added to requirement.

* Added XML docs for basic get endpoint. Removed unused. Added another auth check. Inverted if check.

* Removed unused endpoint

* Added tests for requirement

* Added checks for both User and Custom

* Added org id check to validate the user being requested belongs to the org in the route.

* typo
2025-07-15 07:52:47 -05:00
adudek-bw
93a00373d2 Add feature flag for using sdk password generators (#6082) 2025-07-15 07:38:14 -04:00
Brandon Treston
676f39cef8 [PM-20554] fix admin endpoint for deleting unassigned items (#6061)
* fix admin endpoint for deleting unassigned items

* whitespace cleanup

* fix tests

* switch type cast to constructor for CipherDetails

* fix tests
2025-07-14 15:50:10 -04:00
Alex Morask
d914ab8a98 [PM-23687] Support free organizations on Payment Details page (#6084)
* Resolve JSON serialization bug in OneOf converters and organize pricing models

* Support free organizations for payment method and billing address flows

* Run dotnet format
2025-07-14 12:39:49 -05:00
Github Actions
0e4e060f22 Bumped version to 2025.7.1 v2025.7.1 2025-07-14 14:29:17 +00:00
Todd Martin
2f8460f4db feat(OTP): [PM-18612] Change email OTP to six digits
* Change email OTP to 6 digits

* Added comment on base class

* Added tests

* Renamed tests.

* Fixed tests

* Renamed file to match class
2025-07-14 10:23:30 -04:00
Conner Turnbull
9b65e9f4cc [PM-22580] Org/User License Codeownership Move (No logic changes) (#6080)
* Moved license models to billing

* Moved LicensingService to billing

* Moved license command and queries to billing

* Moved LicenseController to billing
2025-07-11 16:41:32 -04:00
tangowithfoxtrot
24b7cc417f feat(self-host): [PM-14188] Add option to disable built-in MSSQL container
* Add Config Option For Disabling Built In MSSQL Container

* fix: flip bool condition and make it nullable

* fake commit to kick off an ephemeral environment

* Revert "fake commit to kick off an ephemeral environment"

This reverts commit 818f65f4d2.

* Changed the new setting to not be nullable.

---------

Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
Co-authored-by: Todd Martin <tmartin@bitwarden.com>
2025-07-11 11:23:51 -04:00
Shane Melton
067e464ec4 [PM-23183] Add logger data before throwing for mismatched encryptedFor (#6078) 2025-07-11 07:32:59 -07:00
Todd Martin
ca1baa1220 chore(feature-flag): Adding feature flag for push notifications on locked account 2025-07-10 20:07:57 -04:00
bnagawiecki
1176b18d44 fix TDE offboarding event type (#6076) 2025-07-10 12:57:22 -04:00
Graham Walker
df004d0af0 PM-21685 fixing flaky test (#6065)
* PM-21685 fixing flaky test

* PM-21685 adding a comment to explain why imports changed for test
2025-07-10 10:03:55 -05:00
Vijay Oommen
9a97384670 [PM-23575] Use the input text as question and avoid additional call to freshdesk (#6073) 2025-07-10 08:34:45 -05:00
Alex Morask
7f65a655d4 [PM-21881] Manage payment details outside of checkout (#6032)
* Add feature flag

* Further establish billing command pattern and use in PreviewTaxAmountCommand

* Add billing address models/commands/queries/tests

* Update TypeReadingJsonConverter to account for new union types

* Add payment method models/commands/queries/tests

* Add credit models/commands/queries/tests

* Add command/query registrations

* Add new endpoints to support new command model and payment functionality

* Run dotnet format

* Add InjectUserAttribute for easier AccountBillilngVNextController handling

* Add InjectOrganizationAttribute for easier OrganizationBillingVNextController handling

* Add InjectProviderAttribute for easier ProviderBillingVNextController handling

* Add XML documentation for billing command pipeline

* Fix StripeConstants post-nullability

* More nullability cleanup

* Run dotnet format
2025-07-10 08:32:25 -05:00
Justin Baur
3bfc24523e Replace Thread.Sleep with Task.Delay (#6006) 2025-07-10 09:17:08 -04:00
Jared McCannon
f5be1ede2f Adding and setting DefaultUserCollectionEmail in the response model (#6074) 2025-07-09 16:05:25 -05:00
Andy Pixley
5772c467de [BRE-831] migrate secrets AKV (#5962) 2025-07-09 15:02:11 -04:00
Shane Melton
12b2eeaa66 [PM-22136] Add SDK Cipher Encryption feature flag (#6070) 2025-07-09 08:26:49 -07:00
Justin Baur
4cd930caff Turn NRT on by default in all new projects/files (#6069) 2025-07-09 10:41:17 -04:00
renovate[bot]
2c58896c7e [deps] Tools: Update aws-sdk-net monorepo (#6071)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-09 14:13:42 +02:00
Justin Baur
da66400248 Add #nullable disable to AC code (#6052) 2025-07-08 17:32:49 -04:00
Justin Baur
8fdd26bf1c Add #nullable disable to tools code (#6058) 2025-07-08 20:02:15 +02:00
Todd Martin
b4c9133d12 feat(otp): Revert [PM-18612] Consolidate all email OTP to use 6 digits
This reverts commit 737f549f82.
2025-07-08 13:59:44 -04:00