• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

TYPO3GmbH / symfony-keycloak-bundle / 14440499152

14 Apr 2025 08:01AM UTC coverage: 4.425% (-0.3%) from 4.739%
14440499152

Pull #20

github

web-flow
Merge 27517d3b7 into 464b21466
Pull Request #20: [BUGFIX] Add logout event listener for SSO logout

0 of 22 new or added lines in 5 files covered. (0.0%)

10 of 226 relevant lines covered (4.42%)

9.45 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/DependencyInjection/T3GKeycloakExtension.php
1
<?php
2
declare(strict_types=1);
3

4
/*
5
 * This file is part of the package t3g/symfony-keycloak-bundle.
6
 *
7
 * For the full copyright and license information, please read the
8
 * LICENSE file that was distributed with this source code.
9
 */
10

11
namespace T3G\Bundle\Keycloak\DependencyInjection;
12

13
use Symfony\Component\Config\FileLocator;
14
use Symfony\Component\DependencyInjection\ContainerBuilder;
15
use Symfony\Component\DependencyInjection\Extension\Extension;
16
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
17
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
18

19
class T3GKeycloakExtension extends Extension implements PrependExtensionInterface
20
{
21
    public function getAlias(): string
22
    {
23
        return 't3g_keycloak';
×
24
    }
25

26
    public function load(array $configs, ContainerBuilder $container): void
27
    {
28
        $loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
×
29
        $loader->load('services.yaml');
×
30
    }
31

32
    public function prepend(ContainerBuilder $container): void
33
    {
34
        $configs = $container->getExtensionConfig($this->getAlias());
×
35
        $config = $this->processConfiguration(new Configuration(), $configs);
×
36

37
        $container->setParameter('t3g_keycloak.keycloak.user_provider_class', $config['keycloak']['user_provider_class']);
×
38
        $container->setParameter('t3g_keycloak.keycloak.default_roles', $config['keycloak']['default_roles']);
×
39
        $container->setParameter('t3g_keycloak.keycloak.role_mapping', $config['keycloak']['role_mapping']);
×
40
        $container->setParameter('t3g_keycloak.keycloak.clientId', $config['keycloak']['clientId']);
×
41
        $container->setParameter('t3g_keycloak.routes.authentication', $config['routes']['authentication']);
×
42
        $container->setParameter('t3g_keycloak.routes.success', $config['routes']['success']);
×
NEW
43
        $container->setParameter('t3g_keycloak.routes.logout_route', $config['routes']['logout_route']);
×
44

45
        if ($container->hasExtension($this->getAlias())) {
×
46
            $container->prependExtensionConfig($this->getAlias(), ['keycloak' => [], 'routes' => []]);
×
47
        }
48

49
        if ($container->hasExtension('knpu_oauth2_client')) {
×
50
            $container->prependExtensionConfig(
×
51
                'knpu_oauth2_client',
×
52
                [
×
53
                    'clients' => [
×
54
                        'keycloak' => [
×
55
                            'redirect_route' => '%t3g_keycloak.routes.authentication%',
×
56
                        ],
×
57
                    ],
×
58
                ]
×
59
            );
×
60
        }
61

62
        if ($container->hasExtension('httplug')) {
×
63
            $container->prependExtensionConfig(
×
64
                'httplug',
×
65
                [
×
66
                    'plugins' => [
×
67
                        'cache' => [
×
68
                            'cache_pool' => 'cache.app',
×
69
                            'config' => [
×
70
                                'default_ttl' => 1800
×
71
                            ]
×
72
                        ],
×
73
                        'retry' => [
×
74
                            'retry' => 1
×
75
                        ]
×
76
                    ],
×
77
                    'discovery' => [
×
78
                        'client' => 'auto'
×
79
                    ],
×
80
                    'clients' => [
×
81
                        'app' => [
×
82
                            'http_methods_client' => true,
×
83
                            'plugins' => ['httplug.plugin.content_length', 'httplug.plugin.redirect']
×
84
                        ],
×
85
                        'login_typo3_com' => [
×
86
                            'factory' => 'httplug.factory.curl',
×
87
                            'plugins' => ['httplug.plugin.cache']
×
88
                        ]
×
89
                    ],
×
90
                    'classes' => [
×
91
                        'message_factory' => 'Nyholm\Psr7\Factory\Psr17Factory',
×
92
                        'stream_factory' => 'Nyholm\Psr7\Factory\Psr17Factory',
×
93
                    ]
×
94
                ]
×
95
            );
×
96
        }
97
    }
98
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc