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

6461 Commits

Author SHA1 Message Date
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
Nick Krantz
9fcedd5b91 remove nudge feature flag (#6643) 2025-11-25 16:32:46 -06:00
Matt Bishop
35a0b675a2 Add full-featured caching docs (#6639)
* Add full-featured caching docs

* Improve some things from a weak README port

* Implement Claude suggestions

* Address Brant's comments

* Revise recommendations toward ExtendedCache in more situations

* Provide forward-looking documentation on how the application cache will also work

* Address minor feedback points
2025-11-25 16:53:50 -05:00
Thomas Rittson
35b4b0754c [PM-25913] Fix owners unable to rename provider-managed organization (#6599)
And other refactors:
- move update organization method to a command
- separate authorization from business logic
- add tests
- move Billing Team logic into their service
2025-11-26 07:38:01 +10:00
Vicki League
3559759f4b [CL-923] Add feature flag for router focus mgmt (#6623) 2025-11-25 13:13:36 -05:00
Brant DeBow
1413dd7689 [PM-12642] Add new ExtendedCache to add caching to template parameters (#6608)
* Add new ExtendedCache to add caching to template parameters

* Added Cache constants for building consistent keys/name, clarified that we are using defaults including TTL, removed as much fusion cache references as possible
2025-11-25 10:58:39 -05:00
renovate[bot]
f0f10bcb95 [deps] Billing: Update xunit-dotnet monorepo (#5732)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Conner Turnbull <133619638+cturnbull-bitwarden@users.noreply.github.com>
2025-11-25 15:34:59 +01:00
Todd Martin
ebe5306fd2 chore(docs): Updated docs for IMailer and MJML
* Updated docs for IMailer.

* More changes.

* Added deprecation context.

* ViewModel corrections.

* Updated link.

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>

* Updated link.

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>

* Updated steps for clarity.

* Update src/Core/MailTemplates/Mjml/README.md

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>

* Grammar fix.

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>

---------

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
2025-11-24 23:48:53 -05:00
rr-bw
5fb69e42b0 feat(marketing-initiated-premium): (Auth) [PM-27541] Add optional marketing param to email verification link (#6604)
Adds an optional `&fromMarketing=premium` query parameter to the verification email link.

Feature flag: `"pm-26140-marketing-initiated-premium-flow"`
2025-11-24 15:06:16 -08:00
SmithThe4th
9131427622 Added bump account revision date to sproc (#6640) 2025-11-24 14:57:06 -08:00
Kyle Denney
931f0c65af [PM-28265] storage reconciliation job (#6615) 2025-11-24 16:11:52 -06:00
Brant DeBow
9573cab37e Add template properties for Datadog (#6528)
* Add template properites for Datadog

* Add test and implementation for including User and ActingUser when only the Type is referenced

* Refactored database calls to fetch the user details in a single DB call

* Refactor to use a dedicated stored procedure for Dapper

* Remove TOP 1 from stored procedure

* Accept Claude's optimization of SingleOrDefaultAsync to unify Dapper/EF

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>

* Revert earlier change and add TOP 1 back into stored procedure

* Change go to GO

* Revert back to version that assumes uniqueness, remove TOP 1

---------

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
2025-11-24 10:30:45 -05:00
Rui Tomé
fcc879bd23 [PM-28252] Add new feature flag for increasing bulk reinvite limit for cloud (#6624) 2025-11-24 11:41:01 +00:00
Justin Baur
fdfec0ac4d Remove deprecated logging methods (#6516) 2025-11-21 14:39:26 -05:00
rr-bw
042279682a feat(marketing-initiated-premium): (Auth) [PM-27540] Add optional Marketing Property to RegisterSendVerificationEmailRequestModel (#6598)
Adds an optional `FromMarketing` property to the RegisterSendVerificationEmailRequestModel.
2025-11-21 09:38:59 -08:00
Alex Morask
62705917ab Remove unreferenced FF (#6612) 2025-11-21 11:12:33 -06:00
Jimmy Vo
1cc787f1f0 [PM-27879] Add AC shared MJML components (#6605) 2025-11-21 10:01:39 -05:00
renovate[bot]
08ce693fbf [deps] Platform: Update LaunchDarkly.ServerSdk to 8.10.4 (#6616)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-21 14:44:19 +01:00
Patrick-Pimentel-Bitwarden
59b6cd0cdb feat(prelogin): [Auth/PM-27062] Prelogin New Response (#6583)
* feat(prelogin): [PM-27062] Prelogin New Response - Initial changes to support new data coming back from prelogin.

* test(prelogin): [PM-27062] Prelogin New Response - Added tests.
2025-11-20 15:43:01 -05:00
Alex Morask
c81b0dcd49 [PM-28249] Write PlanType claim as an integer (#6610)
* Write PlanType claim as an integer

* Accept FamiliesAnnually2025 for FamiliesAnnually plan type
2025-11-20 14:08:20 -06:00
Ike
8b169551f5 Update MjmlWelcomeEmailTemplates Feature Flag Key (#6611) 2025-11-20 14:51:38 -05:00
renovate[bot]
a434419313 [deps]: Update sdk-internal to 7080159 (#6609)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-20 18:28:01 +01:00
Oscar Hinton
6653b9802e Group sdk dependencies take 2 (#6607) 2025-11-20 17:36:37 +01:00
Kyle Spearrin
c0700a6946 [PM-27766] Add policy for blocking account creation from claimed domains. (#6537)
* Add policy for blocking account creation from claimed domains.

* dotnet format

* check as part of email verification

* add feature flag

* fix tests

* try to fix dates on database integration tests

* PR feedback from claude

* remove claude local settings

* pr feedback

* format

* fix test

* create or alter

* PR feedback

* PR feedback

* Update src/Core/Constants.cs

Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>

* fix merge issues

* fix tests

---------

Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>
2025-11-20 11:25:50 +10:00
Shane Melton
55fb80b2fc [PM-27662] Add revision date to policy response model (#6602) 2025-11-20 09:55:19 +10:00
Nik Gilmore
d81c61637e [PM-24314] Remove feature flag pm-9111-extension-persist-add-edit-form (#6561) 2025-11-19 15:31:34 -08:00
Brant DeBow
3c874646e8 Upgrade ExtendedCache with support for named caches (#6591)
* Upgrade ExtendedCache with support for named caches

* Addressed Claude PR suggestions - defensive mux creation, defend empty cache name, added tests

* Addressed PR suggestions; Fixed issue where IDistributedCache was missing when using the shared route; Added more unit tests

* Revert to TryAdd, document expectation that AddDistributedCache is called first
2025-11-19 14:42:03 -05:00
renovate[bot]
4c543fa824 [deps]: Update github/codeql-action action to v4 (#6500)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Daniel James Smith <2670567+djsmith85@users.noreply.github.com>
2025-11-19 20:09:01 +01:00