1
0
mirror of https://github.com/bitwarden/server.git synced 2025-05-09 13:42:21 -05:00

2654 Commits

Author SHA1 Message Date
Alex Morask
7fe022e26f
Add SmMaxProjects to OrganizationLicense (#5678)
* Add SmMaxProjects to OrganizationLicense

* Run dotnet format
2025-05-05 09:48:43 -04:00
Brant DeBow
4b49b04409
[PM-17562] Revert event route optimization (#5766) 2025-05-05 08:05:38 -04:00
Brant DeBow
75a2da3c4b
[PM-17562] Add support for extended properties on event integrations (#5755)
* [PM-17562] Add support for extended properties on event integrations

* Clean up IntegrationEventHandlerBase

* Respond to PR feedback
2025-05-05 08:04:59 -04:00
Conner Turnbull
077d0fa6d7
Resolved an issue where autoscaling always happened (#5765) 2025-05-02 12:53:06 -04:00
Conner Turnbull
cd3f16948b
Resolved the ambiguous build error (#5762) 2025-05-02 12:25:52 +00:00
Alex Morask
2d4ec530c5
[PM-18955] Implement OrganizationWarningsQuery (#5713)
* Add GetWarnings endpoint to OrganizationBillingController

* Add OrganizationWarningsQueryTests
2025-05-01 17:13:10 -04:00
Jonas Hendrickx
011298c9ff
PM-16517: Create personal use plan for additional storage (#5205)
* PM-16517: Create personal use plan for additional storage

* f

* f

* f

* fix

* f

---------

Co-authored-by: Jonas Hendrickx <jhendrickx@bitwarden.com>
Co-authored-by: Conner Turnbull <133619638+cturnbull-bitwarden@users.noreply.github.com>
2025-05-01 17:53:03 +00:00
Alex Morask
e77acbc5ad
[PM-19956] [PM-18795] Require provider payment method during setup behind FF (#5752)
* Require provider payment method during setup behind FF

* Fix failing test

* Run dotnet format

* Rui's feedback
2025-05-01 12:12:45 -04:00
cyprain-okeke
dc5db5673f
[PM-17775] (#5699)
* Changes to allow admin to send F4E sponsorship

* Fix the failing unit tests

* Fix the failing test

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

* Merge Changes with pm-17777

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

* Add changes for autoscale

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

* Return the right error response

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

* Resolve the failing unit test

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

---------

Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
2025-05-01 16:35:51 +01:00
Brandon Treston
8ecd9c5fb3
[PM-19332] Create InitPendingOrganizationCommand (#5584)
* wip

* implement CommandResult

* remove auth handler

* fix import

* remove method from OrganizationService

* cleanup, add tests

* clean up

* fix auth in tests

* clean up comments

* clean up comments

* clean up test
2025-05-01 10:07:19 -04:00
Conner Turnbull
cf7a59c077
[Innovation Sprint] Phishing Detection (#5516)
* Initial stubbing out of the phishing service

* Add the phishing domain controller

* Add changes for the phishing domain get

* Add distributed cache to the phishing domain

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

* Rename the variable name

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

* Removed IPhishingDomainService

* Feature/phishing detection cronjob (#5512)

* Added caching to EF implementation. Added error handling and logging

* Refactored update method to use sqlbulkcopy instead of performing a round trip for each new insert

* Initial implementation for quartz job to get list of phishing domains

* Updated phishing domain settings to be its own interface

* Add phishing domain detection with checksum-based updates

* Updated auth for phishing domain endpoints to either require api, or licensing claims to support both web and browser clients, and selfhost api clients

* [Innovation Sprint] Updated Phishing domains to rely on blob storage (#5517)

* Updated phishing detection data layer to rely on azure blob storage instead of sql server

* dotnet format

* Took rider refactors

* Ensuring phishing.testcategory.com exists to test against

* Added redis to dev's docker-compose

* Removed redis from cloud profile

* Remove the Authorize attribute

* error whitespace fix whitespace formatting

* error WHITESPACE: Fix whitespace formatting

* Wrapped phishing detection feature behind feature flag (#5532)

* Increased timeout for fetching source list a bunch

* Removed PhishingDomains policy

---------

Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
Co-authored-by: Cy Okeke <cokeke@bitwarden.com>
2025-04-30 11:03:59 -04:00
renovate[bot]
b177a13e2f
[deps] DbOps: Update Microsoft.Azure.Cosmos to 3.49.0 (#5734)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-28 20:06:44 -04:00
Alex Morask
db0079cebb
[PM-19009] Remove feature flag: pm-15179-add-existing-orgs-from-provider-portal (#5664)
* Remove feature flag

* Run dotnet format
2025-04-28 16:22:20 -04:00
cyprain-okeke
07a2c0e9d2
[PM-18569]Add admin sponsored families to organization license (#5569)
* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* Add `Notes` column to `OrganizationSponsorships` table

* Add feature flag to `CreateAdminInitiatedSponsorshipHandler`

* Unit tests for `CreateSponsorshipHandler`

* More tests for `CreateSponsorshipHandler`

* Forgot to add `Notes` column to `OrganizationSponsorships` table in the migration script

* `CreateAdminInitiatedSponsorshipHandler` unit tests

* Fix `CreateSponsorshipCommandTests`

* Encrypt the notes field

* Wrong business logic checking for invalid permissions.

* Wrong business logic checking for invalid permissions.

* Remove design patterns

* duplicate definition in Constants.cs

* initial commit

* Merge Change with pm-17830 and use the property

* Add the new property to download licence

* Add the new property

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

* Remove the unsed failing test

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

* Remove unused method

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

---------

Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
Co-authored-by: Jonas Hendrickx <jhendrickx@bitwarden.com>
2025-04-28 19:21:52 +01:00
Jared McCannon
12fc9dffd4
[PM-20586] - Fixing allowing seats to increase to limit. (#5705) 2025-04-28 09:55:55 -05:00
Daniel James Smith
60f6189314
Move feature flags owned by Data Insights and Reporting team into their own section (#5691)
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2025-04-28 10:41:49 -04:00
Brant DeBow
ad19d3d3ad
[PM-17562] Add feature flag for event-based organization integrations (#5710)
* Added EventBasedOrganizationIntegrations feature flag; Added enforcement of flag at the API layer

* [PM-17562] Use EventBasedOrganizationIntegrations feature flag to turn on/off event queue

* Optimization that removes the need for EventRouteService (from @justindbaur)
2025-04-28 08:20:47 -04:00
SmithThe4th
9a7fddd77c
Removed feature flag (#5707) 2025-04-25 10:15:26 -07:00
renovate[bot]
0434191bca
[deps] Tools: Update aws-sdk-net monorepo (#5704)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-25 05:47:21 +02:00
Conner Turnbull
8a2012bb83
[PM-17777] sponsorships consume seats (#5694)
* Admin initiated sponsorships now use seats similarly to inviting an organization user

* Updated f4e endpoint to not expect a user ID, and instead just send a boolean

* Fixed failing tests

* Updated OrganizationUserReadOccupiedSeatCountByOrganizationIdQuery to ensure both left and right sides are selecting the same columns
2025-04-24 10:53:34 -04:00
Brant DeBow
90d831d9ef
[PM-17562] API For Organization Integrations/Configurations, Refactored Distributed Events, Slack Integration (#5654)
* [PM-17562] Slack Event Investigation

* Refactored Slack and Webhook integrations to pull configurations dynamically from a new Repository

* Added new TemplateProcessor and added/updated unit tests

* SlackService improvements, testing, integration configurations

* Refactor SlackService to use a dedicated model to parse responses

* Refactored SlackOAuthController to use SlackService as an injected dependency; added tests for SlackService

* Remove unnecessary methods from the IOrganizationIntegrationConfigurationRepository

* Moved Slack OAuth to take into account the Organization it's being stored for. Added methods to store the top level integration for Slack

* Organization integrations and configuration database schemas

* Format EF files

* Initial buildout of basic repositories

* [PM-17562] Add Dapper Repositories For Organization Integrations and Configurations

* Update Slack and Webhook handlers to use new Repositories

* Update SlackOAuth tests to new signatures

* Added EF Repositories

* Update handlers to use latest repositories

* [PM-17562] Add Dapper and EF Repositories For Ogranization Integrations and Configurations

* Updated with changes from PR comments

* Adjusted Handlers to new repository method names; updated tests to naming convention

* Adjust URL structure; add delete for Slack, add tests

* Added Webhook Integration Controller

* Add tests for WebhookIntegrationController

* Added Create/Delete for  OrganizationIntegrationConfigurations

* Prepend ConnectionTypes into IntegrationType so we don't run into issues later

* Added Update to OrganizationIntegrationConfigurtionController

* Moved Webhook-specific integration code to being a generic controller for everything but Slack

* Removed delete from SlackController - Deletes should happen through the normal Integration controller

* Fixed SlackController, reworked OIC Controller to use ids from URL and update the returned object

* Added parse/type checking for integration and integration configuration JSONs, Cleaned up GlobalSettings to remove old values

* Cleanup and fixes for Azure Service Bus support

* Clean up naming on TemplateProcessorTests

* Address SonarQube warnings/suggestions

* Expanded test coverage; Cleaned up tests

* Respond to PR Feedback

* Rename TemplateProcessor to IntegrationTemplateProcessor

---------

Co-authored-by: Matt Bishop <mbishop@bitwarden.com>
2025-04-23 10:44:43 -04:00
Rui Tomé
722fae81b3
[PM-18237] Add RequireSsoPolicyRequirement (#5655)
* Add RequireSsoPolicyRequirement and its factory to enforce SSO policies

* Enhance WebAuthnController to support RequireSsoPolicyRequirement with feature flag integration. Update tests to validate behavior when SSO policies are applicable.

* Integrate IPolicyRequirementQuery into request validators to support RequireSsoPolicyRequirement. Update validation logic to check SSO policies based on feature flag.

* Refactor RequireSsoPolicyRequirementFactoryTests to improve test coverage for SSO policies. Add tests for handling both valid and invalid policies in CanUsePasskeyLogin and SsoRequired methods.

* Remove ExemptStatuses property from RequireSsoPolicyRequirementFactory to use default values from BasePolicyRequirementFactory

* Restore ValidateRequireSsoPolicyDisabledOrNotApplicable

* Refactor RequireSsoPolicyRequirement to update CanUsePasskeyLogin and SsoRequired properties to use init-only setters

* Refactor RequireSsoPolicyRequirementFactoryTests to enhance test clarity

* Refactor BaseRequestValidatorTests to improve test clarity

* Refactor WebAuthnController to replace SSO policy validation with PolicyRequirement check

* Refactor BaseRequestValidator to replace SSO policy validation with PolicyRequirement check

* Refactor WebAuthnControllerTests to update test method names and adjust policy requirement checks

* Add tests for AttestationOptions and Post methods in WebAuthnControllerTests to validate scenario where SSO is not required

* Refactor RequireSsoPolicyRequirement initialization

* Refactor SSO requirement check for improved readability

* Rename test methods in RequireSsoPolicyRequirementFactoryTests for clarity on exempt status conditions

* Update RequireSsoPolicyRequirement to refine user status checks for SSO policy requirements
2025-04-23 15:43:36 +01:00
Todd Martin
465ec08f3a
fix(sso): Revert [deps] Auth: Update Duende.IdentityServer to 7.1.0
This reverts commit 4c5bf495f31f42036d492b088535b28590037aa1.
2025-04-22 10:02:47 -04:00
Daniel James Smith
cbb1168da8
Remove export-attachments feature flag (#5659)
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2025-04-22 08:14:56 -04:00
Todd Martin
b38c75267f
[PM-19691] Remove duo-redirect feature flag (#5576)
* Completed grouping of feature flags by team.

* Completed grouping feature flags by team.

* Remove email delay feature flag

* Removed feature flag

* Fixed reference.

* Remove flag after merge.
2025-04-21 12:36:38 -04:00
Bernd Schoolmann
c195f83402
[PM-19728] Add keys on devices list and get responses (#5633)
* Add keys on devices list and get responses

* Mark retrieve device keys endpoint as deprecated
2025-04-21 13:49:17 +02:00
Jared McCannon
159e4fe502
Corrected the number sent to stripe. Corrected the test. (#5667) 2025-04-18 14:38:15 -05:00
Robyn MacCallum
9218ac0d7c
Add android-chrome-autofill flag (#5668) 2025-04-18 12:47:54 -04:00
Jared McCannon
89fc27b014
[PM-20230] - Send owners email when autoscaling (#5658)
* Added email when autoscaling. Added tests as well.

* Wrote tests. Renamed methods.
2025-04-18 08:13:55 -05:00
Jonas Hendrickx
bd90c34af2
[PM-19180] Calculate sales tax correctly for sponsored plans (#5611)
* [PM-19180] Calculate sales tax correctly for sponsored plans

* Cannot divide by zero if total amount excluding tax is zero.

* Unit tests for families & families for enterprise

---------

Co-authored-by: Conner Turnbull <133619638+cturnbull-bitwarden@users.noreply.github.com>
2025-04-17 11:33:16 -04:00
Daniel James Smith
f7e5759e7b
Remove GeneratorToolsModernization feature flag (#5660)
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2025-04-17 08:59:00 -04:00
Shane Melton
49bae6c241
[PM-10611] Add EndUserNotifications feature flag (#5663) 2025-04-16 15:38:09 -07:00
Ike
1399b1417e
PM-6675 - Remove old registration endpoint (#5585)
* feat : remove old registration endpoint

* fix: update integration test user registration to match current registration; We need to keep the IRegistrationCommand.RegisterUser method to JIT user.

* fix: updating accounts/profile tests to match current implementations
2025-04-16 15:46:49 -04:00
Alex Morask
01a08c5814
[PM-19566] Update MSPs to "charge_automatically" with Admin-based opt-out (#5650)
* Update provider to charge automatically with Admin Portal-based opt-out

* Design feedback

* Run dotnet format
2025-04-16 13:36:04 -04:00
Jordan Aasen
3d59f5522d
[PM-19357] - [Defect] Unauthorised access allows limited access user to change custom hidden field of Items (#5572)
* prevent hidden password users from modifying hidden fields

* add tests

* fix serialization issues

* DRY up code

* return newly created cipher

* add sshKey data type

* fix tests
2025-04-16 10:33:00 -07:00
cyprain-okeke
4f698e9dea
Resolve the member page not loading issue (#5649) 2025-04-16 17:28:38 +01:00
Jonas Hendrickx
c182b37347
[PM-17830] Backend changes for admin initiated sponsorships (#5531)
* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* Add `Notes` column to `OrganizationSponsorships` table

* Add feature flag to `CreateAdminInitiatedSponsorshipHandler`

* Unit tests for `CreateSponsorshipHandler`

* More tests for `CreateSponsorshipHandler`

* Forgot to add `Notes` column to `OrganizationSponsorships` table in the migration script

* `CreateAdminInitiatedSponsorshipHandler` unit tests

* Fix `CreateSponsorshipCommandTests`

* Encrypt the notes field

* Wrong business logic checking for invalid permissions.

* Wrong business logic checking for invalid permissions.

* Remove design patterns

* duplicate definition in Constants.cs

* Allow rollback

* Fix stored procedures & type

* Fix stored procedures & type

* Properly encapsulating this PR behind its feature flag

* Removed comments

* Updated ValidateSponsorshipCommand to validate admin initiated requirements

---------

Co-authored-by: Conner Turnbull <133619638+cturnbull-bitwarden@users.noreply.github.com>
Co-authored-by: Conner Turnbull <cturnbull@bitwarden.com>
2025-04-16 11:27:58 -04:00
Brandon Treston
f678e3db79
[PM-19887] authorization for init pending organization (#5643)
* add token authorization for initPendingOrganizations

* clean up
2025-04-15 15:39:21 -04:00
Matt Gibson
1ac4a08672
Define use sd for decryption feature flag (#5653) 2025-04-15 15:03:06 -04:00
Justin Baur
2242a70e50
[PM-336] Nullable Platform & Unowned Services (#5646)
* Nullable Platform & Unowned Services

* Fix build errors

* Format
2025-04-15 12:56:58 -04:00
Thomas Rittson
84a984a9e6
[PM-19585] Use Authorize attributes for simple role authorization (#5555)
- Add Authorize<T> attribute
- Add IOrganizationRequirement and example implementation
- Add OrganizationRequirementHandler
- Add extension methods (replacing ICurrentContext)
- Move custom permissions claim definitions

---
Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
Co-authored-by:  Audrey  <ajensen@bitwarden.com>
2025-04-15 14:36:00 +10:00
Thomas Avery
c9a42d861c
[PM-17987] Add feature flag (#5554) 2025-04-14 12:48:52 -05:00
Justin Baur
4d6e4d35f2
[PM-18555] Notifications service tests (#5473)
* Add RelayPush Notifications Tests

* Nullable Test Fixup

* Azure Queue Notifications Tests

* NotificationsHub Push Tests

* Make common base for API based notifications

* Register TimeProvider just in case

* Format

* React to TaskId

* Remove completed TODO
2025-04-14 13:04:56 -04:00
Alex Morask
dff00e613d
Add invoice null check (#5642) 2025-04-11 09:34:51 -04:00
bnagawiecki
d553d52c93
revert back to plural key value (#5638) 2025-04-10 16:24:16 -04:00
SmithThe4th
0b50a1819e
Added feature flag (#5632) 2025-04-10 14:55:40 -04:00
Shane Melton
a1016b4df9
Fix feature flag key value (#5636) 2025-04-10 18:28:53 +00:00
Alex Morask
54e7fac4d9
[PM-18770] Convert Organization to Business Unit (#5610)
* [NO LOGIC] Rename MultiOrganizationEnterprise to BusinessUnit

* [Core] Add IMailService.SendBusinessUnitConversionInviteAsync

* [Core] Add BusinessUnitConverter

* [Admin] Add new permission

* [Admin] Add BusinessUnitConverterController

* [Admin] Add Convert to Business Unit button to Organization edit page

* [Api] Add OrganizationBillingController.SetupBusinessUnitAsync action

* [Multi] Propagate provider type to sync response

* [Multi] Put updates behind feature flag

* [Tests] BusinessUnitConverterTests

* Run dotnet format

* Fixing post-main merge compilation failure
2025-04-10 10:06:16 -04:00
Robyn MacCallum
d85807e94f
Add mobile feature flags (#5629)
* Add mobile feature flags

* Update Constants.cs
2025-04-09 12:17:04 -04:00
Rui Tomé
f1a4829e5e
[PM-12485] Create OrganizationUpdateKeys command (#5600)
* Add OrganizationUpdateKeysCommand

* Add unit tests for OrganizationUpdateKeysCommand to validate permission checks and key updates

* Register OrganizationUpdateKeysCommand for dependency injection

* Refactor OrganizationsController to use IOrganizationUpdateKeysCommand for updating organization keys

* Remove outdated unit tests for UpdateOrganizationKeysAsync in OrganizationServiceTests

* Remove UpdateOrganizationKeysAsync method from IOrganizationService and OrganizationService implementations

* Add IOrganizationUpdateKeysCommand dependency mock to OrganizationsControllerTests
2025-04-09 15:23:29 +01:00