1
0
mirror of https://github.com/bitwarden/server.git synced 2025-01-10 20:07:56 +01:00

[SM-240] Add encrypted length limits to request models (#3095)

This commit is contained in:
Thomas Avery 2023-08-08 12:08:53 -05:00 committed by GitHub
parent 1a21eca481
commit ab5c6d088b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 10 additions and 0 deletions

View File

@ -8,6 +8,7 @@ public class ProjectCreateRequestModel
{
[Required]
[EncryptedString]
[EncryptedStringLength(1000)]
public string Name { get; set; }
public Project ToProject(Guid organizationId)

View File

@ -8,6 +8,7 @@ public class ProjectUpdateRequestModel
{
[Required]
[EncryptedString]
[EncryptedStringLength(1000)]
public string Name { get; set; }
public Project ToProject(Guid id)

View File

@ -8,14 +8,17 @@ public class SecretCreateRequestModel : IValidatableObject
{
[Required]
[EncryptedString]
[EncryptedStringLength(1000)]
public string Key { get; set; }
[Required]
[EncryptedString]
[EncryptedStringLength(5000)]
public string Value { get; set; }
[Required]
[EncryptedString]
[EncryptedStringLength(10000)]
public string Note { get; set; }
public Guid[] ProjectIds { get; set; }

View File

@ -8,14 +8,17 @@ public class SecretUpdateRequestModel : IValidatableObject
{
[Required]
[EncryptedString]
[EncryptedStringLength(1000)]
public string Key { get; set; }
[Required]
[EncryptedString]
[EncryptedStringLength(5000)]
public string Value { get; set; }
[Required]
[EncryptedString]
[EncryptedStringLength(10000)]
public string Note { get; set; }
public Guid[] ProjectIds { get; set; }

View File

@ -8,6 +8,7 @@ public class ServiceAccountUpdateRequestModel
{
[Required]
[EncryptedString]
[EncryptedStringLength(1000)]
public string Name { get; set; }
public ServiceAccount ToServiceAccount(Guid id)

View File

@ -8,6 +8,7 @@ public class ServiceAccountCreateRequestModel
{
[Required]
[EncryptedString]
[EncryptedStringLength(1000)]
public string Name { get; set; }
public ServiceAccount ToServiceAccount(Guid organizationId)