-
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.
Merge branch 'master' into sm/sm-863
- Loading branch information
Showing
51 changed files
with
2,872 additions
and
373 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
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
45 changes: 45 additions & 0 deletions
45
src/Api/Models/Request/Organizations/SecretsManagerSubscriptionUpdateRequestModel.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,45 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
using Bit.Core.Entities; | ||
using Bit.Core.Models.Business; | ||
using Bit.Core.Models.StaticStore; | ||
|
||
namespace Bit.Api.Models.Request.Organizations; | ||
|
||
public class SecretsManagerSubscriptionUpdateRequestModel | ||
{ | ||
[Required] | ||
public int SeatAdjustment { get; set; } | ||
public int? MaxAutoscaleSeats { get; set; } | ||
public int ServiceAccountAdjustment { get; set; } | ||
public int? MaxAutoscaleServiceAccounts { get; set; } | ||
|
||
public virtual SecretsManagerSubscriptionUpdate ToSecretsManagerSubscriptionUpdate(Organization organization, Plan plan) | ||
{ | ||
var newTotalSeats = organization.SmSeats.GetValueOrDefault() + SeatAdjustment; | ||
var newTotalServiceAccounts = organization.SmServiceAccounts.GetValueOrDefault() + ServiceAccountAdjustment; | ||
|
||
var orgUpdate = new SecretsManagerSubscriptionUpdate | ||
{ | ||
OrganizationId = organization.Id, | ||
|
||
SmSeatsAdjustment = SeatAdjustment, | ||
SmSeats = newTotalSeats, | ||
SmSeatsExcludingBase = newTotalSeats - plan.BaseSeats, | ||
|
||
MaxAutoscaleSmSeats = MaxAutoscaleSeats, | ||
|
||
SmServiceAccountsAdjustment = ServiceAccountAdjustment, | ||
SmServiceAccounts = newTotalServiceAccounts, | ||
SmServiceAccountsExcludingBase = newTotalServiceAccounts - plan.BaseServiceAccount.GetValueOrDefault(), | ||
|
||
MaxAutoscaleSmServiceAccounts = MaxAutoscaleServiceAccounts, | ||
|
||
MaxAutoscaleSmSeatsChanged = | ||
MaxAutoscaleSeats.GetValueOrDefault() != organization.MaxAutoscaleSmSeats.GetValueOrDefault(), | ||
MaxAutoscaleSmServiceAccountsChanged = | ||
MaxAutoscaleServiceAccounts.GetValueOrDefault() != organization.MaxAutoscaleSmServiceAccounts.GetValueOrDefault() | ||
}; | ||
|
||
return orgUpdate; | ||
} | ||
} |
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
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
34 changes: 34 additions & 0 deletions
34
src/Core/MailTemplates/Handlebars/OrganizationSmSeatsMaxReached.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,34 @@ | ||
{{#>FullHtmlLayout}} | ||
<table width="100%" cellpadding="0" cellspacing="0" | ||
style="margin: 0; box-sizing: border-box; "> | ||
<tr | ||
style="margin: 0; box-sizing: border-box; "> | ||
<td class="content-block" | ||
style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 16px; color: #333; line-height: 25px; margin: 0; -webkit-font-smoothing: antialiased; padding: 0 0 10px; -webkit-text-size-adjust: none;" | ||
valign="top"> | ||
Your organization has reached the Secrets Manager seat limit of {{MaxSeatCount}} and new members cannot be invited. | ||
</td> | ||
</tr> | ||
<tr | ||
style="margin: 0; box-sizing: border-box; "> | ||
<td class="content-block last" | ||
style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 16px; color: #333; line-height: 25px; margin: 0; -webkit-font-smoothing: antialiased; padding: 0; -webkit-text-size-adjust: none;" | ||
valign="top"> | ||
For more information, please refer to the following help article: | ||
<a href="https://bitwarden.com/help/managing-users" class="inline-link"> | ||
Member management | ||
</a> | ||
<br class="line-break" /> | ||
<br class="line-break" /> | ||
</td> | ||
</tr> | ||
<tr style="margin: 0; box-sizing: border-box; color: #333; line-height: 25px; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none;"> | ||
<td class="content-block" style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 16px; color: #333; line-height: 25px; margin: 0; -webkit-font-smoothing: antialiased; padding: 0 0 10px; -webkit-text-size-adjust: none; text-align: center;" valign="top" align="center"> | ||
<a href="https://vault.bitwarden.com/#/organizations/{{{OrganizationId}}}/billing/subscription" clicktracking=off target="_blank" rel="noopener noreferrer" style="color: #ffffff; text-decoration: none; text-align: center; cursor: pointer; display: inline-block; border-radius: 5px; background-color: #175DDC; border-color: #175DDC; border-style: solid; border-width: 10px 20px; margin: 0; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 16px; line-height: 25px; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none;"> | ||
Manage subscription | ||
</a> | ||
<br class="line-break" /> | ||
</td> | ||
</tr> | ||
</table> | ||
{{/FullHtmlLayout}} |
5 changes: 5 additions & 0 deletions
5
src/Core/MailTemplates/Handlebars/OrganizationSmSeatsMaxReached.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,5 @@ | ||
{{#>BasicTextLayout}} | ||
Your organization has reached the Secrets Manager seat limit of {{MaxSeatCount}} and new members cannot be invited. | ||
|
||
For more information, please refer to the following help article: https://bitwarden.com/help/managing-users | ||
{{/BasicTextLayout}} |
34 changes: 34 additions & 0 deletions
34
src/Core/MailTemplates/Handlebars/OrganizationSmServiceAccountsMaxReached.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,34 @@ | ||
{{#>FullHtmlLayout}} | ||
<table width="100%" cellpadding="0" cellspacing="0" | ||
style="margin: 0; box-sizing: border-box; "> | ||
<tr | ||
style="margin: 0; box-sizing: border-box; "> | ||
<td class="content-block" | ||
style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 16px; color: #333; line-height: 25px; margin: 0; -webkit-font-smoothing: antialiased; padding: 0 0 10px; -webkit-text-size-adjust: none;" | ||
valign="top"> | ||
Your organization has reached the Secrets Manager service accounts limit of {{MaxServiceAccountsCount}}. New service accounts cannot be created | ||
</td> | ||
</tr> | ||
<tr | ||
style="margin: 0; box-sizing: border-box; "> | ||
<td class="content-block last" | ||
style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 16px; color: #333; line-height: 25px; margin: 0; -webkit-font-smoothing: antialiased; padding: 0; -webkit-text-size-adjust: none;" | ||
valign="top"> | ||
For more information, please refer to the following help article: | ||
<a href="https://bitwarden.com/help/managing-users" class="inline-link"> | ||
Member management | ||
</a> | ||
<br class="line-break" /> | ||
<br class="line-break" /> | ||
</td> | ||
</tr> | ||
<tr style="margin: 0; box-sizing: border-box; color: #333; line-height: 25px; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none;"> | ||
<td class="content-block" style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 16px; color: #333; line-height: 25px; margin: 0; -webkit-font-smoothing: antialiased; padding: 0 0 10px; -webkit-text-size-adjust: none; text-align: center;" valign="top" align="center"> | ||
<a href="https://vault.bitwarden.com/#/organizations/{{{OrganizationId}}}/billing/subscription" clicktracking=off target="_blank" rel="noopener noreferrer" style="color: #ffffff; text-decoration: none; text-align: center; cursor: pointer; display: inline-block; border-radius: 5px; background-color: #175DDC; border-color: #175DDC; border-style: solid; border-width: 10px 20px; margin: 0; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 16px; line-height: 25px; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none;"> | ||
Manage subscription | ||
</a> | ||
<br class="line-break" /> | ||
</td> | ||
</tr> | ||
</table> | ||
{{/FullHtmlLayout}} |
5 changes: 5 additions & 0 deletions
5
src/Core/MailTemplates/Handlebars/OrganizationSmServiceAccountsMaxReached.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,5 @@ | ||
{{#>BasicTextLayout}} | ||
Your organization has reached the Secrets Manager service accounts limit of {{MaxServiceAccountsCount}}. New service accounts cannot be created | ||
|
||
For more information, please refer to the following help article: https://bitwarden.com/help/managing-users | ||
{{/BasicTextLayout}} |
Oops, something went wrong.