forked from BeSimple/BeSimpleSsoAuthBundle
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
55 changed files
with
1,005 additions
and
884 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
namespace BeSimple\SsoAuthBundle\DependencyInjection\Compiler; | ||
|
||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; | ||
|
||
/** | ||
* @author: Jean-François Simon <contact@jfsimon.fr> | ||
*/ | ||
class FactoryPass implements CompilerPassInterface | ||
{ | ||
/** | ||
* @param ContainerBuilder $container | ||
*/ | ||
public function process(ContainerBuilder $container) | ||
{ | ||
if (!$container->has('be_simple.sso_auth.factory')) { | ||
return; | ||
} | ||
|
||
$factoryBuilder = $container->getDefinition('be_simple.sso_auth.factory'); | ||
|
||
foreach ($container->findTaggedServiceIds('be_simple.sso_auth.protocol') as $id => $attributes) { | ||
$factoryBuilder->addMethodCall('addProtocol', array($attributes[0]['id'], $id)); | ||
} | ||
|
||
foreach ($container->findTaggedServiceIds('be_simple.sso_auth.server') as $id => $attributes) { | ||
$factoryBuilder->addMethodCall('addServer', array($attributes[0]['id'], $id)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
namespace BeSimple\SsoAuthBundle\Exception; | ||
|
||
/** | ||
* @author: Jean-François Simon <contact@jfsimon.fr> | ||
*/ | ||
class ConfigNotFoundException extends NotFoundException | ||
{ | ||
public function __construct($id, $code = null, $previous = null) | ||
{ | ||
parent::__construct('Config', $id, $code, $previous); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
namespace BeSimple\SsoAuthBundle\Exception; | ||
|
||
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException as BaseException; | ||
|
||
/** | ||
* @author: Jean-François Simon <contact@jfsimon.fr> | ||
*/ | ||
class InvalidConfigurationException extends BaseException | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
namespace BeSimple\SsoAuthBundle\Exception; | ||
|
||
/** | ||
* @author: Jean-François Simon <contact@jfsimon.fr> | ||
*/ | ||
class NotFoundException extends \InvalidArgumentException | ||
{ | ||
public function __construct($id, $subject = 'Service', $code = null, $previous = null) | ||
{ | ||
parent::__construct(sprintf('[BeSimpleSsoAuthBundle] %s "%s" is not defined.', $subject, $id), $code, $previous); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
namespace BeSimple\SsoAuthBundle\Exception; | ||
|
||
/** | ||
* @author: Jean-François Simon <contact@jfsimon.fr> | ||
*/ | ||
class ProtocolNotFoundException extends NotFoundException | ||
{ | ||
public function __construct($id, $code = null, $previous = null) | ||
{ | ||
parent::__construct('Protocol', $id, $code, $previous); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
namespace BeSimple\SsoAuthBundle\Exception; | ||
|
||
/** | ||
* @author: Jean-François Simon <contact@jfsimon.fr> | ||
*/ | ||
class ServerNotFoundException extends NotFoundException | ||
{ | ||
public function __construct($id, $code = null, $previous = null) | ||
{ | ||
parent::__construct('Server', $id, $code, $previous); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0" ?> | ||
|
||
<container xmlns="http://symfony.com/schema/dic/services" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> | ||
|
||
<parameters> | ||
<parameter key="be_simple.sso_auth.protocol.cas.class">BeSimple\SsoAuthBundle\Sso\Cas\Protocol</parameter> | ||
<parameter key="be_simple.sso_auth.server.cas.class">BeSimple\SsoAuthBundle\Sso\Cas\Server</parameter> | ||
</parameters> | ||
|
||
<services> | ||
<service id="be_simple.sso_auth.protocol.cas" class="%be_simple.sso_auth.protocol.cas.class%"> | ||
<tag name="be_simple.sso_auth.protocol" id="cas" /> | ||
</service> | ||
|
||
<service id="be_simple.sso_auth.server.cas" class="%be_simple.sso_auth.server.cas.class%"> | ||
<tag name="be_simple.sso_auth.server" id="cas" /> | ||
</service> | ||
</services> | ||
</container> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0" ?> | ||
|
||
<container xmlns="http://symfony.com/schema/dic/services" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> | ||
|
||
<parameters> | ||
<parameter key="be_simple.sso_auth.factory.class">BeSimple\SsoAuthBundle\Sso\Factory</parameter> | ||
<parameter key="be_simple.sso_auth.client.class">Buzz\Client\Client</parameter> | ||
</parameters> | ||
|
||
<services> | ||
<service id="be_simple.sso_auth.client" class="%be_simple.sso_auth.client.class%"> | ||
</service> | ||
|
||
<service id="be_simple.sso_auth.factory" class="%be_simple.sso_auth.factory.class%"> | ||
<argument type="service" id="service_container" /> | ||
<argument type="service" id="be_simple.sso_auth.client" /> | ||
</service> | ||
</services> | ||
</container> |
Oops, something went wrong.