Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Switched services to use opensky_ldap as first segment according to b…

…est practices
  • Loading branch information...
commit b155ae629fb4d85ddeb0ae90fb484c2f650eb015 1 parent fc3c2a2
@stof stof authored
View
6 DependencyInjection/OpenSkyLdapExtension.php
@@ -26,14 +26,14 @@ public function load(array $configs, ContainerBuilder $container)
$processor = new Processor();
$config = $processor->processConfiguration(new Configuration(), $configs);
- $container->setParameter('opensky.ldap.client.options', $config['client']);
+ $container->setParameter('opensky_ldap.client.options', $config['client']);
foreach(array('user_base_dn', 'user_filter', 'username_attribute', 'role_base_dn', 'role_filter', 'role_name_attribute', 'role_user_attribute') as $key) {
- $container->setParameter('opensky.ldap.user_manager.'.$key, $config[$key]);
+ $container->setParameter('opensky_ldap.user_manager.'.$key, $config[$key]);
}
foreach(array('role_prefix', 'default_roles') as $key) {
- $container->setParameter('opensky.ldap.user_provider.'.$key, $config['security'][$key]);
+ $container->setParameter('opensky_ldap.user_provider.'.$key, $config['security'][$key]);
}
}
View
6 DependencyInjection/Security/HttpBasicPreAuthenticatedFactory.php
@@ -7,7 +7,6 @@
use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\SecurityFactoryInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
-use Symfony\Component\DependencyInjection\Parameter;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\Config\Definition\Builder\NodeDefinition;
@@ -30,7 +29,7 @@ public function create(ContainerBuilder $container, $id, $config, $userProvider,
;
$listener = new Definition(
- new Parameter('security.authentication.listener.basic_pre_auth.class'),
+ '%opensky_ldap.authentication.listener.basic_pre_auth.class%',
array(
new Reference('security.context'),
new Reference('security.authentication.manager'),
@@ -38,8 +37,9 @@ public function create(ContainerBuilder $container, $id, $config, $userProvider,
new Reference('logger', ContainerBuilder::IGNORE_ON_INVALID_REFERENCE),
)
);
+ $listener->addTag('monolog.logger', array('channel' => 'security'));
- $listenerId = 'security.authentication.listener.basic_pre_auth.'.$id;
+ $listenerId = 'opensky_ldap.authentication.listener.basic_pre_auth.'.$id;
$container->setDefinition($listenerId, $listener);
return array($provider, $listenerId, $defaultEntryPoint);
View
58 Resources/config/ldap.xml
@@ -4,40 +4,40 @@
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<parameters>
- <parameter key="opensky.ldap.client.class">Zend\Ldap\Ldap</parameter>
- <parameter key="opensky.ldap.client.options" />
- <parameter key="opensky.ldap.user_manager.class">OpenSky\Bundle\LdapBundle\Security\User\LdapUserManager</parameter>
- <parameter key="opensky.ldap.user_manager.user_base_dn" />
- <parameter key="opensky.ldap.user_manager.user_filter" />
- <parameter key="opensky.ldap.user_manager.username_attribute" />
- <parameter key="opensky.ldap.user_manager.role_base_dn" />
- <parameter key="opensky.ldap.user_manager.role_filter" />
- <parameter key="opensky.ldap.user_manager.role_name_attribute" />
- <parameter key="opensky.ldap.user_manager.role_user_attribute" />
- <parameter key="opensky.ldap.user_provider.class">OpenSky\Bundle\LdapBundle\Security\User\LdapUserProvider</parameter>
- <parameter key="opensky.ldap.user_provider.role_prefix" />
- <parameter key="opensky.ldap.user_provider.default_roles" />
- <parameter key="security.authentication.listener.basic_pre_auth.class">OpenSky\Bundle\LdapBundle\Security\HttpBasicPreAuthenticatedListener</parameter>
+ <parameter key="opensky_ldap.client.class">Zend\Ldap\Ldap</parameter>
+ <parameter key="opensky_ldap.client.options" />
+ <parameter key="opensky_ldap.user_manager.class">OpenSky\Bundle\LdapBundle\Security\User\LdapUserManager</parameter>
+ <parameter key="opensky_ldap.user_manager.user_base_dn" />
+ <parameter key="opensky_ldap.user_manager.user_filter" />
+ <parameter key="opensky_ldap.user_manager.username_attribute" />
+ <parameter key="opensky_ldap.user_manager.role_base_dn" />
+ <parameter key="opensky_ldap.user_manager.role_filter" />
+ <parameter key="opensky_ldap.user_manager.role_name_attribute" />
+ <parameter key="opensky_ldap.user_manager.role_user_attribute" />
+ <parameter key="opensky_ldap.user_provider.class">OpenSky\Bundle\LdapBundle\Security\User\LdapUserProvider</parameter>
+ <parameter key="opensky_ldap.user_provider.role_prefix" />
+ <parameter key="opensky_ldap.user_provider.default_roles" />
+ <parameter key="opensky_ldap.authentication.listener.basic_pre_auth.class">OpenSky\Bundle\LdapBundle\Security\HttpBasicPreAuthenticatedListener</parameter>
</parameters>
<services>
- <service id="opensky.ldap.client" class="%opensky.ldap.client.class%" public="false">
- <argument>%opensky.ldap.client.options%</argument>
+ <service id="opensky_ldap.client" class="%opensky_ldap.client.class%" public="false">
+ <argument>%opensky_ldap.client.options%</argument>
</service>
- <service id="opensky.ldap.user_manager" class="%opensky.ldap.user_manager.class%">
- <argument type="service" id="opensky.ldap.client" />
- <argument>%opensky.ldap.user_manager.user_base_dn%</argument>
- <argument>%opensky.ldap.user_manager.user_filter%</argument>
- <argument>%opensky.ldap.user_manager.username_attribute%</argument>
- <argument>%opensky.ldap.user_manager.role_base_dn%</argument>
- <argument>%opensky.ldap.user_manager.role_filter%</argument>
- <argument>%opensky.ldap.user_manager.role_name_attribute%</argument>
- <argument>%opensky.ldap.user_manager.role_user_attribute%</argument>
+ <service id="opensky_ldap.user_manager" class="%opensky_ldap.user_manager.class%">
+ <argument type="service" id="opensky_ldap.client" />
+ <argument>%opensky_ldap.user_manager.user_base_dn%</argument>
+ <argument>%opensky_ldap.user_manager.user_filter%</argument>
+ <argument>%opensky_ldap.user_manager.username_attribute%</argument>
+ <argument>%opensky_ldap.user_manager.role_base_dn%</argument>
+ <argument>%opensky_ldap.user_manager.role_filter%</argument>
+ <argument>%opensky_ldap.user_manager.role_name_attribute%</argument>
+ <argument>%opensky_ldap.user_manager.role_user_attribute%</argument>
</service>
- <service id="opensky.ldap.user_provider" class="%opensky.ldap.user_provider.class%">
- <argument type="service" id="opensky.ldap.user_manager" />
- <argument>%opensky.ldap.user_provider.role_prefix%</argument>
- <argument>%opensky.ldap.user_provider.default_roles%</argument>
+ <service id="opensky_ldap.user_provider" class="%opensky_ldap.user_provider.class%">
+ <argument type="service" id="opensky_ldap.user_manager" />
+ <argument>%opensky_ldap.user_provider.role_prefix%</argument>
+ <argument>%opensky_ldap.user_provider.default_roles%</argument>
</service>
</services>
View
4 Resources/config/security_factories.xml
@@ -5,11 +5,11 @@
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<parameters>
- <parameter key="security.authentication.factory.basic_pre_auth.class">OpenSky\Bundle\LdapBundle\DependencyInjection\Security\HttpBasicPreAuthenticatedFactory</parameter>
+ <parameter key="opensky_ldap.authentication.factory.basic_pre_auth.class">OpenSky\Bundle\LdapBundle\DependencyInjection\Security\HttpBasicPreAuthenticatedFactory</parameter>
</parameters>
<services>
- <service id="security.authentication.factory.basic_pre_auth" class="%security.authentication.factory.basic_pre_auth.class%">
+ <service id="opensky_ldap.authentication.factory.basic_pre_auth" class="%opensky_ldap.authentication.factory.basic_pre_auth.class%">
<tag name="security.listener.factory" />
</service>
</services>
Please sign in to comment.
Something went wrong with that request. Please try again.