diff --git a/src/Api/Models/Request/Providers/ProviderSetupRequestModel.cs b/src/Api/Models/Request/Providers/ProviderSetupRequestModel.cs index 51191f947..a67f5187a 100644 --- a/src/Api/Models/Request/Providers/ProviderSetupRequestModel.cs +++ b/src/Api/Models/Request/Providers/ProviderSetupRequestModel.cs @@ -1,5 +1,7 @@ using System.ComponentModel.DataAnnotations; +using System.Text.Json.Serialization; using Bit.Core.Entities.Provider; +using Bit.Core.Utilities; namespace Bit.Api.Models.Request.Providers; @@ -7,8 +9,10 @@ public class ProviderSetupRequestModel { [Required] [StringLength(50)] + [JsonConverter(typeof(HtmlEncodingStringConverter))] public string Name { get; set; } [StringLength(50)] + [JsonConverter(typeof(HtmlEncodingStringConverter))] public string BusinessName { get; set; } [Required] [StringLength(256)] diff --git a/src/Api/Models/Request/Providers/ProviderUpdateRequestModel.cs b/src/Api/Models/Request/Providers/ProviderUpdateRequestModel.cs index ceec796dc..05a5c9177 100644 --- a/src/Api/Models/Request/Providers/ProviderUpdateRequestModel.cs +++ b/src/Api/Models/Request/Providers/ProviderUpdateRequestModel.cs @@ -1,6 +1,8 @@ using System.ComponentModel.DataAnnotations; +using System.Text.Json.Serialization; using Bit.Core.Entities.Provider; using Bit.Core.Settings; +using Bit.Core.Utilities; namespace Bit.Api.Models.Request.Providers; @@ -8,8 +10,10 @@ public class ProviderUpdateRequestModel { [Required] [StringLength(50)] + [JsonConverter(typeof(HtmlEncodingStringConverter))] public string Name { get; set; } [StringLength(50)] + [JsonConverter(typeof(HtmlEncodingStringConverter))] public string BusinessName { get; set; } [EmailAddress] [Required] diff --git a/src/Api/Models/Response/Providers/ProviderOrganizationResponseModel.cs b/src/Api/Models/Response/Providers/ProviderOrganizationResponseModel.cs index 9bc7d52dc..7e0721e91 100644 --- a/src/Api/Models/Response/Providers/ProviderOrganizationResponseModel.cs +++ b/src/Api/Models/Response/Providers/ProviderOrganizationResponseModel.cs @@ -1,6 +1,8 @@ -using Bit.Core.Entities.Provider; +using System.Text.Json.Serialization; +using Bit.Core.Entities.Provider; using Bit.Core.Models.Api; using Bit.Core.Models.Data; +using Bit.Core.Utilities; namespace Bit.Api.Models.Response.Providers; @@ -68,5 +70,6 @@ public class ProviderOrganizationOrganizationDetailsResponseModel : ProviderOrga OrganizationName = providerOrganization.OrganizationName; } + [JsonConverter(typeof(HtmlEncodingStringConverter))] public string OrganizationName { get; set; } }