<commit_before><?php

declare(strict_types=1);

/*
 * The MIT License (MIT)
 *
 * Copyright (c) 2014-2018 Spomky-Labs
 *
 * This software may be modified and distributed under the terms
 * of the MIT license.  See the LICENSE file for details.
 */

use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use OAuth2Framework\Component\OpenIdConnect\UserInfoEndpoint\UserInfoEndpoint;
use OAuth2Framework\Component\OpenIdConnect\IdTokenBuilderFactory;
use OAuth2Framework\Component\Core\UserAccount\UserAccountRepository;
use OAuth2Framework\Component\Core\Middleware\Pipe;
use OAuth2Framework\Component\OpenIdConnect\Rule\UserinfoEndpointAlgorithmsRule;
use function Symfony\Component\DependencyInjection\Loader\Configurator\ref;

return function (ContainerConfigurator $container) {
    $container = $container->services()->defaults()
        ->private()
        ->autoconfigure();

    $container->set(UserInfoEndpoint::class)
        ->args([
            ref(IdTokenBuilderFactory::class),
            ref('oauth2_server.client.repository'),
            ref(UserAccountRepository::class),
            ref('httplug.message_factory'),
        ]);

    $container->set('userinfo_security_middleware')
        ->class(\OAuth2Framework\Component\Core\Middleware\AccessTokenMiddleware::class)
        ->args([
            ref(\OAuth2Framework\Component\Core\TokenType\TokenTypeManager::class),
            ref(\OAuth2Framework\Component\Core\AccessToken\AccessTokenHandlerManager::class),
        ]);

    $container->set('oauth2_server_userinfo_pipe')
        ->class(Pipe::class)
        ->args([
            ref('userinfo_security_middleware'),
            ref('userinfo_security_middleware'),
            ref(UserInfoEndpoint::class),
        ]);
<commit_msg>Userinfo Endpoint<commit_after><?php

declare(strict_types=1);

/*
 * The MIT License (MIT)
 *
 * Copyright (c) 2014-2018 Spomky-Labs
 *
 * This software may be modified and distributed under the terms
 * of the MIT license.  See the LICENSE file for details.
 */

use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use OAuth2Framework\Component\OpenIdConnect\UserInfoEndpoint\UserInfoEndpoint;
use OAuth2Framework\Component\OpenIdConnect\IdTokenBuilderFactory;
use OAuth2Framework\Component\Core\UserAccount\UserAccountRepository;
use OAuth2Framework\Component\Core\Middleware\Pipe;
use OAuth2Framework\Component\OpenIdConnect\Rule\UserinfoEndpointAlgorithmsRule;
use function Symfony\Component\DependencyInjection\Loader\Configurator\ref;

return function (ContainerConfigurator $container) {
    $container = $container->services()->defaults()
        ->private()
        ->autoconfigure();

    $container->set(UserInfoEndpoint::class)
        ->args([
            ref(IdTokenBuilderFactory::class),
            ref('oauth2_server.client.repository'),
            ref(UserAccountRepository::class),
            ref('httplug.message_factory'),
        ]);

    $container->set('userinfo_security_middleware')
        ->class(\OAuth2Framework\Component\Core\Middleware\AccessTokenMiddleware::class)
        ->args([
            ref(\OAuth2Framework\Component\Core\TokenType\TokenTypeManager::class),
            ref(\OAuth2Framework\Component\Core\AccessToken\AccessTokenHandlerManager::class),
        ]);

    $container->set('oauth2_server_userinfo_pipe')
        ->class(Pipe::class)
        ->args([
            ref('userinfo_security_middleware'),
            ref('userinfo_security_middleware'),
            ref(UserInfoEndpoint::class),
        ])
        ->tag('controller.service_arguments');

{'fraction_non_alphanumeric': 0.11438809261300992, 'fraction_numerical': 0.010474090407938258, 'mean_word_length': 3.85809906291834, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 28, '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': '3524129', 'n_tokens_mistral': 999, 'n_tokens_neox': 984, 'n_words': 142}