WsseFactory::getKey()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Happyr\ApiBundle\DependencyInjection\Security\Factory;
4
5
use Symfony\Component\DependencyInjection\ChildDefinition;
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
use Symfony\Component\DependencyInjection\Reference;
8
use Symfony\Component\Config\Definition\Builder\NodeDefinition;
9
use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\SecurityFactoryInterface;
10
11
/**
12
 * Goes through the configuration and configures the WsseListener.
13
 *
14
 * @author Toby Ryuk
15
 */
16
class WsseFactory implements SecurityFactoryInterface
17
{
18
    /**
19
     * @param ContainerBuilder $container
20
     * @param int              $id
21
     * @param array            $config
22
     * @param string           $userProvider
23
     * @param string           $defaultEntryPoint
24
     *
25
     * @return array
26
     */
27
    public function create(ContainerBuilder $container, $id, $config, $userProvider, $defaultEntryPoint)
28
    {
29
        $providerId = 'security.authentication.provider.wsse.'.$id;
30
        $container
31
            ->setDefinition($providerId, new ChildDefinition('happyr_api.wsse.security.authentication.provider'))
32
            ->replaceArgument(0, new Reference($userProvider))
33
        ;
34
35
        $listenerId = 'security.authentication.listener.wsse.'.$id;
36
        $container->setDefinition($listenerId, new ChildDefinition('happyr_api.wsse.security.authentication.listener'));
37
38
        return [$providerId, $listenerId, $defaultEntryPoint];
39
    }
40
41
    /**
42
     * @return string
43
     */
44 1
    public function getPosition()
45
    {
46 1
        return 'pre_auth';
47
    }
48
49
    /**
50
     * @return string
51
     */
52
    public function getKey()
53
    {
54
        return 'wsse';
55
    }
56
57
    /**
58
     * @param NodeDefinition $node
59
     */
60
    public function addConfiguration(NodeDefinition $node)
61
    {
62
    }
63
}
64