6488 Commits

Author SHA1 Message Date
Todd Martin
0f4d48e63d
Removed pm-24425-send-2fa-failed-email 2025-12-06 18:01:15 -05:00
Brant DeBow
2504fd9de4
Add CQRS and caching support for OrganizationIntegrations (#6689)
* Add CQRS and caching support for OrganizationIntegrations

* Use primary constructor for Delete command, per Claude suggestion

* Fix namespace

* Add XMLDoc for new commands / queries

* Remove unnecessary extra call to AddExtendedCache in Startup (call in EventIntegrationsServiceCollectionExtensions handles this instead)

* Alter strategy to use one cache / database call to retrieve all configurations for an event (including wildcards)

* Updated README documentation to reflect updated Caching doc and updated CQRS approach
2025-12-05 15:28:07 -05:00
Jordan Aasen
3ff59021ae
[PM-20206][PM-22372] - remove end user notifications feature flags (#6642)
* remove end user notifications feature flag

* remove end user notifications feature flag
2025-12-05 12:00:51 -08:00
Jordan Aasen
b18506a0c1
add feature flag (#6693) 2025-12-05 11:06:09 -08:00
Brant DeBow
813fad8021
Use extended cache for caching integration configuration details (#6650)
* Use extended cache for caching integration configuration details

* Alter strategy to use one cache / database call to retrieve all configurations for an event (including wildcards)

* Renamed migration per @withinfocus suggestion
2025-12-05 13:12:27 -05:00
Jared McCannon
2f893768f5
[PM-18718] Refactor Bulk Revoke Users (#6601) 2025-12-05 11:19:26 -06:00
Ike
d5f39eac91
[PM-28769] [PM-28768] [PM-28772] Welcome email bug fixes (#6644)
Fix: fix bugs reported by QA for Welcome emails
* test: add test for new plan type in welcome email

* fix: change to headStyle so styling is only included once

* fix: update MJML templates to have correct copy text

* chore: move build artifacts for updated email templates

* fix: add setting for SMTP to SSO project

* fix: update component css styling

* chore: rebuild hbs templates

* fix: using billing extension method to fetch Correct PlanType.
2025-12-05 11:35:37 -05:00
Rui Tomé
5469d8be0e
[PM-28260] Optimize bulk reinvite endpoint (#6670)
* Implement optimized bulk invite resend command

- Added IBulkResendOrganizationInvitesCommand interface to define the bulk resend operation.
- Created BulkResendOrganizationInvitesCommand class to handle the logic for resending invites to multiple organization users.
- Integrated logging and validation to ensure only valid users receive invites.
- Included error handling for non-existent organizations and invalid user statuses.

* Add unit tests for BulkResendOrganizationInvitesCommand

- Implemented comprehensive test cases for the BulkResendOrganizationInvitesCommand class.
- Validated user statuses and ensured correct handling of valid and invalid users during bulk invite resends.
- Included tests for scenarios such as organization not found and empty user lists.
- Utilized Xunit and NSubstitute for effective testing and mocking of dependencies.

* Add IBulkResendOrganizationInvitesCommand to service collection

- Registered IBulkResendOrganizationInvitesCommand in the service collection for dependency injection.

* Update OrganizationUsersController to utilize IBulkResendOrganizationInvitesCommand

- Added IBulkResendOrganizationInvitesCommand to the OrganizationUsersController for handling bulk invite resends based on feature flag.
- Updated BulkReinvite method to conditionally use the new command or the legacy service based on the feature flag status.
- Enhanced unit tests to verify correct command usage depending on feature flag state, ensuring robust testing for both scenarios.
2025-12-05 16:28:04 +00:00
Jared McCannon
18a8829476
[PM-26377] Correcting Auto Confirm Handler Provider Check (#6681)
* Fixed bug where providers weren't being checked correctly in auto confirm handler.
2025-12-05 08:28:42 -06:00
Rui Tomé
80ee31b4fe
[PM-25015] Add performance tests for Admin Console endpoints (#6235)
* Add GroupsRecipe to manage group creation and user relationships in organizations

* Add CollectionsRecipe to manage collection creation and user relationships in organizations

* Refactor OrganizationUsersControllerPerformanceTests to enhance performance testing and add new test cases

* Add OrganizationDomainRecipe to add verified domains for organizations

* Add more tests to OrganizationUsersControllerPerformanceTests and enhance seeding logic for organizations

- Updated performance tests to use dynamic domain generation for organization users.
- Refactored seeding methods in OrganizationWithUsersRecipe to accept user status and type.
- Modified AddToOrganization methods in CollectionsRecipe and GroupsRecipe to return created IDs.
- Adjusted DbSeederUtility to align with new seeding method signatures.

* Enhance OrganizationSeeder with additional configuration options and update seat calculation in OrganizationWithUsersRecipe to ensure a minimum of 1000 seats.

* Add performance tests for Groups, Organizations, Organization Users, and Provider Organizations controllers

- Introduced `GroupsControllerPerformanceTests` to validate the performance of the PutGroupAsync method.
- Added `OrganizationsControllerPerformanceTests` with multiple tests including DeleteOrganizationAsync, DeleteOrganizationWithTokenAsync, PostStorageAsync, and CreateWithoutPaymentAsync.
- Enhanced `OrganizationUsersControllerPerformanceTests` with DeleteSingleUserAccountAsync and InviteUsersAsync methods to test user account deletion and bulk invitations.
- Created `ProviderOrganizationsControllerPerformanceTests` to assess the performance of deleting provider organizations.

These tests ensure the reliability and efficiency of the respective controller actions under various scenarios.

* Refactor GroupsControllerPerformanceTests to use parameterized tests

- Renamed `GroupsControllerPerformanceTest` to `GroupsControllerPerformanceTests` for consistency.
- Updated `PutGroupAsync` method to use `[Theory]` with `InlineData` for dynamic user and collection counts.
- Adjusted organization user and collection seeding logic to utilize the new parameters.
- Enhanced logging to provide clearer performance metrics during tests.

* Update domain generation in GroupsControllerPerformanceTests for improved test consistency

* Remove ProviderOrganizationsControllerPerformanceTests

* Refactor performance tests for Groups, Organizations, and Organization Users controllers

- Updated method names for clarity and consistency, e.g., `PutGroupAsync` to `UpdateGroup_WithUsersAndCollections`.
- Enhanced test documentation with XML comments to describe the purpose of each test.
- Improved domain generation logic for consistency across tests.
- Adjusted logging to provide detailed performance metrics during test execution.
- Renamed several test methods to better reflect their functionality.

* Refactor performance tests in Organizations and Organization Users controllers

- Updated tests to use parameterized `[Theory]` attributes with `InlineData` for dynamic user, collection, and group counts.
- Enhanced logging to include detailed metrics such as user and collection counts during test execution.
- Marked several tests as skipped for performance considerations.
- Removed unused code and improved organization of test methods for clarity.

* Add bulk reinvite users performance test to OrganizationUsersControllerPerformanceTests

- Implemented a new performance test for the POST /organizations/{orgId}/users/reinvite endpoint.
- Utilized parameterized testing with `[Theory]` and `InlineData` to evaluate performance with varying user counts.
- Enhanced logging to capture request duration and response status for better performance insights.
- Updated OrganizationSeeder to conditionally set email based on user status during seeding.

* Refactor domain generation in performance tests to use OrganizationTestHelpers

- Updated domain generation logic in GroupsControllerPerformanceTests, OrganizationsControllerPerformanceTests, and OrganizationUsersControllerPerformanceTests to utilize the new GenerateRandomDomain method from OrganizationTestHelpers.
- This change enhances consistency and readability across the tests by centralizing domain generation logic.

* Update CollectionsRecipe to have better readability

* Update GroupsRecipe to have better readability

* Refactor authentication in performance tests to use centralized helper method. This change reduces code duplication across Groups, Organizations, and OrganizationUsers controller tests by implementing the `AuthenticateClientAsync` method in a new `PerformanceTestHelpers` class.

* Refactor OrganizationUsersControllerPerformanceTests to filter organization users by OrganizationId.

* Refactor CreateOrganizationUser method to improve handling of user status and key assignment based on invitation and confirmation states.

* Add XML documentation for CreateOrganizationUser method to clarify user status handling
2025-12-05 14:22:00 +00:00
Brant DeBow
3605b4d2ff
Upgrade ExtendedCache to support non-Redis distributed cache (#6682)
* Upgrade ExtendedCache to support non-Redis distributed cache

* Update CACHING.md to use UseSharedDistributedCache setting

Updated documentation to reflect the setting rename from UseSharedRedisCache
to UseSharedDistributedCache in the ExtendedCache configuration examples.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Matt Bishop <withinfocus@users.noreply.github.com>
2025-12-04 16:37:51 -05:00
Alex Morask
101ff9d6ed
[PM-28423] Add latest_invoice expansion / logging to SubscriptionCancellationJob (#6603)
* Added latest_invoice expansion / logging to cancellation job

* Run dotnet format

* Claude feedback

* Run dotnet format
2025-12-04 13:10:13 -06:00
Jimmy Vo
d88fff4262
[PM-21742] Fix MJML validation error. (#6687) 2025-12-04 11:30:26 -05:00
cyprain-okeke
d619a49998
[PM-28508] Fix No validation occurs for Expiration date on Self Host licenses (#6655)
* Fix the license validation bug

* resolve the failing test

* fix the failing test

* Revert changes and Add the ui display fix

* remove empty spaces

* revert the changes on licensing file

* revert changes to the test signup

* Revert the org license file changes

* revert the empty spaces

* revert the empty spaces changes

* remove the empty spaces

* revert

* Remove the duplicate code

* Add the expire date fix for premium

* Fix the failing test

* Fix the lint error
2025-12-04 16:28:01 +01:00
Jared Snider
655054aa56
refactor(IdentityTokenResponse): [Auth/PM-3537] Remove deprecated "KeyConnectorUrl" from root of IdentityTokenResponse (#6627)
* PM-3537 - Remove "KeyConnectorUrl" from root of IdentityTokenResponse

* PM-3537 - CustomTokenRequestValidator.cs - update comment to be accurate
2025-12-03 16:57:01 -05:00
Ike
b0f6b22b3d
chore: update duende license (#6680) 2025-12-03 13:50:01 -05:00
Bernd Schoolmann
ed7a234eeb
Add data recovery tool flag (#6659) 2025-12-03 19:19:46 +01:00
cd-bitwarden
98212a7f49
[SM-1592] API for Secret Versioning, adding controller, repository and tests (#6444)
* Adding SecretVersion table to server

* making the names singular not plural for new table

* removing migration

* fixing migration

* Adding indexes for serviceacct and orguserId

* indexes for sqllite

* fixing migrations

* adding indexes to secretVeriosn.sql

* tests

* removing tests

* adding GO

* api repository and controller additions for SecretVersion table, as well as tests

* test fix sqllite

* improvements

* removing comments

* making files nullable safe

* Justin Baurs suggested changes

* claude suggestions

* Claude fixes

* test fixes
2025-12-03 12:17:29 -05:00
Vincent Salucci
ded1c58c27
[PM-26426] [PM-26427] Remove feature flag - policy validators/requirements refactor (#6674)
* chore: remove ff from PoliciesController, refs PM-26426

* chore: remove ff from public PoliciesController, refs PM-26426

* chore: remove ff from VerifyOrganizationDomainCommands, refs PM-26426

* chore: remove ff from SsoConfigService, refs PM-26426

* chore: remove ff from public PoliciesControllerTests, refs PM-26426

* chore: remove ff from PoliciesControllerTests, refs PM-26426

* chore: remove ff from VerifyOrganizationDomainCommandTests, refs PM-26426

* chore: remove ff from SsoConfigServiceTests, refs PM-26426

* chore: remove ff definition, refs PM-26427

* chore: dotnet format

* chore: remove unused constructor parameters, refs PM-26426

* chore: fix failing tests for VerifyOrganizationDomainCommandTests and SsoConfigServiceTests, refs PM-26426
2025-12-03 10:42:54 -06:00
Kyle Spearrin
1566a6d587
[PM-28871] Default startIndex and count values on SCIM groups list API (#6648)
* default startindex and count values on SCIM groups list api

* convert params to a model, like users

* review feedback

* fix file name to be plural

* added integration test
2025-12-03 15:52:09 +00:00
Vincent Salucci
28e9c24f33
[PM-25584] [PM-25585] Remove feature flag - recover provider accounts (#6673)
* chore: remove ff from OrganizationUsersController, refs PM-25584

* chore: update tests with reference to ff, refs PM-25584

* chore: remove ff definition, refs PM-25585

* chore: dotnet format, refs PM-25584
2025-12-02 23:23:58 -06:00
Thomas Rittson
ee26a701e9
[BEEEP] [PM-28808] Fix invalid identity URL in Swagger (#6653)
- in generated JSON (used in help center), only show cloud options
  (with corrected identity URL)
- in self-host and dev, only show local option
2025-12-02 23:20:56 +00:00
Kyle Denney
89a2eab32a
[PM-23717] premium renewal email (#6672)
* [PM-23717] premium renewal email

* pr feedback

* pr feedback
2025-12-02 16:38:28 -06:00
Bernd Schoolmann
de5a81bdc4
Move request models to core (#6667)
* Move request models to core

* Fix build

* Fix

* Undo changes
2025-12-02 19:54:40 +01:00
Nick Krantz
5b8b394982
allow for archived ciphers to be shared into an organization (#6626) 2025-12-02 11:43:22 -06:00
Alex Morask
71be3865ea
[PM-24558] Remove FF: pm-21821-provider-portal-takeover (#6613)
* Remove FF: pm-21821-provider-portal-takeover

* Run dotnet format
2025-12-02 10:16:37 -06:00
Matt Bishop
b3573c15fd
Validate any SQL migration scripts are the most recent (#6652)
* Validate any SQL migration scripts are the most recent

* Make string checks more robust

* Clarify script location

* Remove need given the additional validations that are immediately valuable

* Allow past incorrectly-named migrations but now enforce

* Centralize validation logic to PowerShell script
2025-12-02 08:15:47 -05:00
Kyle Spearrin
63855cbb5a
Add BlockClaimedDomainAccountCreationPolicyValidator to AddPolicyValidators (#6665) 2025-12-01 17:49:52 -05:00
Alex
aa3172e24f
[PM-6979] correct REST semantics (#6661)
* fix: Return 200 OK with empty array for HIBP breach endpoint when no breaches found

Changes the HIBP breach check endpoint to return HTTP 200 OK with an empty
JSON array `[]` instead of 404 Not Found when no breaches are found. This
follows proper REST API semantics where 404 should indicate the endpoint
doesn't exist, not that a query returned no results.

Changes:
- src/Api/Dirt/Controllers/HibpController.cs: Lines 67-71
- Changed: return new NotFoundResult(); → return Content("[]", "application/json");

Backward Compatible:
- Clients handle both 200 with [] (new) and 404 (old)
- No breaking changes
- Safe to deploy independently

API Response Changes:
- Before: GET /api/hibp/breach?username=safe@example.com → 404 Not Found
- After:  GET /api/hibp/breach?username=safe@example.com → 200 OK, Body: []

Impact:
- No user-facing changes
- Correct REST semantics
- Industry-standard API response pattern

* Address PR feedback: enhance comment and add comprehensive unit tests

Addresses feedback from PR #6661:

1. Enhanced comment per @prograhamming's feedback (lines 69-71):
   - Added date stamp (12/1/2025)
   - Explained HIBP API behavior: returns 404 when no breaches found
   - Clarified HIBP API specification about 404 meaning
   - Maintained REST semantics justification

2. Created comprehensive unit tests per Claude bot's Finding 1:
   - New file: test/Api.Test/Dirt/HibpControllerTests.cs
   - 9 test cases covering all critical scenarios:
     * Missing API key validation
     * No breaches found (404 → 200 with []) - KEY TEST FOR PR CHANGE
     * Breaches found (200 with data)
     * Rate limiting with retry logic
     * Server error handling (500, 400)
     * URL encoding of special characters
     * Required headers validation
     * Self-hosted vs cloud User-Agent differences

Test Coverage:
- Before: 0% coverage for HibpController
- After: ~90% coverage (all public methods and major paths)
- Uses xUnit, NSubstitute, BitAutoData patterns
- Matches existing Dirt controller test conventions

Changes:
- src/Api/Dirt/Controllers/HibpController.cs: Enhanced comment (+3 lines)
- test/Api.Test/Dirt/HibpControllerTests.cs: New test file (327 lines, 9 tests)

Addresses:
- @prograhamming's comment about enhancing the code comment
- Claude bot's Finding 1: Missing unit tests for HibpController

Related: PM-6979

* fix test/formating errors
2025-12-01 12:37:31 -08:00
Brandon Treston
20efb5eb5e
add readme (#6664) 2025-12-01 15:31:30 -05:00
Kyle Denney
02568c8e7c
[PM-28100] families 2019 email (#6645)
* [PM-28100] families 2019 email

* pr feedback
2025-12-01 14:01:26 -06:00
Vince Grassia
267759db45
Update token permissions to properly trigger workflows (#6662) 2025-12-01 14:19:40 -05:00
Vijay Oommen
599fbc0efd
[PM-28616] Add flag UsePhishingBlocker to dbo.Organization (#6625)
* PM-28616 Add flag UsePhishingBlocker to dbo.Organization

* PM-28616 updated as per comments from claude

* PM-28616 updated ToLicense Method to copy the license file

* PM-28616 allow phishing blocker to be imported via license files for self-hosted

* PM-28616 updated PR comments - added more views to be refreshed

* PM-28616 removed proeprty from constructor as it is not used anymore. We have moved to claims based properties
2025-12-01 13:31:36 -05:00
Eli Grubb
c3301ce475
[PM-22275] Remove encryption-related feature flags (#6654) 2025-12-01 08:33:56 -07:00
Brandon Treston
a5ea603817
[PM-24011] Create new policy sync push notification (#6594)
* create new policy sync push notification

* CR feedback

* add tests, fix typo
2025-12-01 10:21:44 -05:00
Jared McCannon
62cbe36ce1
Forgot to add AutomaticUserConfirmationPolicyEventHandler to the IPolicyValidator implementation registration. (#6637) 2025-12-01 09:11:43 -06:00
Github Actions
5af060fbf5 Bumped version to 2025.12.0 2025-12-01 11:46:27 +00:00
Vince Grassia
3df68ea36f
BRE-1355 - Fix lite naming and remove PAT (#6658) 2025-12-01 08:46:51 +01:00
Ike
8a67aafbe5
[PM-1632] Redirect on SsoRequired - return SsoOrganizationIdentifier (#6597)
feat: add SSO request validation and organization identifier lookup

- Implement SsoRequestValidator to validate SSO requirements
- Add UserSsoOrganizationIdentifierQuery to fetch organization identifiers
- Create SsoOrganizationIdentifier custom response for SSO redirects
- Add feature flag (RedirectOnSsoRequired) for gradual rollout
- Register validators and queries in dependency injection
- Create RequestValidationConstants to reduce magic strings
- Add comprehensive test coverage for validation logic
- Update BaseRequestValidator to consume SsoRequestValidator
2025-11-30 16:55:47 -05:00
sneakernuts
f151abee54
SRE-3494 cleanup (#6657) 2025-11-28 14:02:00 -07:00
Jim Hays
480c20a480
[PM-1968] Spellcheck bugs (#2877)
* Bug fix: 'captchResponse' -> 'captchaResponse'

* Bug fix: 'GoupUser' -> 'GroupUser'

* Bug fix: 'Cateogry' -> 'Category'

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2025-11-28 15:45:23 +00:00
Usman
7cbc50de98
Removed unused global settings and listenerlogger and passed cancelationtoken to Task.Delay methods (#1810)
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2025-11-28 15:15:06 +00:00
renovate[bot]
a17f94e150
[deps] Billing: Update xunit.runner.visualstudio to v3 (#5742)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-28 16:10:39 +01:00
renovate[bot]
6a5430ff0a
[deps] Platform: Update quartznet monorepo to 3.15.1 (#6211)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-28 15:46:08 +01:00
renovate[bot]
3133dc91ae
[deps]: Update MartinCostello.Logging.XUnit to 0.7.0 (#6046)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-28 15:36:01 +01:00
renovate[bot]
3ad486068d
[deps] Platform: Update azure azure-sdk-for-net monorepo (#5735)
* [deps] Platform: Update azure azure-sdk-for-net monorepo

* Remove bump of Azure.Extensions.AspNetCore.DataProtection.Blobs because it require Microsoft.AspNetCore.DataProtection >= 8.0.11

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2025-11-28 12:33:51 +01:00
Todd Martin
eed856cc04
Move Azure.Extensions.AspNetCore.DataProtection.Blobs to Platform (#5442) 2025-11-28 12:10:50 +01:00
renovate[bot]
d3e4ac76b4
[deps]: Update CommandDotNet to 7.0.5 (#5063)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-26 20:46:43 +01:00
renovate[bot]
1334ed89f0
[deps]: Update github/codeql-action action to v4.31.4 (#6618)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-26 18:34:24 +01:00
Alex Morask
219993cc2e
[PM-26461] Send F2020 renewal email (#6638)
* Send F2020 renewal email

* Implement and use simple hero

* Cy's feedback
2025-11-26 08:37:48 -06:00