From 88bccf0d04f2f1279e82674f70daf38e5f7c3774 Mon Sep 17 00:00:00 2001 From: Shane Melton Date: Wed, 2 Nov 2022 09:57:33 -0700 Subject: [PATCH] [EC-7] Org Admin Vault Refresh Server V1 (#2372) * [EC-19] Move SSO Identifier to Org SSO endpoint (#2184) * [EC-19] Move SSO identifier to Org SSO config endpoint * [EC-19] Add Jira tech debt issue reference * [EC-542] Update email communications (#2348) (cherry picked from commit 7469432c7743e2b2b12229b298233b6ab77f7bc6) Co-authored-by: Jacob Fink Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com> --- .../Controllers/OrganizationsController.cs | 2 + .../OrganizationSsoRequestModel.cs | 2 + .../OrganizationUpdateRequestModel.cs | 1 + .../OrganizationSsoResponseModel.cs | 2 + .../Handlebars/Layouts/Full.html.hbs | 20 +++++++++- .../OrganizationSeatsAutoscaled.html.hbs | 39 +++++++------------ .../OrganizationSeatsAutoscaled.text.hbs | 14 ++----- .../OrganizationSeatsMaxReached.html.hbs | 34 +++++++--------- .../OrganizationSeatsMaxReached.text.hbs | 10 +---- .../OrganizationUserAccepted.html.hbs | 24 ++++++------ .../OrganizationUserAccepted.text.hbs | 8 +--- .../Mail/OrganizationUserAcceptedViewModel.cs | 1 + 12 files changed, 77 insertions(+), 80 deletions(-) diff --git a/src/Api/Controllers/OrganizationsController.cs b/src/Api/Controllers/OrganizationsController.cs index 717fc2a26..be96bcb28 100644 --- a/src/Api/Controllers/OrganizationsController.cs +++ b/src/Api/Controllers/OrganizationsController.cs @@ -706,8 +706,10 @@ public class OrganizationsController : Controller var ssoConfig = await _ssoConfigRepository.GetByOrganizationIdAsync(id); ssoConfig = ssoConfig == null ? model.ToSsoConfig(id) : model.ToSsoConfig(ssoConfig); + organization.Identifier = model.Identifier; await _ssoConfigService.SaveAsync(ssoConfig, organization); + await _organizationService.UpdateAsync(organization); return new OrganizationSsoResponseModel(organization, _globalSettings, ssoConfig); } diff --git a/src/Api/Models/Request/Organizations/OrganizationSsoRequestModel.cs b/src/Api/Models/Request/Organizations/OrganizationSsoRequestModel.cs index 47594703d..6dd23aa7c 100644 --- a/src/Api/Models/Request/Organizations/OrganizationSsoRequestModel.cs +++ b/src/Api/Models/Request/Organizations/OrganizationSsoRequestModel.cs @@ -16,6 +16,8 @@ public class OrganizationSsoRequestModel { [Required] public bool Enabled { get; set; } + [StringLength(50)] + public string Identifier { get; set; } [Required] public SsoConfigurationDataRequest Data { get; set; } diff --git a/src/Api/Models/Request/Organizations/OrganizationUpdateRequestModel.cs b/src/Api/Models/Request/Organizations/OrganizationUpdateRequestModel.cs index f67016bce..0bd16767d 100644 --- a/src/Api/Models/Request/Organizations/OrganizationUpdateRequestModel.cs +++ b/src/Api/Models/Request/Organizations/OrganizationUpdateRequestModel.cs @@ -12,6 +12,7 @@ public class OrganizationUpdateRequestModel public string Name { get; set; } [StringLength(50)] public string BusinessName { get; set; } + [Obsolete("2022-08-03 Moved to Org SSO request model, left for backwards compatability. Remove with EC-489.")] [StringLength(50)] public string Identifier { get; set; } [EmailAddress] diff --git a/src/Api/Models/Response/Organizations/OrganizationSsoResponseModel.cs b/src/Api/Models/Response/Organizations/OrganizationSsoResponseModel.cs index cd7e6c266..897eaa54c 100644 --- a/src/Api/Models/Response/Organizations/OrganizationSsoResponseModel.cs +++ b/src/Api/Models/Response/Organizations/OrganizationSsoResponseModel.cs @@ -16,10 +16,12 @@ public class OrganizationSsoResponseModel : ResponseModel Data = config.GetData(); } + Identifier = organization.Identifier; Urls = new SsoUrls(organization.Id.ToString(), globalSettings); } public bool Enabled { get; set; } + public string Identifier { get; set; } public SsoConfigurationData Data { get; set; } public SsoUrls Urls { get; set; } } diff --git a/src/Core/MailTemplates/Handlebars/Layouts/Full.html.hbs b/src/Core/MailTemplates/Handlebars/Layouts/Full.html.hbs index 9664b6dfb..bf884604f 100644 --- a/src/Core/MailTemplates/Handlebars/Layouts/Full.html.hbs +++ b/src/Core/MailTemplates/Handlebars/Layouts/Full.html.hbs @@ -46,7 +46,7 @@ body { background-color: #f6f6f6; } - + @media only screen and (max-width: 600px) { body { padding: 0 !important; @@ -99,6 +99,24 @@ width: 600px !important; } } + + /* Component styling - these are explicitly applied via classes so that they can be + gradually introduced as we update templates.*/ + a.inline-link { + font-weight: bold; + color: #175DDC; + text-decoration: none; + } + + br.line-break { + margin: 0; + box-sizing: border-box; + color: #333; + line-height: 25px; + -webkit-font-smoothing: antialiased; + -webkit-text-size-adjust: none; + } + {{! Yahoo center fix }} - - - + + +
diff --git a/src/Core/MailTemplates/Handlebars/OrganizationSeatsAutoscaled.html.hbs b/src/Core/MailTemplates/Handlebars/OrganizationSeatsAutoscaled.html.hbs index 739ed07cd..8277e3894 100644 --- a/src/Core/MailTemplates/Handlebars/OrganizationSeatsAutoscaled.html.hbs +++ b/src/Core/MailTemplates/Handlebars/OrganizationSeatsAutoscaled.html.hbs @@ -6,39 +6,30 @@ - To accommodate new user invitations, your seat count has increased from {{InitialSeatCount}} to {{CurrentSeatCount}}. A - prorated charge has been immediately applied to your subscription for the new users. This notification will only be sent + To accommodate new member invitations, your seat count has increased from {{InitialSeatCount}} to {{CurrentSeatCount}}. A + prorated charge has been immediately applied to your subscription for the new members. This notification will only be sent once.
- To manage your subscription: -
    -
  1. Log in to your - - Web Vault - - and open your Organization. -
  2. -
  3. Open the Settings tab and select Subscription from the left-hand menu.
  4. -
  5. Update your subscription.
  6. -
  7. Click Save.
  8. -
-
- For more information, please refer to - - our help article. + For more information, please refer to the following help article: + + Member management +
+
+
+ + Manage subscription + +
diff --git a/src/Core/MailTemplates/Handlebars/OrganizationSeatsAutoscaled.text.hbs b/src/Core/MailTemplates/Handlebars/OrganizationSeatsAutoscaled.text.hbs index 426776c61..b6314b22b 100644 --- a/src/Core/MailTemplates/Handlebars/OrganizationSeatsAutoscaled.text.hbs +++ b/src/Core/MailTemplates/Handlebars/OrganizationSeatsAutoscaled.text.hbs @@ -1,13 +1,7 @@ {{#>BasicTextLayout}} -To accommodate new user invitations, your seat count has increased from {{InitialSeatCount}} to {{CurrentSeatCount}}. A -prorated charge has been immediately applied to your subscription for the new users. This notification will only be sent -once. +To accommodate new member invitations, your seat count has increased from {{InitialSeatCount}} to {{CurrentSeatCount}}. A +prorated charge has been immediately applied to your subscription for the new members. +This notification will only be sent once. -To manage your subscription: -1. Log in to your Web Vault and open your Organization. -2. Open the Settings tab and select Subscription from the left-hand menu. -4. Update your subscription. -5. Click Save. - -For more information, please refer to the following help article: https://bitwarden.com/help/article/managing-user/#subscription +For more information, please refer to the following help article: https://bitwarden.com/help/managing-users {{/BasicTextLayout}} diff --git a/src/Core/MailTemplates/Handlebars/OrganizationSeatsMaxReached.html.hbs b/src/Core/MailTemplates/Handlebars/OrganizationSeatsMaxReached.html.hbs index 1922770ec..6ac2ee74a 100644 --- a/src/Core/MailTemplates/Handlebars/OrganizationSeatsMaxReached.html.hbs +++ b/src/Core/MailTemplates/Handlebars/OrganizationSeatsMaxReached.html.hbs @@ -6,23 +6,7 @@ - Your organization has reached the seat limit of {{MaxSeatCount}} and new users cannot be invited. - - - - - To increase your subscription: -
    -
  1. Log in to your Web - Vault and open your Organization.
  2. -
  3. Open the Settings tab and select Subscription from the left-hand menu.
  4. -
  5. Update your subscription.
  6. -
  7. Click Save.
  8. -
+ Your organization has reached the seat limit of {{MaxSeatCount}} and new members cannot be invited. - For more information, please refer to the following help article: https://bitwarden.com/help/article/managing-users/#subscription + For more information, please refer to the following help article: + + Member management + +
+
+ + + + + + Manage subscription + +
diff --git a/src/Core/MailTemplates/Handlebars/OrganizationSeatsMaxReached.text.hbs b/src/Core/MailTemplates/Handlebars/OrganizationSeatsMaxReached.text.hbs index 7c02784bf..d5a541a1b 100644 --- a/src/Core/MailTemplates/Handlebars/OrganizationSeatsMaxReached.text.hbs +++ b/src/Core/MailTemplates/Handlebars/OrganizationSeatsMaxReached.text.hbs @@ -1,11 +1,5 @@ {{#>BasicTextLayout}} -Your organization has reached the seat limit of {{MaxSeatCount}} and new users cannot be invited. +Your organization has reached the seat limit of {{MaxSeatCount}} and new members cannot be invited. -To increase your subscription: -1. Log in to your Web Vault and open your Organization. -2. Open the Settings tab and select Subscription from the left-hand menu. -4. Update your subscription. -5. Click Save. - -For more information, please refer to the following help article: https://bitwarden.com/help/article/managing-user/#subscription +For more information, please refer to the following help article: https://bitwarden.com/help/managing-users {{/BasicTextLayout}} diff --git a/src/Core/MailTemplates/Handlebars/OrganizationUserAccepted.html.hbs b/src/Core/MailTemplates/Handlebars/OrganizationUserAccepted.html.hbs index 7dc5e02c3..acc82b409 100644 --- a/src/Core/MailTemplates/Handlebars/OrganizationUserAccepted.html.hbs +++ b/src/Core/MailTemplates/Handlebars/OrganizationUserAccepted.html.hbs @@ -6,19 +6,21 @@ - - To confirm users into your organization: -
    -
  1. Log in to your Web Vault and open your Organization.
  2. -
  3. Open the Manage tab and select People from the left-hand menu.
  4. -
  5. Hover over the Accepted user and select the gear dropdown.
  6. -
  7. Select Confirm.
  8. -
+ + For more information, please refer to the following help article: + + Member management + +
+
- - - For more information, please refer to the following help article: https://bitwarden.com/help/article/managing-users/#confirm + + + + Confirm member + +
diff --git a/src/Core/MailTemplates/Handlebars/OrganizationUserAccepted.text.hbs b/src/Core/MailTemplates/Handlebars/OrganizationUserAccepted.text.hbs index 1e1918fe5..1ac99113f 100644 --- a/src/Core/MailTemplates/Handlebars/OrganizationUserAccepted.text.hbs +++ b/src/Core/MailTemplates/Handlebars/OrganizationUserAccepted.text.hbs @@ -1,11 +1,5 @@ {{#>BasicTextLayout}} {{UserIdentifier}} needs to be confirmed to {{OrganizationName}} before they can access the organization vault. -To confirm users into your organization: -1. Log in to your Web Vault and open your Organization. -2. Open the Manage tab and select People from the left-hand menu. -3. Hover over the Accepted user and select the grear dropdown. -4. Select Confirm. - -For more information, please refer to the following help article: https://bitwarden.com/help/article/managing-user/#confirm +For more information, please refer to the following help article: https://bitwarden.com/help/managing-users/#onboard-users {{/BasicTextLayout}} diff --git a/src/Core/Models/Mail/OrganizationUserAcceptedViewModel.cs b/src/Core/Models/Mail/OrganizationUserAcceptedViewModel.cs index 919463c2c..543df2fc6 100644 --- a/src/Core/Models/Mail/OrganizationUserAcceptedViewModel.cs +++ b/src/Core/Models/Mail/OrganizationUserAcceptedViewModel.cs @@ -5,4 +5,5 @@ public class OrganizationUserAcceptedViewModel : BaseMailModel public Guid OrganizationId { get; set; } public string OrganizationName { get; set; } public string UserIdentifier { get; set; } + public string ConfirmUrl => $"{WebVaultUrl}/organizations/{OrganizationId}/members"; }