1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-13 17:18:14 -05:00

93 Commits

Author SHA1 Message Date
jrmccannon
4e205b9d78
Corrected logic and added more tests. 2025-04-03 07:52:12 -05:00
jrmccannon
e80bbe1caa
Corrected model name. Corrected SM seat calculation. Added test for it. 2025-04-02 20:44:17 -05:00
jrmccannon
2656ccf314
Created new errors and removed references in business code to ErrorMessages property. This aligns Invite User code to use Errors instead of ErrorMessages 2025-04-01 10:12:14 -05:00
jrmccannon
8e2ac9a5bb
Added test to validate the provider email is sent if org is managed by a provider. 2025-03-31 15:21:29 -05:00
jrmccannon
10901bfeea
Added test around validating the revert. 2025-03-31 15:10:50 -05:00
jrmccannon
58c3864601
Rearranged some things. Fixed the tests. 2025-03-31 10:10:54 -05:00
jrmccannon
5f0d55b472
Merge branch 'main' into jmccannon/ac/pm-16811-scim-invite-optimization
# Conflicts:
#	src/Core/OrganizationFeatures/OrganizationServiceCollectionExtensions.cs
#	test/Core.Test/AdminConsole/Services/OrganizationServiceTests.cs
2025-03-31 08:37:04 -05:00
Jared McCannon
786b0edceb
[PM-18527] - Fix allowing restored user to own multiple free orgs (#5444)
* Moved RestoreUserAsync and RestoreUsersAsync to Command.

* Fixing the bug.

* Added test for bulk method.

* Fixing sonar cube warning.

* SonarQube warning fix.

* Excluding org users we already have.

* Fixed misspelling. Added integration test for method.

* test had the misspelling as well 🤦

* Split out interface. Added admin and confirmed constraints.

* fixed queries and added xml comments and tests.
2025-03-31 08:33:57 -05:00
jrmccannon
65996ae0a9
Renames for organization. 2025-03-28 12:26:06 -05:00
jrmccannon
b933007f09
Removed unused classes 2025-03-28 09:09:44 -05:00
jrmccannon
46d36b1ef8
Code Review changes. 2025-03-27 15:38:32 -05:00
jrmccannon
1384d9c58e
fix tests 2025-03-26 16:23:43 -05:00
jrmccannon
ad3131f66e
Cleaned up DTO models. Moved some validation steps around. A few quick fixes to address CR concerns. Still need to move a few things yet. 2025-03-26 10:56:33 -05:00
jrmccannon
f3f2f41cfb
Merge branch 'refs/heads/main' into jmccannon/ac/pm-16811-scim-invite-optimization
# Conflicts:
#	test/Core.Test/AdminConsole/Services/OrganizationServiceTests.cs
2025-03-26 10:41:50 -05:00
Rui Tomé
f04a3d638b
[PM-18235] Add PersonalOwnershipPolicyRequirement (#5439)
* Add PersonalOwnershipPolicyRequirement for managing personal ownership policy

* Add tests for PersonalOwnershipPolicyRequirement

* Register PersonalOwnershipPolicyRequirement in policy requirement factory

* Update ImportCiphersCommand to check PersonalOwnershipPolicyRequirement if the PolicyRequirements flag is enabled

Update unit tests

* Update CipherService to support PersonalOwnershipPolicyRequirement with feature flag

- Add support for checking personal ownership policy using PolicyRequirementQuery when feature flag is enabled
- Update CipherService constructor to inject new dependencies
- Add tests for personal vault restrictions with and without feature flag

* Clean up redundant "Arrange", "Act", and "Assert" comments in test methods

* Refactor PersonalOwnershipPolicyRequirementTests method names for clarity

- Improve test method names to better describe their purpose and behavior
- Rename methods to follow a more descriptive naming convention
- No functional changes to the test logic

* Remove commented code explaining policy check

* Refactor PersonalOwnership Policy Requirement implementation

- Add PersonalOwnershipPolicyRequirementFactory to replace static Create method
- Simplify policy requirement creation logic
- Update PolicyServiceCollectionExtensions to register new factory
- Update ImportCiphersCommand to use correct user ID parameter
- Remove redundant PersonalOwnershipPolicyRequirementTests

* Remove redundant PersonalOwnershipPolicyRequirementTests

* Remove unnecessary tests from PersonalOwnershipPolicyRequirementFactoryTests
2025-03-26 09:40:13 +00:00
jrmccannon
6c6ecfefdf
Fixing name. 2025-03-24 15:32:30 -05:00
jrmccannon
038c00d21f
PasswordManagerInviteUserValidation to PasswordManagerInviteUserValidator 2025-03-24 12:39:03 -05:00
jrmccannon
f0770eda93
Rename for InvitingUserOrganizationValidation to InvitingUserOrganizationValidator 2025-03-24 12:35:16 -05:00
jrmccannon
982611bd1b
Renamed InviteUsersValidation to InviteUsersValidator 2025-03-24 12:34:36 -05:00
Rui Tomé
24b63f2dcd
[PM-12493] Extract ConfirmUser methods from OrganizationService into commands (#5505)
* Add ConfirmOrganizationUserCommand and IConfirmOrganizationUserCommand interface for managing organization user confirmations

* Add unit tests for ConfirmOrganizationUserCommand to validate user confirmation scenarios

* Register ConfirmOrganizationUserCommand for dependency injection

* Refactor OrganizationUsersController to utilize IConfirmOrganizationUserCommand for user confirmation processes

* Remove ConfirmUserAsync and ConfirmUsersAsync methods from IOrganizationService and OrganizationService

* Rename test methods in ConfirmOrganizationUserCommandTests for clarity and consistency

* Update test method name in ConfirmOrganizationUserCommandTests for improved clarity
2025-03-24 17:05:46 +00:00
jrmccannon
7be2e2bd07
Removed test only constructor from InviteOrganization 2025-03-24 08:45:19 -05:00
jrmccannon
3f81e15169
fixed test 2025-03-21 15:54:03 -05:00
jrmccannon
87c181b662
Refactor validation parameter to improve clarity and consistency. Added XML doc 2025-03-21 15:18:05 -05:00
jrmccannon
d867b47705
Merge branch 'refs/heads/main' into jmccannon/ac/pm-16811-scim-invite-optimization
# Conflicts:
#	src/Core/AdminConsole/Services/Implementations/OrganizationService.cs
2025-03-21 13:50:22 -05:00
Brandon Treston
c7c6528faa
Ac/pm 18240 implement policy requirement for reset password policy (#5521)
* wip

* fix test

* fix test

* refactor

* fix factory method and tests

* cleanup

* refactor

* update copy

* cleanup
2025-03-21 10:07:55 -04:00
jrmccannon
829e49c398
Fixed tests. 2025-03-20 09:11:09 -05:00
jrmccannon
59b579f071
Refactored to use new ValidationResult pattern. added mapping method. 2025-03-17 13:27:37 -05:00
jrmccannon
813333e9bb
Merge branch 'main' into jmccannon/ac/pm-16811-scim-invite-optimization
# Conflicts:
#	src/Core/Models/Commands/CommandResult.cs
2025-03-17 08:59:17 -05:00
Thomas Rittson
224ef1272e
[PM-18876] Refine PolicyRequirements API (#5445)
* make the PolicyRequirements API more granular, e.g.
  replace factory methods with a factory interface
* update Send to use the new API
2025-03-11 10:46:09 +10:00
jrmccannon
d8264a9085
Fixed some changes. 2025-03-07 14:43:12 -06:00
jrmccannon
e4aa740a28
Fixed some compilation errors. 2025-03-07 12:46:59 -06:00
jrmccannon
4317276f5d
Dto rename. Moved from static methods to ctors 2025-03-07 10:03:47 -06:00
jrmccannon
56c7cc8bf4
Rename of OrgDto 2025-03-05 16:21:40 -06:00
jrmccannon
f8c08de2db
Merge branch 'main' into jmccannon/ac/pm-16811-scim-invite-optimization
# Conflicts:
#	src/Core/AdminConsole/Services/Implementations/OrganizationService.cs
#	test/Infrastructure.IntegrationTest/AdminConsole/Repositories/OrganizationUserRepositoryTests.cs
2025-03-05 15:24:13 -06:00
jrmccannon
c7cc9527f4
Moved FromOrganization mapper method to a constructor 2025-03-05 15:04:50 -06:00
jrmccannon
611ad8c343
Moved to private method. Made ScimInvite inherit the single invite base model. Moved create methods to constructors. A few more CR changes included. 2025-03-05 14:55:41 -06:00
jrmccannon
4ff27fd668
created response model and split interface out. 2025-03-05 07:42:09 -06:00
Alex Morask
a2e665cb96
[PM-16684] Integrate Pricing Service behind FF (#5276)
* Remove gRPC and convert PricingClient to HttpClient wrapper

* Add PlanType.GetProductTier extension

Many instances of StaticStore use are just to get the ProductTierType of a PlanType, but this can be derived from the PlanType itself without having to fetch the entire plan.

* Remove invocations of the StaticStore in non-Test code

* Deprecate StaticStore entry points

* Run dotnet format

* Matt's feedback

* Run dotnet format

* Rui's feedback

* Run dotnet format

* Replacements since approval

* Run dotnet format
2025-02-27 07:55:46 -05:00
Rui Tomé
d15c1faa74
[PM-12491] Create Organization disable command (#5348)
* Add command interface and implementation for disabling organizations

* Register organization disable command for dependency injection

* Add unit tests for OrganizationDisableCommand

* Refactor subscription handlers to use IOrganizationDisableCommand for disabling organizations

* Remove DisableAsync method from IOrganizationService and its implementation in OrganizationService

* Remove IOrganizationService dependency from SubscriptionDeletedHandler

* Remove commented TODO for sending email to owners in OrganizationDisableCommand
2025-02-25 14:57:30 +00:00
jrmccannon
001a5dea86
Added integration test around enabling feature and sending invite via scim. Did a bit of refactoring on the SM validation. Fixed couple bugs found. 2025-02-24 11:10:48 -06:00
Thomas Rittson
b0c6fc9146
[PM-18234] Add SendPolicyRequirement (#5409) 2025-02-24 09:19:52 +10:00
jrmccannon
bd5189491e
Added more tests for the updates 2025-02-21 16:08:07 -06:00
jrmccannon
1dbe37a250
Added test to verify valid request with a user calls db method and sends the invite 2025-02-21 15:09:17 -06:00
jrmccannon
e10b7cc78f
First test of new command. 2025-02-21 12:04:11 -06:00
jrmccannon
6ec850e384
Created SendOrganizationInvitesCommand and moved some tests from OrgServiceTests. Fixed some tests in org service in relation to moving out SendOrgInviteCommand code.
Added side effects to InviteOrganizationUsersCommand
2025-02-21 09:15:41 -06:00
jrmccannon
649e8b5c0a
Merge branch 'main' into jmccannon/ac/pm-16811-scim-invite-optimization
# Conflicts:
#	src/Core/Constants.cs
2025-02-17 16:35:02 -06:00
jrmccannon
926e786f82
Added bulk procedure for saving users, collections and groups from inviting. Added test to validate Ef and Sproc 2025-02-17 16:32:23 -06:00
Rui Tomé
f4c37df883
[PM-12490] Extract OrganizationService.EnableAsync into commands (#5321)
* Add organization enable command implementation

* Add unit tests for OrganizationEnableCommand

* Add organization enable command registration for dependency injection

* Refactor payment and subscription handlers to use IOrganizationEnableCommand for organization enabling

* Remove EnableAsync methods from IOrganizationService and OrganizationService

* Add xmldoc to IOrganizationEnableCommand

* Refactor OrganizationEnableCommand to consolidate enable logic and add optional expiration
2025-02-14 11:25:29 +00:00
Thomas Rittson
f4341b2f3b
[PM-14439] Add PolicyRequirementQuery for enforcement logic (#5336)
* Add PolicyRequirementQuery, helpers and models in preparation for migrating domain code

Co-authored-by: Rui Tomé <108268980+r-tome@users.noreply.github.com>
2025-02-14 11:05:49 +00:00
jrmccannon
fcaa449f83
Added Secrets Manager Validations and Tests. 2025-02-13 16:23:00 -06:00