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

TYPO3GmbH / symfony-keycloak-bundle / 14438360102

14 Apr 2025 05:44AM UTC coverage: 4.386% (-0.4%) from 4.739%
14438360102

Pull #20

github

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

0 of 21 new or added lines in 3 files covered. (0.0%)

2 existing lines in 1 file now uncovered.

10 of 228 relevant lines covered (4.39%)

9.36 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']);
×
43

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

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

UNCOV
61
        if ($container->hasExtension('httplug')) {
×
62
            $container->prependExtensionConfig(
×
63
                'httplug',
×
64
                [
×
65
                    'plugins' => [
×
66
                        'cache' => [
×
67
                            'cache_pool' => 'cache.app',
×
68
                            'config' => [
×
69
                                'default_ttl' => 1800
×
70
                            ]
×
71
                        ],
×
72
                        'retry' => [
×
73
                            'retry' => 1
×
74
                        ]
×
75
                    ],
×
76
                    'discovery' => [
×
77
                        'client' => 'auto'
×
78
                    ],
×
79
                    'clients' => [
×
80
                        'app' => [
×
81
                            'http_methods_client' => true,
×
82
                            'plugins' => ['httplug.plugin.content_length', 'httplug.plugin.redirect']
×
83
                        ],
×
84
                        'login_typo3_com' => [
×
85
                            'factory' => 'httplug.factory.curl',
×
86
                            'plugins' => ['httplug.plugin.cache']
×
87
                        ]
×
88
                    ],
×
89
                    'classes' => [
×
90
                        'message_factory' => 'Nyholm\Psr7\Factory\Psr17Factory',
×
91
                        'stream_factory' => 'Nyholm\Psr7\Factory\Psr17Factory',
×
92
                    ]
×
93
                ]
×
94
            );
×
95
        }
96
    }
97
}
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