<commit_before><?php

class EngineBlock_Corto_Module_Service_IdpsMetadata extends EngineBlock_Corto_Module_Service_Abstract
{
    public function serve($serviceName)
    {
        // See if an sp-entity-id was specified for which we need to use alternate keys (key rollover)
        try {
            // See if an sp-entity-id was specified for which we need to use alternate keys (key rollover)
            $alternateKeys = $this->_getAlternateKeys();
        } catch (EngineBlock_Corto_ProxyServer_UnknownRemoteEntityException $e) {
            $spEntityId = EngineBlock_ApplicationSingleton::getInstance()->getHttpRequest()->getQueryParameter('sp-entity-id');
            $this->_server->redirect(
                '/authentication/feedback/unknown-service-provider?entity-id=' . urlencode($spEntityId),
                "Unknown SP!");
            return;
        }
        if ($alternateKeys) {
            $entityDetails['certificates'] = $alternateKeys;
        }

        // Get the configuration for EngineBlock in it's IdP role.
        $entityDetails = $this->_getCurrentEntity('idpMetadataService');

        $idpEntities = array();
        foreach ($this->_server->getRemoteEntities() as $entityId => $entity) {
            // Don't add ourselves
            if ($entity['EntityID'] === $entityDetails['EntityID']) {
                continue;
            }

            // Only add entities that have a SSO service registered
            if (!isset($entity['SingleSignOnService'])) {
                continue;
            }
<commit_msg>Transparent metadata should use EB public key<commit_after><?php

class EngineBlock_Corto_Module_Service_IdpsMetadata extends EngineBlock_Corto_Module_Service_Abstract
{
    public function serve($serviceName)
    {
        // See if an sp-entity-id was specified for which we need to use alternate keys (key rollover)
        try {
            // See if an sp-entity-id was specified for which we need to use alternate keys (key rollover)
            $alternateKeys = $this->_getAlternateKeys();
        } catch (EngineBlock_Corto_ProxyServer_UnknownRemoteEntityException $e) {
            $spEntityId = EngineBlock_ApplicationSingleton::getInstance()->getHttpRequest()->getQueryParameter('sp-entity-id');
            $this->_server->redirect(
                '/authentication/feedback/unknown-service-provider?entity-id=' . urlencode($spEntityId),
                "Unknown SP!");
            return;
        }
        if ($alternateKeys) {
            $entityDetails['certificates'] = $alternateKeys;
        }

        // Get the configuration for EngineBlock in it's IdP role.
        $entityDetails = $this->_getCurrentEntity('idpMetadataService');

        $idpEntities = array();
        foreach ($this->_server->getRemoteEntities() as $entityId => $entity) {
            // Don't add ourselves
            if ($entity['EntityID'] === $entityDetails['EntityID']) {
                continue;
            }

            // Only add entities that have a SSO service registered
            if (!isset($entity['SingleSignOnService'])) {
                continue;
            }

            // Use EngineBlock certificates
            $entity['certificates'] = $entityDetails['certificates'];

{'fraction_non_alphanumeric': 0.10614008022215365, 'fraction_numerical': 0.0, 'mean_word_length': 2.423442449841605, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3016454', 'n_tokens_mistral': 820, 'n_tokens_neox': 802, 'n_words': 201}