Adjust TYPO3.Flow.security.authentication.providers.<providerName>.requestPatterns syntax

@param array $configuration
@return void
356785
public function processFirewallFilters(array &$configuration)
    {
        if (!isset($configuration['TYPO3']['Flow']['security']['firewall']['filters'])) {
            return;
        }
        $filtersConfiguration = &$configuration['TYPO3']['Flow']['security']['firewall']['filters'];
        foreach ($filtersConfiguration as $filterIndex => &$filterOptions) {
            // already converted?
            if (isset($filterOptions['pattern']) || !isset($filterOptions['patternType'])) {
                continue;
            }
            $patternValue = isset($filterOptions['patternValue']) ? $filterOptions['patternValue'] : '';

            switch (strtolower($filterOptions['patternType'])) {
                case 'controllerobjectname':
                    $patternClassName = ControllerObjectName::class;
                    $filterOptions['pattern'] = 'ControllerObjectName';
                    $filterOptions['patternOptions'] = ['controllerObjectNamePattern' => $patternValue];
                    break;
                case 'csrfprotection':
                    $patternClassName = CsrfProtection::class;
                    $filterOptions['pattern'] = 'CsrfProtection';
                    break;
                case 'host':
                    $patternClassName = Host::class;
                    $filterOptions['pattern'] = 'Host';
                    $filterOptions['patternOptions'] = ['hostPattern' => $patternValue];
                    break;
                case 'ip':
                    $patternClassName = Ip::class;
                    $filterOptions['pattern'] = 'Ip';
                    $filterOptions['patternOptions'] = ['cidrPattern' => $patternValue];
                    break;
                case 'uri':
                    $patternClassName = Uri::class;
                    $filterOptions['pattern'] = 'Uri';
                    $filterOptions['patternOptions'] = ['uriPattern' => $patternValue];
                    break;
                default:
                    $this->showWarning(sprintf('Could not automatically convert the syntax of the custom firewall filter "%s". Please adjust it manually as described in the documentation.', $filterOptions['patternType']));
                    $patternClassName = $filterOptions['patternType'];
            }
            if (isset($filterOptions['pattern'])) {
                unset($filterOptions['patternType'], $filterOptions['patternValue']);
            }
            if (is_numeric($filterIndex)) {
                $patternIdentifier = $this->targetPackageData['packageKey'] . ':' . $this->getShortClassName($patternClassName);
                $uniquePatternIdentifier = $patternIdentifier;
                $loopCounter = 1;
                while (isset($filtersConfiguration[$uniquePatternIdentifier])) {
                    $uniquePatternIdentifier = $patternIdentifier . '_' . (++ $loopCounter);
                }
                unset($filtersConfiguration[$filterIndex]);
                $filtersConfiguration[$uniquePatternIdentifier] = $filterOptions;
            }
            $this->showNote(sprintf('Adjusted configuration syntax of the "%s" firewall filter.', $patternClassName));
        }
    }
59718
public function processAcls(array &$configuration)
    {
        if (!isset($configuration['acls'])) {
            return;
        }
        $newRolesConfiguration = isset($configuration['roles']) ? $configuration['roles'] : array();
        foreach ($configuration['acls'] as $roleIdentifier => $aclConfiguration) {
            $roleIdentifier = $this->expandRoleIdentifier($roleIdentifier);
            if (!isset($newRolesConfiguration[$roleIdentifier])) {
                $newRolesConfiguration[$roleIdentifier] = array();
            }
            if (!isset($newRolesConfiguration[$roleIdentifier]['privileges'])) {
                $newRolesConfiguration[$roleIdentifier]['privileges'] = array();
            }
            foreach ($aclConfiguration as $resourceType => $permissions) {
                if ($resourceType !== 'methods' && $resourceType !== 'entities') {
                    $this->showWarning('Resource type "' . $resourceType . '" is not supported...');
                    continue;
                }
                foreach ($permissions as $resourceName => $permission) {
                    $newRolesConfiguration[$roleIdentifier]['privileges'][] = array('privilegeTarget' => $resourceName, 'permission' => $permission);
                }
            }
        }
        unset($configuration['acls']);
        $configuration['roles'] = $newRolesConfiguration;
    }
990401
protected function sanitize(array $configuration)
    {
        foreach ($configuration as $key => $config) {
            if (null === $config['name']) {
                $configuration[$key]['name'] = $this->defaultRouteName($key);
            }
            if (null === $config['path']) {
                $configuration[$key]['path'] = $this->defaultRoutePath($key);
            }
            if (null === $config['api_name']) {
                $configuration[$key]['api_name'] = $this->defaultApiRouteName($key);
            }
            if (null === $config['api_path']) {
                $configuration[$key]['api_path'] = $this->defaultApiRoutePath($key);
            }
        }

        return $configuration;
    }
1270844
private function parseConfiguration(array $configuration = array())
    {
        $configToPropertyMap = array(
            'identifier' => 'applicationKey',
            'expiration' => 'applicationExpiration',
            'name' => 'applicationName',
            'scope' => 'applicationScope',
        );

        foreach ($configToPropertyMap as $config => $property) {
            if (isset($configuration[$config])) {
                $this->$property = $configuration[$config];
            }
        }
    }
1109689
protected function executeAll(array $configuration, &$context)
    {
        $parameters = $this->confHelper->resolve($configuration[self::CONF_PARAMETERS], $context);
        $sql = $this->confHelper->resolve($configuration[self::CONF_SQL], $context);

        $results = [];

        foreach ($parameters as $params) {
            $params = $this->prepareParameters($params);
            $results[] = $this->performQuery($configuration, $context, $params, $sql);
        }

        return $results;
    }
248121
private function addDefaultRightMenu(array &$configuration)
    {
        if (!$this->applicationConfiguration->getParameter('enable_menus')) {
            return;
        }

        if (!key_exists('list', $configuration['actions'])) {
            return;
        }

        if (
            key_exists('menus', $configuration['actions']['list']) &&
            is_array($configuration['actions']['list']['menus']) &&
            key_exists('right', $configuration['actions']['list']['menus'])
        ) {
            return;
        }

        $configuration['actions']['list']['menus']['right'] = [];
    }
8940
protected function includeConfiguration($configuration)
    {
        if (file_exists($configuration)) {
            $callable = include $configuration;
            if (is_callable($callable)) {
                call_user_func($callable, $this->eventEmitter);
            }
        }

        return true;
    }
884092
private function applyMiddleware(array $configuration): array
    {
        foreach ($this->middlewares as $middleware) {
            $configuration = $middleware($configuration);
        }

        return $configuration;
    }
123565
public static function enable($configuration = array())
	{
		self::setConfiguration($configuration);

		if (!self::initialize()) {
			return;
		}

		error_reporting(self::$configuration->getErrorReportingLevel());
	}
746613
protected function sanitizeConfiguration(array $configuration)
    {
        // Removing configuration of fields which do not exist for this form.
        $sanitizedFieldsConfiguration = [];
        $fieldsConfiguration = (isset($configuration['fields']))
            ? $configuration['fields']
            : [];

        foreach ($this->formObject->getProperties() as $property) {
            $sanitizedFieldsConfiguration[$property] = (isset($fieldsConfiguration[$property]))
                ? $fieldsConfiguration[$property]
                : [];
        }

        $configuration['fields'] = $sanitizedFieldsConfiguration;

        return $configuration;
    }
297358
public function setConfiguration(array $configuration): void
    {
        if ($this->frozen) {
            throw new Exception('The application configuration is already defined');
        }
        $this->configuration = $this->createApplicationConfiguration($configuration);
        $this->frozen = true;
    }
475695
public function setConfiguration(Reader $configuration): void
    {
        $this->configuration = $configuration;
        $this->configEntities = $configuration->getConfigValues()['entities'];
        $this->initFaker();
    }
423317
private function initPatternProperties(array $specification)
    {
        if (isset($specification[self::PATTERN_PROPERTIES_INDEX])) {
            $this->setPatternProperties($specification[self::PATTERN_PROPERTIES_INDEX]);
        }
    }
153098
protected function mapIconNames(array &$configuration)
    {
        if (isset($configuration['ui']['icon'])) {
            $configuration['ui']['icon'] = $this->iconNameMappingService->convert($configuration['ui']['icon']);
        }

        $inspectorConfiguration = Arrays::getValueByPath($configuration, 'ui.inspector');
        if (is_array($inspectorConfiguration)) {
            foreach ($inspectorConfiguration as $elementTypeName => $elementTypeItems) {
                foreach ($elementTypeItems as $elementName => $elementConfiguration) {
                    if (isset($inspectorConfiguration[$elementTypeName][$elementName]['icon'])) {
                        $configuration['ui']['inspector'][$elementTypeName][$elementName]['icon'] = $this->iconNameMappingService->convert($inspectorConfiguration[$elementTypeName][$elementName]['icon']);
                    }
                }
            }
        }
    }
1125066
protected function setCommandTimeout(array $configuration)
    {
        if (isset($configuration[static::CONFIG_COMMAND_TIMEOUT])) {
            $this->configuration->setCommandTimeout($configuration[static::CONFIG_COMMAND_TIMEOUT]);
        }
    }
40700
protected function processConfigurationTraitORM(&$configuration)
    {
        //check parameters
        if(!isset($configuration['subjects'][$this->name]['ORM'])) {
            throw new \Exception(sprintf('missing ORM parameters into %s subject configuration', $this->name));
        } else {
            $parameters = ['table', 'view', 'primaryKey'];
            foreach($parameters as $parameter) {
                if(!isset($configuration['subjects'][$this->name]['ORM'][$parameter]) || !$configuration['subjects'][$this->name]['ORM'][$parameter]) {
                    throw new \Exception(sprintf('missing %s ORM parameters into %s subject configuration', $parameter, $this->name));
                }
            }
            $this->setORMParameters($configuration['subjects'][$this->name]['ORM']['table'], $configuration['subjects'][$this->name]['ORM']['view'], $configuration['subjects'][$this->name]['ORM']['primaryKey']);
        }
    }
1241857
public function write($configuration)
    {
        $ht = $this->getHTaccessFilename();
        $fs = $this->getFilesystem();
        if (@$fs->put($ht, $configuration) === false) {
            throw new Exception("Failed to write to file $ht");
        }
    }