diff --git a/ci/qa/phpstan-baseline.php b/ci/qa/phpstan-baseline.php index 1d82bb98e..490db9b35 100644 --- a/ci/qa/phpstan-baseline.php +++ b/ci/qa/phpstan-baseline.php @@ -611,11 +611,6 @@ 'count' => 1, 'path' => __DIR__ . '/../../src/Surfnet/ServiceProviderDashboard/Application/Factory/EntityDetailFactory.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Cannot call method getCertData\\(\\) on Surfnet\\\\ServiceProviderDashboard\\\\Domain\\\\Entity\\\\Entity\\\\MetaData\\|null\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../src/Surfnet/ServiceProviderDashboard/Application/Factory/EntityDetailFactory.php', -]; $ignoreErrors[] = [ 'message' => '#^Cannot call method getContacts\\(\\) on Surfnet\\\\ServiceProviderDashboard\\\\Domain\\\\Entity\\\\Entity\\\\MetaData\\|null\\.$#', 'count' => 3, @@ -886,11 +881,6 @@ 'count' => 2, 'path' => __DIR__ . '/../../src/Surfnet/ServiceProviderDashboard/Application/Metadata/JsonGenerator.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Cannot call method getCertData\\(\\) on Surfnet\\\\ServiceProviderDashboard\\\\Domain\\\\Entity\\\\Entity\\\\MetaData\\|null\\.$#', - 'count' => 4, - 'path' => __DIR__ . '/../../src/Surfnet/ServiceProviderDashboard/Application/Metadata/JsonGenerator.php', -]; $ignoreErrors[] = [ 'message' => '#^Cannot call method getContacts\\(\\) on Surfnet\\\\ServiceProviderDashboard\\\\Domain\\\\Entity\\\\Entity\\\\MetaData\\|null\\.$#', 'count' => 6, @@ -4501,11 +4491,6 @@ 'count' => 1, 'path' => __DIR__ . '/../../src/Surfnet/ServiceProviderDashboard/Infrastructure/Manage/Factory/SaveCommandFactory.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Cannot call method getCertData\\(\\) on Surfnet\\\\ServiceProviderDashboard\\\\Domain\\\\Entity\\\\Entity\\\\MetaData\\|null\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/../../src/Surfnet/ServiceProviderDashboard/Infrastructure/Manage/Factory/SaveCommandFactory.php', -]; $ignoreErrors[] = [ 'message' => '#^Cannot call method getClientSecret\\(\\) on Surfnet\\\\ServiceProviderDashboard\\\\Domain\\\\Entity\\\\Entity\\\\OidcClientInterface\\|null\\.$#', 'count' => 3, diff --git a/src/Surfnet/ServiceProviderDashboard/Application/Command/Entity/SaveEntityCommandInterface.php b/src/Surfnet/ServiceProviderDashboard/Application/Command/Entity/SaveEntityCommandInterface.php index e4f736728..dcc0444e2 100644 --- a/src/Surfnet/ServiceProviderDashboard/Application/Command/Entity/SaveEntityCommandInterface.php +++ b/src/Surfnet/ServiceProviderDashboard/Application/Command/Entity/SaveEntityCommandInterface.php @@ -60,8 +60,6 @@ public function getApplicationUrl(): ?string; public function getEulaUrl(): ?string; - public function getCertificate(): ?string; - public function getLogoUrl(): ?string; public function getComments(): ?string; diff --git a/src/Surfnet/ServiceProviderDashboard/Application/Command/Entity/SaveOauthClientCredentialClientCommand.php b/src/Surfnet/ServiceProviderDashboard/Application/Command/Entity/SaveOauthClientCredentialClientCommand.php index 61a9b0a47..04f0bc6e3 100644 --- a/src/Surfnet/ServiceProviderDashboard/Application/Command/Entity/SaveOauthClientCredentialClientCommand.php +++ b/src/Surfnet/ServiceProviderDashboard/Application/Command/Entity/SaveOauthClientCredentialClientCommand.php @@ -522,11 +522,6 @@ public function getMetadataUrl(): ?string return null; } - public function getCertificate(): ?string - { - return null; - } - public function getNameIdFormat(): string { return $this->getSubjectType(); diff --git a/src/Surfnet/ServiceProviderDashboard/Application/Command/Entity/SaveOidcngEntityCommand.php b/src/Surfnet/ServiceProviderDashboard/Application/Command/Entity/SaveOidcngEntityCommand.php index fab99a436..62f824ec9 100644 --- a/src/Surfnet/ServiceProviderDashboard/Application/Command/Entity/SaveOidcngEntityCommand.php +++ b/src/Surfnet/ServiceProviderDashboard/Application/Command/Entity/SaveOidcngEntityCommand.php @@ -678,11 +678,6 @@ public function getMetadataUrl(): ?string return null; } - public function getCertificate(): ?string - { - return null; - } - public function getNameIdFormat(): string { return $this->getSubjectType(); diff --git a/src/Surfnet/ServiceProviderDashboard/Application/Command/Entity/SaveOidcngResourceServerEntityCommand.php b/src/Surfnet/ServiceProviderDashboard/Application/Command/Entity/SaveOidcngResourceServerEntityCommand.php index 9b3414b5c..938dfcf42 100644 --- a/src/Surfnet/ServiceProviderDashboard/Application/Command/Entity/SaveOidcngResourceServerEntityCommand.php +++ b/src/Surfnet/ServiceProviderDashboard/Application/Command/Entity/SaveOidcngResourceServerEntityCommand.php @@ -435,11 +435,6 @@ public function getEulaUrl(): ?string return null; } - public function getCertificate(): ?string - { - return null; - } - public function getLogoUrl(): ?string { return null; diff --git a/src/Surfnet/ServiceProviderDashboard/Application/Command/Entity/SaveSamlEntityCommand.php b/src/Surfnet/ServiceProviderDashboard/Application/Command/Entity/SaveSamlEntityCommand.php index 9a57c7389..5e0a251b7 100644 --- a/src/Surfnet/ServiceProviderDashboard/Application/Command/Entity/SaveSamlEntityCommand.php +++ b/src/Surfnet/ServiceProviderDashboard/Application/Command/Entity/SaveSamlEntityCommand.php @@ -82,9 +82,6 @@ class SaveSamlEntityCommand implements SaveEntityCommandInterface #[Assert\NotBlank] private string $entityId; - #[SpDashboardAssert\ValidSSLCertificate()] - private ?string $certificate = null; - #[SpDashboardAssert\ValidLogo()] #[Assert\Url] #[Assert\NotBlank] @@ -292,16 +289,6 @@ public function setEntityId(string $entityId): void $this->entityId = $entityId; } - public function getCertificate(): ?string - { - return $this->certificate; - } - - public function setCertificate(?string $certificate): void - { - $this->certificate = $certificate; - } - public function getLogoUrl(): ?string { return $this->logoUrl; diff --git a/src/Surfnet/ServiceProviderDashboard/Application/CommandHandler/Entity/LoadMetadataCommandHandler.php b/src/Surfnet/ServiceProviderDashboard/Application/CommandHandler/Entity/LoadMetadataCommandHandler.php index 6646e3539..49fdde4e9 100644 --- a/src/Surfnet/ServiceProviderDashboard/Application/CommandHandler/Entity/LoadMetadataCommandHandler.php +++ b/src/Surfnet/ServiceProviderDashboard/Application/CommandHandler/Entity/LoadMetadataCommandHandler.php @@ -86,7 +86,6 @@ private function mapTextFields( 'descriptionNl' => ['getDescriptionNl', 'setDescriptionNl'], 'descriptionEn' => ['getDescriptionEn', 'setDescriptionEn'], 'applicationUrlEn' => ['getApplicationUrl', 'setApplicationUrl'], - 'certificate' => ['getCertificate', 'setCertificate'], ]; $this->map($map, $command, $metadata); diff --git a/src/Surfnet/ServiceProviderDashboard/Application/Factory/EntityDetailFactory.php b/src/Surfnet/ServiceProviderDashboard/Application/Factory/EntityDetailFactory.php index 65dd2ad85..4771fbbdc 100644 --- a/src/Surfnet/ServiceProviderDashboard/Application/Factory/EntityDetailFactory.php +++ b/src/Surfnet/ServiceProviderDashboard/Application/Factory/EntityDetailFactory.php @@ -81,7 +81,6 @@ public function buildFrom(ManageEntity $manageEntity): EntityDetail $manageEntity->getMetaData()->getAcsLocations(), $manageEntity->getMetaData()->getEntityId(), $manageEntity->getProtocol()->getProtocol(), - $manageEntity->getMetaData()->getCertData(), $logo, $manageEntity->getMetaData()->getNameNl(), $manageEntity->getMetaData()->getNameEn(), diff --git a/src/Surfnet/ServiceProviderDashboard/Application/Metadata/CertificateParserInterface.php b/src/Surfnet/ServiceProviderDashboard/Application/Metadata/CertificateParserInterface.php deleted file mode 100644 index eecc46141..000000000 --- a/src/Surfnet/ServiceProviderDashboard/Application/Metadata/CertificateParserInterface.php +++ /dev/null @@ -1,38 +0,0 @@ -getMetaData()->getNameIdFormat(); $metadata['coin:signature_method'] = 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256'; - $metadata = array_merge($metadata, $this->generateCertDataMetadata($entity)); // When publishing to production, the coin:exclude_from_push must be present and set to '1'. This prevents the // entity from being pushed to EngineBlock. Once the entity is checked a final time, the flag is set to 0 @@ -231,31 +230,6 @@ private function generateMetadataFields(ManageEntity $entity): array return $metadata; } - private function generateCertDataMetadata(ManageEntity $entity): array - { - $metadata = []; - if ($entity->getMetaData()->getCertData() !== null - && $entity->getMetaData()->getCertData() !== '' - && $entity->getMetaData()->getCertData() !== '0') { - $metadata['certData'] = $this->stripCertificateEnvelope( - $entity->getMetaData()->getCertData() - ); - } - - return $metadata; - } - - /** - * Strip header and footer from certificate data. - */ - private function stripCertificateEnvelope(string $certData): string - { - $certData = str_replace('-----BEGIN CERTIFICATE-----', '', $certData); - $certData = str_replace('-----END CERTIFICATE-----', '', $certData); - - return trim($certData); - } - private function generateAllContactsMetadata(ManageEntity $entity): array { $metadata = []; diff --git a/src/Surfnet/ServiceProviderDashboard/Application/Service/EntityMergeService.php b/src/Surfnet/ServiceProviderDashboard/Application/Service/EntityMergeService.php index 195c9b954..79dae2783 100644 --- a/src/Surfnet/ServiceProviderDashboard/Application/Service/EntityMergeService.php +++ b/src/Surfnet/ServiceProviderDashboard/Application/Service/EntityMergeService.php @@ -65,7 +65,6 @@ public function mergeEntityCommand( $command->getMetadataUrl(), $command->getAcsLocations(), $command->getNameIdFormat(), - $command->getCertificate(), $command->getDescriptionEn(), $command->getDescriptionNl(), $command->getNameEn(), diff --git a/src/Surfnet/ServiceProviderDashboard/Application/ViewObject/EntityDetail.php b/src/Surfnet/ServiceProviderDashboard/Application/ViewObject/EntityDetail.php index 5ec3eea07..0c120a414 100644 --- a/src/Surfnet/ServiceProviderDashboard/Application/ViewObject/EntityDetail.php +++ b/src/Surfnet/ServiceProviderDashboard/Application/ViewObject/EntityDetail.php @@ -41,7 +41,6 @@ public function __construct( private readonly array $acsLocations, private readonly string $entityId, private readonly string $protocol, - private readonly string $certificate, private readonly ?string $logoUrl, private readonly string $nameNl, private readonly string $nameEn, @@ -91,11 +90,6 @@ public function getEntityId(): string return $this->entityId; } - public function getCertificate(): string - { - return $this->certificate; - } - /** * @return string */ diff --git a/src/Surfnet/ServiceProviderDashboard/Domain/Entity/Entity/MetaData.php b/src/Surfnet/ServiceProviderDashboard/Domain/Entity/Entity/MetaData.php index eec0bc13a..9207a5a23 100644 --- a/src/Surfnet/ServiceProviderDashboard/Domain/Entity/Entity/MetaData.php +++ b/src/Surfnet/ServiceProviderDashboard/Domain/Entity/Entity/MetaData.php @@ -40,7 +40,6 @@ public static function fromApiResponse(array $data): self $metaDataUrl = $data['data']['metadataurl'] ?? ''; $acsLocations = self::getAcsLocationsFromMetaDataFields($metaDataFields); $nameIdFormat = $metaDataFields['NameIDFormat'] ?? ''; - $certData = $metaDataFields['certData'] ?? ''; $descriptionEn = $metaDataFields['description:en'] ?? ''; $descriptionNl = $metaDataFields['description:nl'] ?? ''; $nameEn = $metaDataFields['name:en'] ?? ''; @@ -50,7 +49,6 @@ public static function fromApiResponse(array $data): self Assert::string($metaDataUrl); Assert::allString($acsLocations); Assert::string($nameIdFormat); - Assert::string($certData); Assert::string($descriptionEn); Assert::string($descriptionNl); Assert::string($nameEn); @@ -74,7 +72,6 @@ public static function fromApiResponse(array $data): self $metaDataUrl, $acsLocations, $nameIdFormat, - $certData, $descriptionEn, $descriptionNl, $nameEn, @@ -94,7 +91,6 @@ public function __construct( private ?string $metaDataUrl, private ?array $acsLocations, private ?string $nameIdFormat, - private ?string $certData, private ?string $descriptionEn, private ?string $descriptionNl, private ?string $nameEn, @@ -131,11 +127,6 @@ public function getNameIdFormat(): ?string return $this->nameIdFormat; } - public function getCertData(): ?string - { - return $this->certData; - } - public function getDescriptionEn(): ?string { return $this->descriptionEn; @@ -186,7 +177,6 @@ public function merge(MetaData $metaData): void $this->metaDataUrl = is_null($metaData->getMetaDataUrl()) ? null : $metaData->getMetaDataUrl(); $this->acsLocations = is_null($metaData->getAcsLocations()) ? null : $metaData->getAcsLocations(); $this->nameIdFormat = is_null($metaData->getNameIdFormat()) ? null : $metaData->getNameIdFormat(); - $this->certData = is_null($metaData->getCertData()) ? null : $metaData->getCertData(); $this->descriptionEn = is_null($metaData->getDescriptionEn()) ? null : $metaData->getDescriptionEn(); $this->descriptionNl = is_null($metaData->getDescriptionNl()) ? null : $metaData->getDescriptionNl(); $this->nameEn = is_null($metaData->getNameEn()) ? null : $metaData->getNameEn(); @@ -228,7 +218,6 @@ public function asArray(): array 'entityid' => $this->getEntityId(), 'metadataurl' => $this->getMetaDataUrl(), 'metaDataFields.NameIDFormat' => $this->getNameIdFormat(), - 'metaDataFields.certData' => $this->getCertData(), 'metaDataFields.description:nl' => $this->getDescriptionNl(), 'metaDataFields.description:en' => $this->getDescriptionEn(), 'metaDataFields.name:nl' => $this->getNameNl(), diff --git a/src/Surfnet/ServiceProviderDashboard/Domain/ValueObject/Metadata.php b/src/Surfnet/ServiceProviderDashboard/Domain/ValueObject/Metadata.php index 788506663..e052db7c1 100644 --- a/src/Surfnet/ServiceProviderDashboard/Domain/ValueObject/Metadata.php +++ b/src/Surfnet/ServiceProviderDashboard/Domain/ValueObject/Metadata.php @@ -37,11 +37,6 @@ class Metadata */ public $entityId; - /** - * @var string - */ - public $certificate; - /** * @var string */ diff --git a/src/Surfnet/ServiceProviderDashboard/Infrastructure/DashboardBundle/Form/Entity/SamlEntityType.php b/src/Surfnet/ServiceProviderDashboard/Infrastructure/DashboardBundle/Form/Entity/SamlEntityType.php index 455ae6974..edb2f0fad 100644 --- a/src/Surfnet/ServiceProviderDashboard/Infrastructure/DashboardBundle/Form/Entity/SamlEntityType.php +++ b/src/Surfnet/ServiceProviderDashboard/Infrastructure/DashboardBundle/Form/Entity/SamlEntityType.php @@ -164,17 +164,6 @@ public function buildForm(FormBuilderInterface $builder, array $options): void ], ] ) - ->add( - 'certificate', - TextareaType::class, - [ - 'required' => false, - 'attr' => [ - 'data-help' => 'entity.edit.information.certificate', - 'rows' => 10, - ], - ] - ) ->add( 'logoUrl', TextType::class, diff --git a/src/Surfnet/ServiceProviderDashboard/Infrastructure/DashboardBundle/Resources/translations/messages.en.yml b/src/Surfnet/ServiceProviderDashboard/Infrastructure/DashboardBundle/Resources/translations/messages.en.yml index 44daad86d..922e8525a 100644 --- a/src/Surfnet/ServiceProviderDashboard/Infrastructure/DashboardBundle/Resources/translations/messages.en.yml +++ b/src/Surfnet/ServiceProviderDashboard/Infrastructure/DashboardBundle/Resources/translations/messages.en.yml @@ -59,7 +59,6 @@ entity: name_id_format: NameID format type_of_service: Type of service subject_type: Subject type - certificate: Certificate logo_url: Logo URL name_nl: Name NL description_nl: Description NL @@ -160,7 +159,7 @@ In the following pages we will ask you to submit the necessary information that
  • Various contacts responsible for the entity. Support, administrative and technical should be present.
  • Information about SAML 2.0 configuration.
  • -
  • Metadata information including URL, certificate and logo of your entity.
  • +
  • Metadata information including URL and logo of your entity.
  • A list of the attributes your Service Provider requires to operate.
  • @@ -228,7 +227,7 @@ In the following pages we will ask you to submit the necessary information that
  • Various contacts responsible for the entity. Support, administrative and technical should be present.
  • Information about SAML 2.0 configuration.
  • -
  • Metadata information including URL, certificate and logo of your entity.
  • +
  • Metadata information including URL and logo of your entity.
  • A list of the attributes your Service Provider requires to operate.
  • " @@ -243,7 +242,7 @@ In the following pages we will ask you to submit the necessary information that
  • Various contacts responsible for the entity. Support, administrative and technical should be present.
  • Information about SAML 2.0 configuration.
  • -
  • Metadata information including URL, certificate and logo of your entity.
  • +
  • Metadata information including URL and logo of your entity.
  • A list of the attributes your Service Provider requires to operate.
  • " @@ -258,7 +257,7 @@ In the following pages we will ask you to submit the necessary information that
  • Various contacts responsible for the entity. Support, administrative and technical should be present.
  • Information about SAML 2.0 configuration.
  • -
  • Metadata information including URL, certificate and logo of your entity.
  • +
  • Metadata information including URL and logo of your entity.
  • A list of the attributes your Service Provider requires to operate.
  • " @@ -354,7 +353,6 @@ entity.edit.information.resourceServers: Text should be set in web translations entity.edit.information.redirectUrls: Text should be set in web translations entity.edit.information.isPublicClient: Text should be set in web translations entity.edit.information.pastedMetadata: Text should be set in web translations -entity.edit.information.certificate: Text should be set in web translations entity.edit.information.logoUrl: Text should be set in web translations entity.edit.information.nameNl: Text should be set in web translations entity.edit.information.descriptionNl: Text should be set in web translations diff --git a/src/Surfnet/ServiceProviderDashboard/Infrastructure/DashboardBundle/Resources/translations/validators.en.yml b/src/Surfnet/ServiceProviderDashboard/Infrastructure/DashboardBundle/Resources/translations/validators.en.yml index 23e3a6a6b..2d0704b89 100644 --- a/src/Surfnet/ServiceProviderDashboard/Infrastructure/DashboardBundle/Resources/translations/validators.en.yml +++ b/src/Surfnet/ServiceProviderDashboard/Infrastructure/DashboardBundle/Resources/translations/validators.en.yml @@ -4,9 +4,6 @@ validator.attribute.at_least_one_attribute_required: 'At least one attribute mus validator.logo.wrong_type: 'Logo should be a PNG or GIF image.' validator.logo.not_an_image: 'Logo is not a valid image. Press question mark for details.' validator.logo.download_failed: 'The logo could not be downloaded to the server.' -validator.ssl_certificate.not_valid: 'The certificate is not valid.' -validator.ssl_certificate.unknown_key_length: 'Cannot determine key length.' -validator.ssl_certificate.wrong_key_length: 'Key length is %length% bit, it should be 2048 bit or more.' validator.entity_id.invalid_url: 'Invalid metadataUrl.' validator.entity_id.invalid_entity_id: 'Invalid entityId.' validator.entity_id.registry_failure: 'Failed checking registry.' diff --git a/src/Surfnet/ServiceProviderDashboard/Infrastructure/DashboardBundle/Validator/Constraints/ValidSSLCertificate.php b/src/Surfnet/ServiceProviderDashboard/Infrastructure/DashboardBundle/Validator/Constraints/ValidSSLCertificate.php deleted file mode 100644 index 8bfb68a08..000000000 --- a/src/Surfnet/ServiceProviderDashboard/Infrastructure/DashboardBundle/Validator/Constraints/ValidSSLCertificate.php +++ /dev/null @@ -1,28 +0,0 @@ -setCertificateEnvelope($value); - - $cert = openssl_x509_parse($value); - - if ($cert === false) { - $this->context->addViolation($constraint->message); - - return; - } - - openssl_x509_export($value, $cert, false); - - $matches = []; - if (!preg_match('~Public-Key: \((\d+) bit\)~', (string) $cert, $matches)) { - $this->context->addViolation('validator.ssl_certificate.unknown_key_length'); - - return; - } - - if ($matches[1] < 2048) { - $this->context->addViolation( - 'validator.ssl_certificate.wrong_key_length', - ['%length%' => $matches[1]] - ); - - return; - } - } - - private function setCertificateEnvelope($certData): string - { - $certData = $this->stripCertificateEnvelope($certData); - - return $this->addCertificateEnvelope($certData); - } - - private function stripCertificateEnvelope($certData): string - { - $certData = str_replace('-----BEGIN CERTIFICATE-----', '', (string) $certData); - $certData = str_replace('-----END CERTIFICATE-----', '', $certData); - - return trim($certData); - } - - private function addCertificateEnvelope(string $certData): string - { - return "-----BEGIN CERTIFICATE-----" . PHP_EOL . $certData . PHP_EOL . "-----END CERTIFICATE-----"; - } -} diff --git a/src/Surfnet/ServiceProviderDashboard/Infrastructure/Manage/Factory/SaveCommandFactory.php b/src/Surfnet/ServiceProviderDashboard/Infrastructure/Manage/Factory/SaveCommandFactory.php index 4feb4c7fe..0096a2654 100644 --- a/src/Surfnet/ServiceProviderDashboard/Infrastructure/Manage/Factory/SaveCommandFactory.php +++ b/src/Surfnet/ServiceProviderDashboard/Infrastructure/Manage/Factory/SaveCommandFactory.php @@ -58,7 +58,6 @@ public function buildSamlCommandByManageEntity( $command->setMetadataUrl($metaData->getMetaDataUrl()); $command->setAcsLocations($metaData->getAcsLocations()); $command->setEntityId($metaData->getEntityId()); - $command->setCertificate($metaData->getCertData()); $command->setLogoUrl($metaData->getLogo()->getUrl()); $command->setAdministrativeContact(Contact::from($metaData->getContacts()->findAdministrativeContact())); $command->setTechnicalContact(Contact::from($metaData->getContacts()->findTechnicalContact())); diff --git a/src/Surfnet/ServiceProviderDashboard/Legacy/Metadata/CertificateParser.php b/src/Surfnet/ServiceProviderDashboard/Legacy/Metadata/CertificateParser.php deleted file mode 100644 index 26a907f63..000000000 --- a/src/Surfnet/ServiceProviderDashboard/Legacy/Metadata/CertificateParser.php +++ /dev/null @@ -1,54 +0,0 @@ -parseAssertionConsumerService($descriptor, $metadata); $this->parseNameIdFormat($descriptor, $metadata); - if (property_exists($descriptor, 'KeyDescriptor') && $descriptor->KeyDescriptor !== null) { - $this->parseCertificate($descriptor, $metadata); - } - if (property_exists($descriptor, 'Extensions') && $descriptor->Extensions !== null) { $this->parseUi($descriptor, $metadata); } @@ -152,14 +146,6 @@ private function parseAssertionConsumerService(SimpleXMLElement $descriptor, Met } } - private function parseCertificate(SimpleXMLElement $descriptor, Metadata $metadata): void - { - foreach ($descriptor->KeyDescriptor->children(self::XMLDSIGNS) as $keyInfo) { - $metadata->certificate = $this->certParser->parse((string)$keyInfo->X509Data->X509Certificate); - break; - } - } - /** * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ diff --git a/templates/EntityDetail/detail.html.twig b/templates/EntityDetail/detail.html.twig index 7b05d9c2e..100163933 100644 --- a/templates/EntityDetail/detail.html.twig +++ b/templates/EntityDetail/detail.html.twig @@ -48,7 +48,6 @@ {% endif %} - {% include '@Dashboard/EntityDetail/detailFormattedField.html.twig' with {label: 'entity.detail.metadata.certificate'|trans, value: entity.certificate, informationPopup: 'entity.edit.information.certificate'} %} {% include '@Dashboard/EntityDetail/detailTextField.html.twig' with {label: 'entity.detail.metadata.logo_url'|trans, value: entity.logoUrl, informationPopup: 'entity.edit.information.logoUrl'} %} {% include '@Dashboard/EntityDetail/detailTextField.html.twig' with {label: 'entity.detail.metadata.name_nl'|trans, value: entity.nameNl, informationPopup: 'entity.edit.information.nameNl'} %} {% include '@Dashboard/EntityDetail/detailTextField.html.twig' with {label: 'entity.detail.metadata.description_nl'|trans, value: entity.descriptionNl, informationPopup: 'entity.edit.information.descriptionNl'} %} diff --git a/tests/integration/Infrastructure/DashboardBundle/Validator/Constraints/ValidSSLCertificateValidatorTest.php b/tests/integration/Infrastructure/DashboardBundle/Validator/Constraints/ValidSSLCertificateValidatorTest.php deleted file mode 100644 index f32833438..000000000 --- a/tests/integration/Infrastructure/DashboardBundle/Validator/Constraints/ValidSSLCertificateValidatorTest.php +++ /dev/null @@ -1,81 +0,0 @@ -validator->validate($cert, new ValidSSLCertificate()); - - $this->assertNoViolation(); - } - - public function test_key_without_envelope() - { - $cert = file_get_contents(__DIR__ . '/fixture/certificate_validator/certificate_without_envelope.cer'); - $this->validator->validate($cert, new ValidSSLCertificate()); - - $this->assertNoViolation(); - } - - public function test_empty_value() - { - $this->validator->validate(null, new ValidSSLCertificate()); - - $this->assertNoViolation(); - } - - public function test_invalid_key() - { - $constraint = new ValidSSLCertificate(); - - $cert = file_get_contents(__DIR__ . '/fixture/certificate_validator/invalid.cer'); - $this->validator->validate($cert, $constraint); - - $violations = $this->context->getViolations(); - - $this->assertNotEmpty($violations); - $this->assertEquals('validator.ssl_certificate.not_valid', $violations->get(0)->getMessageTemplate()); - } - - public function test_invalid_key_length() - { - $cert = file_get_contents(__DIR__ . '/fixture/certificate_validator/google.cer'); - $this->validator->validate($cert, new ValidSSLCertificate()); - - $violations = $this->context->getViolations(); - - $this->assertNotEmpty($violations); - $this->assertEquals( - 'validator.ssl_certificate.wrong_key_length', - $violations->get(0)->getMessageTemplate() - ); - } -} diff --git a/tests/unit/Application/Service/EntityMergeServiceTest.php b/tests/unit/Application/Service/EntityMergeServiceTest.php index 1e59ecf91..fc2163ae9 100644 --- a/tests/unit/Application/Service/EntityMergeServiceTest.php +++ b/tests/unit/Application/Service/EntityMergeServiceTest.php @@ -58,7 +58,6 @@ public function test_it_can_merge_saml_save_command_data_into_an_empty_manage_en self::assertNull($manageEntity->getId()); self::assertFalse($manageEntity->isManageEntity()); self::assertEquals('https://www.example.com', $manageEntity->getMetaData()->getEntityId()); - self::assertEquals('certdata', $manageEntity->getMetaData()->getCertData()); self::assertEquals('https://www.example.com/eula', $manageEntity->getMetaData()->getCoin()->getEula()); self::assertEquals($service, $manageEntity->getService()); self::assertEquals('Motivation', $manageEntity->getAttributes()->findByUrn('urn:mace:dir:attribute-def:uid')->getMotivation()); @@ -96,7 +95,6 @@ private function buildSamlCommand(Service $service): SaveSamlEntityCommand { $command = new SaveSamlEntityCommand(); $command->setEntityId('https://www.example.com'); - $command->setCertificate('certdata'); $command->setApplicationUrl('https://www.example.com'); $command->setEulaUrl('https://www.example.com/eula'); $attr = new Attribute(); diff --git a/tests/unit/Domain/Entity/Entity/MetaDataTest.php b/tests/unit/Domain/Entity/Entity/MetaDataTest.php index f1d34d172..470946c1b 100644 --- a/tests/unit/Domain/Entity/Entity/MetaDataTest.php +++ b/tests/unit/Domain/Entity/Entity/MetaDataTest.php @@ -169,7 +169,6 @@ public function test_it_can_merge_data(MetaData $metaData, MetaData $newData, Me self::assertEquals($expectation->getMetaDataUrl(), $metaData->getMetaDataUrl()); self::assertEquals($expectation->getAcsLocations(), $metaData->getAcsLocations()); self::assertEquals($expectation->getNameIdFormat(), $metaData->getNameIdFormat()); - self::assertEquals($expectation->getCertData(), $metaData->getCertData()); self::assertEquals($expectation->getDescriptionEn(), $metaData->getDescriptionEn()); self::assertEquals($expectation->getDescriptionNl(), $metaData->getDescriptionNl()); self::assertEquals($expectation->getNameEn(), $metaData->getNameEn()); @@ -180,7 +179,6 @@ public function test_it_can_merge_data(MetaData $metaData, MetaData $newData, Me self::assertNull($metaData->getMetaDataUrl()); self::assertNull($metaData->getAcsLocations()); self::assertNull($metaData->getNameIdFormat()); - self::assertNull($metaData->getCertData()); self::assertNull($metaData->getDescriptionEn()); self::assertNull($metaData->getDescriptionNl()); self::assertNull($metaData->getNameEn()); @@ -256,7 +254,6 @@ private function metaData(string $mode) 'https://www.example.org/metadata', ['https://www.example.org/consume-assertion'], 'nameIdFormat-transient', - 'certData', 'Description EN', 'Description NL', 'Name EN', @@ -272,7 +269,6 @@ private function metaData(string $mode) 'https://www.example.org/metadataB', ['https://www.example.org/consume-assertionB'], 'nameIdFormat-transientB', - 'certDataB', 'Description B EN', 'Description B NL', 'Name B EN', @@ -292,7 +288,6 @@ private function metaData(string $mode) null, null, null, - null, $contactList, $organization, $coin,