Skip to content

Commit

Permalink
Disable type of service for oauth_ccc entities
Browse files Browse the repository at this point in the history
  • Loading branch information
MKodde committed Jul 8, 2024
1 parent f40f2ea commit 6265d15
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,19 +118,6 @@ class SaveOauthClientCredentialClientCommand implements SaveEntityCommandInterfa
#[Assert\Url]
private $applicationUrl;

/** @var TypeOfService[] */
#[Assert\All([
new Assert\NotBlank(),
new Assert\Type(type: TypeOfService::class),
])]
#[Assert\Count(
min: 1,
max: 3,
minMessage: 'validator.type-of-service.min',
maxMessage: 'validator.type-of-service.max',
)]
private array $typeOfService;

/**
* @var string
*/
Expand Down Expand Up @@ -550,19 +537,9 @@ public function getAcsLocations(): ?array
return null;
}

/**
* @return TypeOfService[]
*/
public function getTypeOfService(): array
{
return $this->typeOfService;
}

/**
* @param TypeOfService[] $typeOfService
*/
public function setTypeOfService(array $typeOfService): void
{
$this->typeOfService = $typeOfService;
// not implemented for oauth_ccc entities
return [];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@

use Surfnet\ServiceProviderDashboard\Application\Command\Entity\SaveOauthClientCredentialClientCommand;
use Surfnet\ServiceProviderDashboard\Application\Command\Entity\SaveOidcngEntityCommand;
use Surfnet\ServiceProviderDashboard\Domain\Repository\TypeOfServiceRepository;
use Surfnet\ServiceProviderDashboard\Domain\ValueObject\TypeOfService;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\FormType;
Expand All @@ -40,7 +38,6 @@ class OauthClientCredentialEntityType extends AbstractType
{
public function __construct(
private readonly OidcngResourceServerOptionsFactory $oidcngResourceServerOptionsFactory,
private readonly TypeOfServiceRepository $typeOfServiceProvider
) {
}

Expand Down Expand Up @@ -168,22 +165,6 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
],
]
)
->add(
'typeOfService',
ChoiceType::class,
[
'required' => false,
'choices' => $this->typeOfServiceProvider->getTypesOfServiceChoices(),
'choice_value' => fn(TypeOfService $tos): string => $tos->typeEn,
'choice_label' => fn(TypeOfService $tos): string => $tos->typeEn,
'expanded' => true,
'multiple' => true,
'attr' => [
'class' => 'type-of-service',
'data-help' => 'entity.edit.information.typeOfService',
],
]
)
->add(
'eulaUrl',
TextType::class,
Expand Down

0 comments on commit 6265d15

Please sign in to comment.