1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-21 12:05:42 +01:00

[AC-1637] Added JsonConverter to Provider DTOs

This commit is contained in:
Rui Tome 2023-10-03 10:13:08 +01:00
parent d0500edd63
commit 94d507cf93
No known key found for this signature in database
GPG Key ID: 526239D96A8EC066
3 changed files with 12 additions and 1 deletions

View File

@ -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)]

View File

@ -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]

View File

@ -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; }
}