<commit_before><?php

/*
 * This file is part of vaibhavpandeyvpz/silex-skeleton package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.md.
 */

return [
    'security.access_rules' => [
        [ '^/app/users/', 'ROLE_ADMIN' ],
        [ '^/app/', 'ROLE_USER' ],
    ],
    'security.authentication.logout_handler.app' => function ($app) {
        $handler = new App\Security\LogoutSuccessHandler(
            $app['security.http_utils'],
            $app['security.firewalls']['app']['logout']['target_url']
        );
        $handler->setContainer($app);
        return $handler;
    },
    'security.authentication.success_handler.app' => function ($app) {
        $handler = new App\Security\AuthenticationSuccessHandler(
            $app['security.http_utils'],
            $app['security.firewalls']['app']['form']
        );
        $handler->setContainer($app);
        $handler->setProviderKey('app');
        return $handler;
    },
    'security.firewalls' => [
        'app' => [
            'form' => [
                'check_path' => '/app/login',
                'login_path' => '/login',
                'always_use_default_target_path' => true,
                'default_target_path' => '/app/'
            ],
            'logout' => [
                'invalidate_session' => false,
                'logout_path' => '/app/logout',
                'target_url' => '/login'
            ],
            'pattern' => '^/app/',
            'remember_me' => [ 'key' => getenv('SECURITY_KEY') ],
            'users' => function ($app) {
                return new App\Security\UserProvider($app['em']);
            },
        ],
    ],
    'security.role_hierarchy' => [
        'ROLE_ADMIN' => [ 'ROLE_USER', 'ROLE_ALLOWED_TO_SWITCH' ]
    ],
];
<commit_msg>fixing unauthorized access in security config<commit_after><?php

/*
 * This file is part of vaibhavpandeyvpz/silex-skeleton package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.md.
 */

return [
    'security.access_rules' => [
        [ '^/app/users', 'ROLE_ADMIN' ],
        [ '^/app/', 'ROLE_USER' ],
    ],
    'security.authentication.logout_handler.app' => function ($app) {
        $handler = new App\Security\LogoutSuccessHandler(
            $app['security.http_utils'],
            $app['security.firewalls']['app']['logout']['target_url']
        );
        $handler->setContainer($app);
        return $handler;
    },
    'security.authentication.success_handler.app' => function ($app) {
        $handler = new App\Security\AuthenticationSuccessHandler(
            $app['security.http_utils'],
            $app['security.firewalls']['app']['form']
        );
        $handler->setContainer($app);
        $handler->setProviderKey('app');
        return $handler;
    },
    'security.firewalls' => [
        'app' => [
            'form' => [
                'check_path' => '/app/login',
                'login_path' => '/login',
                'always_use_default_target_path' => true,
                'default_target_path' => '/app/'
            ],
            'logout' => [
                'invalidate_session' => false,
                'logout_path' => '/app/logout',
                'target_url' => '/login'
            ],
            'pattern' => '^/app/',
            'remember_me' => [ 'key' => getenv('SECURITY_KEY') ],
            'users' => function ($app) {
                return new App\Security\UserProvider($app['em']);
            },
        ],
    ],
    'security.role_hierarchy' => [
        'ROLE_ADMIN' => [ 'ROLE_USER', 'ROLE_ALLOWED_TO_SWITCH' ]
    ],
];

{'fraction_non_alphanumeric': 0.16892790635807395, 'fraction_numerical': 0.0, 'mean_word_length': 1.9723320158102766, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 55, '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': '7452466', 'n_tokens_mistral': 1159, 'n_tokens_neox': 1137, 'n_words': 191}