1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-22 12:15:36 +01:00
Commit Graph

5202 Commits

Author SHA1 Message Date
Maciej Zieniuk
8b3f1318a2
PM-10600: Unit test coverage for NotificationsApiPushNotificationService constructor 2024-11-08 15:30:42 +00:00
Maciej Zieniuk
676f10b832
PM-10600: HttpClientFactory fixture returns the same HttpClient instance.
The IHttpClientFactory.CreateClient(string name) needs to return different HttpClient instances in case there are multiple clients to be created. This have been issue for BaseIdentityClientService where the HttpClient is modified with BaseAddress, causing issues.
2024-11-08 15:29:51 +00:00
Maciej Zieniuk
b19f85e4db
PM-10600: Rename of GlobalSettings fixture.
The GlobalSettings fixture customization had the same name as the GlobalSettings itself, causing a bunch of compilation issues.
2024-11-08 15:27:56 +00:00
Maciej Zieniuk
d98823462a
PM-10600: Immutable GlobalSettings between test cases, fixture improvements.
The GlobalSettingsFactory no longer provides the same instance of GlobalSettings. If modified, other tests would fail too.
The factory now have a method to create new GlobalSettings objects, which can be modified as it's needed for the test.
This is then used in GlobalSettingsBuilder, which can be used to customize GlobalSettings.
2024-11-08 15:26:15 +00:00
Maciej Zieniuk
be7929c81d
PM-10600: Unit tests for NotificationsApiPushNotificationService
Also added HttpClientCustomize fixture, that provides IHttpClientFactory, HttpClient and MockedHttpMessageHandler. The latter can be used to mock requests and provide expected responses.
Expanded HttpRequestMatcher to be able to respond with content.
2024-11-08 10:35:19 +00:00
Maciej Zieniuk
91567ed686
Merge branch 'refs/heads/km/pm-10600' into km/pm-10600-part2 2024-11-06 14:34:32 +00:00
Maciej Zieniuk
31316ee62f
PM-10600: Unit Test coverage for NotificationHubPushRegistrationService
Fixed IFeatureService substitute mocking for Android tests.
Added user part of organization test with organizationId tags expectation.
2024-11-05 20:52:41 +00:00
Maciej Zieniuk
67aa2eb6d9
Merge branch 'refs/heads/main' into km/pm-10600 2024-11-05 15:00:58 +00:00
Maciej Zieniuk
d142af07bf
PM-10600: Fix Mobile devices not registering to organization push notifications
We only register devices for organization push notifications when the organization is being created. This does not work, since we have a use case (Notification Center) of delivering notifications to all users of organization. This fixes it, by adding the organization id tag when device registers for push notifications.
2024-11-05 14:59:27 +00:00
Maciej Zieniuk
cbc1e0ffe4
PM-10600: Fix FeatureService service discoverability error
The `IFeatureService` is scoped service, yet it is provided as non-scoped via service provider. This results in exception on runtime. No Android device can register for push notifications as a result.
2024-11-05 14:52:27 +00:00
Alex Morask
e6c24c3f3b
[PM-11345] Add SCIM to Teams Plan (#4924)
* Add SCIM to Teams

* Robert's feedback

* Feedback
2024-11-05 08:54:49 -05:00
Vijay Oommen
cb7eecc96d
PM-13236 PasswordHealthReportApplication DB Tables (#4958)
* PM-13236 PasswordHealthReportApplications db

* PM-13236 incorporated pr comments

* PM-13236 fixed error in SQL script

* PM-13236 resolve quality scan errors SQL71006, SQL7101, SQL70001

* PM-13236 fixed warnings on procedures

* PM-13236 added efMigrations

* PM-13236 renamed files to PasswordHealthReportApplication (singular)

* PM-13236 changed file name to more appropriate naming

* PM-13236 changed the file name singular

* PM-13236 removed the entity file

* PM-13236 Moved PasswordHealthReportApplication entity to src/core/tools/entities
2024-11-04 14:23:39 -05:00
Rui Tomé
4b76008245
[PM-11406] Account Management: Prevent a verified user from deleting their account (#4878)
* Add check for managed user before purging account

* Rename IOrganizationRepository.GetByClaimedUserDomainAsync to GetByVerifiedUserEmailDomainAsync and refactor to return a list. Remove ManagedByOrganizationId from ProfileResponseMode. Add ManagesActiveUser to ProfileOrganizationResponseModel

* Rename the property ManagesActiveUser to UserIsManagedByOrganization

* Remove whole class #nullable enable and add it to specific places

* [PM-11405] Account Deprovisioning: Prevent a verified user from changing their email address

* Remove unnecessary .ToList()

* Refactor IUserService methods GetOrganizationsManagingUserAsync and IsManagedByAnyOrganizationAsync to not return nullable objects. Update ProfileOrganizationResponseModel.UserIsManagedByOrganization to not be nullable

* Prevent deletion of accounts managed by an organization when Account Deprovisioning is enabled

* Add CannotDeleteManagedAccountViewModel and email templates

- Added CannotDeleteManagedAccountViewModel class to handle emails related to preventing deletion of accounts managed by an organization.
- Added HTML and text email templates for sending notifications about the inability to delete an account owned by an organization.
- Updated IMailService interface with a new method to send the cannot delete managed account email.
- Implemented the SendCannotDeleteManagedAccountEmailAsync method in HandlebarsMailService.
- Added a check in UserService to send the cannot delete managed account email if the user is managed by any organization.
- Added a no-op implementation for SendCannotDeleteManagedAccountEmailAsync in NoopMailService.

* Update error message when unable to purge vault for managed account

* Update error message when unable to change email for managed account

* Update error message when unable to delete account when managed by organization

* Update error message in test for deleting organization-owned accounts
2024-11-04 16:37:21 +00:00
Vince Grassia
a2654ce2ee
Bump project version (#4971) 2024-11-04 10:47:38 -05:00
Jonas Hendrickx
d53d9c0600
[PM-14443] Cannot view pending MOE provider page (#4970) 2024-11-04 16:43:48 +01:00
Rui Tomé
60672bbe48
[PM-10323] Remove user verification from organization user deletion methods (#4965) 2024-11-04 14:48:13 +00:00
cyprain-okeke
96862b974f
[PM-14365][Defect] Member of trialing org cannot log in app (#4968)
* decreased authorization level

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

* Add some level of authorization

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

* resolve the failing test

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

* Resolve the failing test

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

---------

Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
2024-11-04 15:15:27 +01:00
cyprain-okeke
df4f8df485
Remove the time threshold feature flag (#4860)
Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
2024-11-04 12:38:58 +01:00
Jonas Hendrickx
35b0f61986
[PM-13450] Admin: Display Multi-organization Enterprise attributes on provider details (#4955) 2024-11-04 06:45:25 +01:00
cyprain-okeke
fc719efee9
[PM-14365][Defect] Member of trialing org cannot log in app (#4967)
* changes to include subscription status metadata

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

* Fix the failing test

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

* Resolve the failing test

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

---------

Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
2024-11-01 17:55:59 +01:00
Alex Morask
f149f247d5
Don't try to credit customer \$0 (#4964) 2024-11-01 12:55:07 -04:00
renovate[bot]
edd31bcf4e
[deps] Auth: Update Duende.IdentityServer to 7.0.8 [SECURITY] (#4953)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-31 14:40:46 -07:00
Matt Bishop
a04df4beba
Device deactivation (#4963)
* Device deactivation

* Check active status in service

* Format and work around potential deadlocks
2024-10-31 17:05:13 -04:00
tangowithfoxtrot
751fd33aef
fix: ensure vault URI is propagated from config.yml (#4925)
* fix: ensure vault URI matches Url from config.yml

* fmt: use camelCase for vaultUri

Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>

---------

Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
2024-10-31 09:13:57 -07:00
Vince Grassia
997bf03d97
Update version to 2024.10.2 (#4962) 2024-10-31 11:40:54 -04:00
Alex Morask
249c39e71e
[PM-14275] Add IsManaged to OrganizationMetadata (#4957)
* Add IsManaged to OrganizationMetadata

* Remove subscription requirement from self-host eligibility check

* Remove unused service

* Run dotnet format
2024-10-31 11:01:37 -04:00
renovate[bot]
2893ca729f
[deps] Billing: Update swashbuckle-aspnetcore monorepo to 6.9.0 (#4948)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-31 11:02:23 +01:00
renovate[bot]
2abd37d2d7
[deps] DevOps: Update gh minor (#4945)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-30 11:23:50 -04:00
Brandon Treston
359c2787ad
[PM-11408] domain verification stat in portal and add cs delete permission (#4943)
* Add delete permission to cs role

* Add domain verification stat to portal

* add feature flag and unit tests

* fix test

* Refactor from PR feedback

* update comment
2024-10-30 10:45:53 -04:00
renovate[bot]
6cc097ec49
[deps] Platform: Update dotnet monorepo (#4886)
* [deps] Platform: Update dotnet monorepo

* Update patch version on missed monorepo packages

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Addison Beck <github@addisonbeck.com>
2024-10-28 13:35:14 -04:00
Brandon Treston
7f4bde1b6c
[PM-13730] Return Policy object instead of NotFoundException (#4911)
* Return Policy object instead of NotFoundException

* Add unit tests, change orgId type to Guid

* Fix test cases, throw exception when manage not allowed
2024-10-28 12:33:22 -04:00
Rui Tomé
c126fee296
[PM-11405] Account Management: Prevent a verified user from changing their email address (#4875)
* Add check for managed user before purging account

* Rename IOrganizationRepository.GetByClaimedUserDomainAsync to GetByVerifiedUserEmailDomainAsync and refactor to return a list. Remove ManagedByOrganizationId from ProfileResponseMode. Add ManagesActiveUser to ProfileOrganizationResponseModel

* Rename the property ManagesActiveUser to UserIsManagedByOrganization

* Remove whole class #nullable enable and add it to specific places

* [PM-11405] Account Deprovisioning: Prevent a verified user from changing their email address

* Remove unnecessary .ToList()

* Refactor IUserService methods GetOrganizationsManagingUserAsync and IsManagedByAnyOrganizationAsync to not return nullable objects. Update ProfileOrganizationResponseModel.UserIsManagedByOrganization to not be nullable

* Update error message when unable to purge vault for managed account

* Update error message when unable to change email for managed account

* Update expected error messages on unit tests

* Add TestFeatureService to Api.IntegrationTest.Helpers and use it on ApiApplicationFactory to be able to enable specific features for each test

* Add CreateVerifiedDomainAsync method to OrganizationTestHelpers

* Add tests to AccountsControllerTest to prevent changing email for managed accounts

* Remove setting the feature flag value in ApiApplicationFactory and set it on AccountsControllerTest

* Remove TestFeatureService class from Api.IntegrationTest.Helpers
2024-10-28 16:12:13 +00:00
Maciej Zieniuk
89b0848002
Merge branch 'refs/heads/main' into km/pm-10600 2024-10-28 15:55:46 +00:00
renovate[bot]
cc6e41b42a
[deps] DbOps: Update Microsoft.Azure.Cosmos to 3.45.0 (#4949)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-28 10:29:34 -04:00
renovate[bot]
109ba14cf4
[deps] Tools: Update aws-sdk-net monorepo (#4946)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-28 10:02:40 +01:00
renovate[bot]
e2a69c432c
[deps] Tools: Update LaunchDarkly.ServerSdk to 8.6.0 (#4950)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-28 10:00:33 +01:00
Ike
d0c9953444
[PM-8213] Feature flag for new-device-verification (#4944) 2024-10-26 12:43:27 -04:00
Maciej Zieniuk
dc2e974306
PM-10600: Notifications small refactor and UTs 2024-10-26 15:28:36 +01:00
Jonas Hendrickx
53ad9df003
[PM-13451] Update subscription setup process to support MOE providers (#4937) 2024-10-25 03:56:03 +02:00
Thomas Rittson
6272e84c92
Remove feature flag (#4931)
Co-authored-by: MtnBurrit0 <77340197+mimartin12@users.noreply.github.com>
2024-10-25 10:17:28 +10:00
Matt Gibson
f43f59e4b4
Register noop notification registration service for self host lacking necessary data (#4939) 2024-10-24 15:45:13 -04:00
Vince Grassia
9a499df0e7
BRE-344 - Add PR logic to Repository Management workflow (#4938) 2024-10-24 13:15:16 -06:00
Ike
c028c68d9c
[PM-6666] Two factor Validator refactor (#4894)
* initial device removal

* Unit Testing

* Finalized tests

* initial commit refactoring two factor

* initial tests

* Unit Tests

* initial device removal

* Unit Testing

* Finalized tests

* initial commit refactoring two factor

* initial tests

* Unit Tests

* Fixing some tests

* renaming and reorganizing

* refactored two factor flows

* fixed a possible issue with object mapping.

* Update TwoFactorAuthenticationValidator.cs

removed unused code
2024-10-24 10:41:25 -07:00
Jared McCannon
0c346d6070
[PM-10314] Auto-enable Single Org when a Domain is Verified (#4897)
Updated domain verification to auto-enable single org policy.
2024-10-24 10:13:45 -05:00
Rui Tomé
a128cf1506
[PM-12758] Add managed status to OrganizationUserDetailsResponseModel and OrganizationUserUserDetailsResponse (#4918)
* Refactor OrganizationUsersController.Get to include organization management status of organization users in details endpoint

* Refactor OrganizationUsersController.Get to include organization management status of an individual user in details endpoint

* Remove redundant .ToDictionary()

* Simpify the property xmldoc

* Name tuple variables in OrganizationUsersController.Get

* Name returned tuple objects in GetDetailsByIdWithCollectionsAsync method in OrganizationUserRepository

* Refactor MembersController.Get to destructure tuple returned by GetDetailsByIdWithCollectionsAsync

* Add test for OrganizationUsersController.Get to assert ManagedByOrganization is set accordingly
2024-10-24 15:39:35 +01:00
Maciej Zieniuk
ff0af7de03
Merge branch 'refs/heads/main' into km/pm-10600 2024-10-24 13:08:46 +01:00
Maciej Zieniuk
78698859c8
PM-10600: UT coverage 2024-10-24 13:06:48 +01:00
Maciej Zieniuk
491789bd5a
PM-10600: Required attribute, organization group for push notification fix 2024-10-24 13:05:11 +01:00
Jonas Hendrickx
d38c489443
[PM-13982] [Defect] Can no longer create providers due to foreign key conflict (#4935) 2024-10-24 08:34:27 +02:00
Thomas Rittson
4a1b90db48
Remove bulk-device-approval feature flag definition (#4930) 2024-10-24 08:09:07 +10:00