diff --git a/src/Surfnet/ServiceProviderDashboard/Application/Command/Entity/SaveOauthClientCredentialClientCommand.php b/src/Surfnet/ServiceProviderDashboard/Application/Command/Entity/SaveOauthClientCredentialClientCommand.php index 61a9b0a47..a4ec48416 100644 --- a/src/Surfnet/ServiceProviderDashboard/Application/Command/Entity/SaveOauthClientCredentialClientCommand.php +++ b/src/Surfnet/ServiceProviderDashboard/Application/Command/Entity/SaveOauthClientCredentialClientCommand.php @@ -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; @@ -77,6 +79,7 @@ class SaveOauthClientCredentialClientCommand implements SaveEntityCommandInterfa #[SpDashboardAssert\ValidLogo()] #[Assert\Url] #[Assert\NotBlank] + #[Assert\Length(max: 255)] private $logoUrl; /** @@ -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; /** @@ -148,6 +153,7 @@ class SaveOauthClientCredentialClientCommand implements SaveEntityCommandInterfa /** * @var string */ + #[Assert\Length(max: 300)] private $comments; /** diff --git a/src/Surfnet/ServiceProviderDashboard/Application/Command/Entity/SaveOidcngEntityCommand.php b/src/Surfnet/ServiceProviderDashboard/Application/Command/Entity/SaveOidcngEntityCommand.php index fab99a436..180eea818 100644 --- a/src/Surfnet/ServiceProviderDashboard/Application/Command/Entity/SaveOidcngEntityCommand.php +++ b/src/Surfnet/ServiceProviderDashboard/Application/Command/Entity/SaveOidcngEntityCommand.php @@ -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; /** @@ -105,6 +107,7 @@ class SaveOidcngEntityCommand implements SaveEntityCommandInterface #[SpDashboardAssert\ValidLogo()] #[Assert\Url] #[Assert\NotBlank] + #[Assert\Length(max: 255)] private $logoUrl; /** @@ -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; /** @@ -144,6 +149,7 @@ class SaveOidcngEntityCommand implements SaveEntityCommandInterface * @var string */ #[Assert\Url] + #[Assert\Length(max: 300)] private $applicationUrl; /** @var TypeOfService[] */ @@ -163,6 +169,7 @@ class SaveOidcngEntityCommand implements SaveEntityCommandInterface * @var string */ #[Assert\Url] + #[Assert\Length(max: 300)] private $eulaUrl; /** @@ -192,6 +199,7 @@ class SaveOidcngEntityCommand implements SaveEntityCommandInterface /** * @var string */ + #[Assert\Length(max: 300)] private $comments; /** diff --git a/src/Surfnet/ServiceProviderDashboard/Application/Command/Entity/SaveOidcngResourceServerEntityCommand.php b/src/Surfnet/ServiceProviderDashboard/Application/Command/Entity/SaveOidcngResourceServerEntityCommand.php index 9b3414b5c..01489cdac 100644 --- a/src/Surfnet/ServiceProviderDashboard/Application/Command/Entity/SaveOidcngResourceServerEntityCommand.php +++ b/src/Surfnet/ServiceProviderDashboard/Application/Command/Entity/SaveOidcngResourceServerEntityCommand.php @@ -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; /** @@ -113,6 +117,7 @@ class SaveOidcngResourceServerEntityCommand implements SaveEntityCommandInterfac /** * @var string */ + #[Assert\Length(max: 300)] private $comments; /** diff --git a/src/Surfnet/ServiceProviderDashboard/Application/Command/Entity/SaveSamlEntityCommand.php b/src/Surfnet/ServiceProviderDashboard/Application/Command/Entity/SaveSamlEntityCommand.php index 9a57c7389..9c80b9792 100644 --- a/src/Surfnet/ServiceProviderDashboard/Application/Command/Entity/SaveSamlEntityCommand.php +++ b/src/Surfnet/ServiceProviderDashboard/Application/Command/Entity/SaveSamlEntityCommand.php @@ -80,6 +80,8 @@ class SaveSamlEntityCommand implements SaveEntityCommandInterface #[SpDashboardAssert\ValidEntityId()] #[SpDashboardAssert\UniqueEntityId()] #[Assert\NotBlank] + #[Assert\Length(max: 255)] + private string $entityId; #[SpDashboardAssert\ValidSSLCertificate()] @@ -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] @@ -105,6 +110,7 @@ class SaveSamlEntityCommand implements SaveEntityCommandInterface private ?string $descriptionEn = null; #[Assert\Url] + #[Assert\Length(max: 300)] private ?string $applicationUrl = null; /** @var TypeOfService[] */ @@ -121,6 +127,7 @@ class SaveSamlEntityCommand implements SaveEntityCommandInterface private array $typeOfService = []; #[Assert\Url] + #[Assert\Length(max: 300)] private ?string $eulaUrl = null; @@ -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)] diff --git a/src/Surfnet/ServiceProviderDashboard/Domain/ValueObject/Contact.php b/src/Surfnet/ServiceProviderDashboard/Domain/ValueObject/Contact.php index f0090f079..e1109e4a6 100644 --- a/src/Surfnet/ServiceProviderDashboard/Domain/ValueObject/Contact.php +++ b/src/Surfnet/ServiceProviderDashboard/Domain/ValueObject/Contact.php @@ -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; /**