-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PM-10317] Email Users For Org Claiming Domain (#5094)
* Revoking users when enabling single org and 2fa policies. Fixing tests. * Added migration. * Wrote tests and fixed bugs found. * Patch build process * Fixing tests. * Added unit test around disabling the feature flag. * Updated error message to be public and added test for validating the request. * formatting * Added some tests for single org policy validator. * Fix issues from merge. * Added sending emails to revoked non-compliant users. * Fixing name. Adding two factor policy email. * Send email when user has been revoked. * Correcting migration name. * Fixing templates and logic issue in Revoke command. * Moving interface into its own file. * Correcting namespaces for email templates. * correcting logic that would not allow normal users to revoke non owners. * Actually correcting the test and logic. * dotnet format. Added exec to bottom of bulk sproc * Update src/Core/AdminConsole/OrganizationFeatures/OrganizationUsers/RevokeNonCompliantOrganizationUserCommand.cs Co-authored-by: Rui Tomé <[email protected]> * Updated OrgIds to be a json string * Fixing errors. * Updating test * Moving command result. * Formatting and request rename * Realized this would throw a null error from the system domain verification. Adding unknown type to event system user. Adding optional parameter to SaveAsync in policy service in order to pass in event system user. * Code review changes * Removing todos * Corrected test name. * Syncing filename to record name. * Fixing up the tests. * Added happy path test * Naming corrections. And corrected EF query. * added check against event service * Code review changes. * Fixing tests. * splitting up tests * Added templates and email side effect for claiming a domain. * bringing changes from nc user changes. * Switched to enqueue mail message. * Filled in DomainClaimedByOrganization.html.hbs * Added text document for domain claiming * Fixing migration script. * Remove old sproc * Limiting sending of the email down to users who are a part of the domain being claimed. * Added test for change * Renames and fixed up email. * Fixing up CSS --------- Co-authored-by: Matt Bishop <[email protected]> Co-authored-by: Rui Tomé <[email protected]> Co-authored-by: Rui Tome <[email protected]>
- Loading branch information
1 parent
04f9d7d
commit f471fff
Showing
9 changed files
with
145 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
src/Core/MailTemplates/Handlebars/AdminConsole/DomainClaimedByOrganization.html.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{{#>TitleContactUsHtmlLayout}} | ||
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="display: table; width:100%; padding: 30px; text-align: left;" align="center"> | ||
<tr> | ||
<td display="display: table-cell"> | ||
As a member of {{OrganizationName}}, your Bitwarden account is claimed and owned by your organization. | ||
</td> | ||
</tr> | ||
<tr> | ||
<td style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 400; font-size: 16px; line-height: 24px; margin-top: 30px; margin-bottom: 25px; margin-left: 35px; margin-right: 35px;"> | ||
<b>Here's what that means:</b> | ||
<ul> | ||
<li>This account should only be used to store items related to {{OrganizationName}}</li> | ||
<li>Admins managing your Bitwarden organization manage your email address and other account settings</li> | ||
<li>Admins can also revoke or delete your account at any time</li> | ||
</ul> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 400; font-size: 16px; line-height: 24px; margin-top: 30px; margin-bottom: 25px; margin-left: 35px; margin-right: 35px;"> | ||
For more information, please refer to the following help article: <a href="https://bitwarden.com/help/claimed-accounts">Claimed Accounts</a> | ||
</td> | ||
</tr> | ||
</table> | ||
{{/TitleContactUsHtmlLayout}} |
8 changes: 8 additions & 0 deletions
8
src/Core/MailTemplates/Handlebars/AdminConsole/DomainClaimedByOrganization.text.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
As a member of {{OrganizationName}}, your Bitwarden account is claimed and owned by your organization. | ||
|
||
Here's what that means: | ||
- This account should only be used to store items related to {{OrganizationName}} | ||
- Your admins managing your Bitwarden organization manages your email address and other account settings | ||
- Your admins can also revoke or delete your account at any time | ||
|
||
For more information, please refer to the following help article: Claimed Accounts (https://bitwarden.com/help/claimed-accounts) |
5 changes: 5 additions & 0 deletions
5
src/Core/Models/Data/Organizations/ManagedUserDomainClaimedEmails.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
using Bit.Core.AdminConsole.Entities; | ||
|
||
namespace Bit.Core.Models.Data.Organizations; | ||
|
||
public record ManagedUserDomainClaimedEmails(IEnumerable<string> EmailList, Organization Organization); |
6 changes: 6 additions & 0 deletions
6
src/Core/Models/Mail/ClaimedDomainUserNotificationViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace Bit.Core.Models.Mail; | ||
|
||
public class ClaimedDomainUserNotificationViewModel : BaseTitleContactUsMailModel | ||
{ | ||
public string OrganizationName { get; init; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters