Skip to content

Commit

Permalink
Set max length on text input fields
Browse files Browse the repository at this point in the history
  • Loading branch information
MKodde committed Aug 15, 2024
1 parent df2a53e commit b602799
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ class SaveOauthClientCredentialClientCommand implements SaveEntityCommandInterfa
#[SpDashboardAssert\ValidClientId]
#[SpDashboardAssert\UniqueEntityId]
#[Assert\NotBlank]
#[Assert\Length(max: 300)]
private ?string $entityId = null;

#[Assert\Length(max: 300)]
private ?string $secret = null;

private ?bool $isPublicClient = null;
Expand All @@ -77,6 +79,7 @@ class SaveOauthClientCredentialClientCommand implements SaveEntityCommandInterfa
#[SpDashboardAssert\ValidLogo()]
#[Assert\Url]
#[Assert\NotBlank]
#[Assert\Length(max: 255)]
private $logoUrl;

/**
Expand All @@ -90,12 +93,14 @@ class SaveOauthClientCredentialClientCommand implements SaveEntityCommandInterfa
* @var string
*/
#[Assert\NotBlank]
#[Assert\Length(max: 255)]
private $nameNl;

/**
* @var string
*/
#[Assert\NotBlank]
#[Assert\Length(max: 255)]
private $nameEn;

/**
Expand Down Expand Up @@ -148,6 +153,7 @@ class SaveOauthClientCredentialClientCommand implements SaveEntityCommandInterfa
/**
* @var string
*/
#[Assert\Length(max: 300)]
private $comments;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,13 @@ class SaveOidcngEntityCommand implements SaveEntityCommandInterface
#[SpDashboardAssert\ValidClientId()]
#[SpDashboardAssert\UniqueEntityId()]
#[Assert\NotBlank]
#[Assert\Length(max: 300)]
private ?string $entityId = null;

/**
* @var string
*/
#[Assert\Length(max: 255)]
private $secret;

/**
Expand Down Expand Up @@ -105,6 +107,7 @@ class SaveOidcngEntityCommand implements SaveEntityCommandInterface
#[SpDashboardAssert\ValidLogo()]
#[Assert\Url]
#[Assert\NotBlank]
#[Assert\Length(max: 255)]
private $logoUrl;

/**
Expand All @@ -118,12 +121,14 @@ class SaveOidcngEntityCommand implements SaveEntityCommandInterface
* @var string
*/
#[Assert\NotBlank]
#[Assert\Length(max: 255)]
private $nameNl;

/**
* @var string
*/
#[Assert\NotBlank]
#[Assert\Length(max: 255)]
private $nameEn;

/**
Expand All @@ -144,6 +149,7 @@ class SaveOidcngEntityCommand implements SaveEntityCommandInterface
* @var string
*/
#[Assert\Url]
#[Assert\Length(max: 300)]
private $applicationUrl;

/** @var TypeOfService[] */
Expand All @@ -163,6 +169,7 @@ class SaveOidcngEntityCommand implements SaveEntityCommandInterface
* @var string
*/
#[Assert\Url]
#[Assert\Length(max: 300)]
private $eulaUrl;

/**
Expand Down Expand Up @@ -192,6 +199,7 @@ class SaveOidcngEntityCommand implements SaveEntityCommandInterface
/**
* @var string
*/
#[Assert\Length(max: 300)]
private $comments;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,23 +56,27 @@ class SaveOidcngResourceServerEntityCommand implements SaveEntityCommandInterfac
#[SpDashboardAssert\ValidClientId]
#[SpDashboardAssert\UniqueEntityId]
#[Assert\NotBlank]
#[Assert\Length(max: 300)]
private ?string $entityId = null;

/**
* @var string
*/
#[Assert\Length(max: 255)]
private $secret;

/**
* @var string
*/
#[Assert\NotBlank]
#[Assert\Length(max: 255)]
private $nameNl;

/**
* @var string
*/
#[Assert\NotBlank]
#[Assert\Length(max: 255)]
private $nameEn;

/**
Expand Down Expand Up @@ -113,6 +117,7 @@ class SaveOidcngResourceServerEntityCommand implements SaveEntityCommandInterfac
/**
* @var string
*/
#[Assert\Length(max: 300)]
private $comments;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ class SaveSamlEntityCommand implements SaveEntityCommandInterface
#[SpDashboardAssert\ValidEntityId()]
#[SpDashboardAssert\UniqueEntityId()]
#[Assert\NotBlank]
#[Assert\Length(max: 255)]

private string $entityId;

#[SpDashboardAssert\ValidSSLCertificate()]
Expand All @@ -88,12 +90,15 @@ class SaveSamlEntityCommand implements SaveEntityCommandInterface
#[SpDashboardAssert\ValidLogo()]
#[Assert\Url]
#[Assert\NotBlank]
#[Assert\Length(max: 300)]
private ?string $logoUrl = null;

#[Assert\NotBlank]
#[Assert\Length(max: 255)]
private ?string $nameNl = null;

#[Assert\NotBlank]
#[Assert\Length(max: 255)]
private ?string $nameEn = null;

#[Assert\NotBlank]
Expand All @@ -105,6 +110,7 @@ class SaveSamlEntityCommand implements SaveEntityCommandInterface
private ?string $descriptionEn = null;

#[Assert\Url]
#[Assert\Length(max: 300)]
private ?string $applicationUrl = null;

/** @var TypeOfService[] */
Expand All @@ -121,6 +127,7 @@ class SaveSamlEntityCommand implements SaveEntityCommandInterface
private array $typeOfService = [];

#[Assert\Url]
#[Assert\Length(max: 300)]
private ?string $eulaUrl = null;


Expand All @@ -143,6 +150,7 @@ class SaveSamlEntityCommand implements SaveEntityCommandInterface
)]
private array $attributes = [];

#[Assert\Length(max: 300)]
private ?string $comments = null;

#[Assert\Choice(callback: [Constants::class, 'getValidNameIdFormats'], strict: true)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,18 @@ class Contact implements Stringable
* @var string
*/
#[Assert\NotBlank(groups: ['Default', 'production'])]
#[Assert\Length(max: 150)]
private $firstName;

/**
* @var string
*/
#[Assert\NotBlank(groups: ['Default', 'production'])]
#[Assert\Length(max: 150)]
private $lastName;

#[Assert\NotBlank(groups: ['Default', 'production'])]
#[Assert\Length(max: 200)]
private string|null|array $email = null;

/**
Expand Down

0 comments on commit b602799

Please sign in to comment.