-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[2.2][Security] concurrent sessions #786
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
c0b33f8
added listener, strategy, registry, configuration for concurrent sess…
0f3d7c4
added SessionLogoutHandler to setup of ConcurrentSessionListener
e9bcd84
removed uneeded interface
9f4a52d
Merge branch 'master' of https://github.com/symfony/symfony
507befa
removed security.authentication.session_registry_storage service from…
5559ef8
removed unneeded methods
238606b
Merge branch 'master' of https://github.com/symfony/symfony
455197f
prepare Doctrine implementation of SessionRegistryStorage
a4eeae5
Merge branch 'master' of github.com:paschke/symfony
aadb2a7
default Doctrine implementation of SessionInformation
5b5edd8
Merge branch 'master' of https://github.com/symfony/symfony
33d83b4
removed SessionInformationIterator class
624b01f
forgot query condition
7032534
Merge branch 'master' of github.com:symfony/symfony
bc182f9
added DBAL default implementation of Symfony\Component\Security\Http\…
d0c826a
recreate SessionInformation if they were lost from the registry
c9f08a4
minor fixes
13813da
added listener, strategy, registry, configuration for concurrent sess…
8ef6923
added SessionLogoutHandler to setup of ConcurrentSessionListener
f4f0a8c
removed uneeded interface
e11a540
removed security.authentication.session_registry_storage service from…
a3d0a59
removed unneeded methods
c800408
prepare Doctrine implementation of SessionRegistryStorage
9c8bd21
default Doctrine implementation of SessionInformation
2efbf11
removed SessionInformationIterator class
3cb882c
forgot query condition
0aa9353
added DBAL default implementation of Symfony\Component\Security\Http\…
ff2122b
recreate SessionInformation if they were lost from the registry
efc783b
minor fixes
d302e37
Merge branch 'master' of http://github.com/paschke/symfony
bed28d2
moved DBAL implemention of SessionInformation to /Bridge
29e2f27
Merge branch 'master' of git://github.com/symfony/symfony
7a0f46a
use HttpUtils in ConcurrentSessionListener
ac7a1d6
removed @return void comments
b24a364
Merge branch 'master' of git://github.com/symfony/symfony
f7dfb3f
reacting to comments on PR 786
3cef9bb
reuse the instance level loader n src/Symfony/Bundle/SecurityBundle/D…
d567980
passing sessionStrategy into authenticationListenerFactories individu…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
added DBAL default implementation of Symfony\Component\Security\Http\…
…Session\SessionRegistryStorageInterface
- Loading branch information
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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
55 changes: 0 additions & 55 deletions
55
src/Symfony/Bundle/SecurityBundle/Doctrine/DoctrineSessionInformation.php
This file was deleted.
Oops, something went wrong.
84 changes: 0 additions & 84 deletions
84
src/Symfony/Bundle/SecurityBundle/Doctrine/DoctrineSessionRegistryStorage.php
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
25 changes: 25 additions & 0 deletions
25
src/Symfony/Bundle/SecurityBundle/Resources/config/security_session_registry.xml
This file contains hidden or 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,25 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<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="security.authentication.concurrent_session_strategy.class">Symfony\Component\Security\Http\Session\ConcurrentSessionControlStrategy</parameter> | ||
<parameter key="security.authentication.session_registry.class">Symfony\Component\Security\Http\Session\SessionRegistry</parameter> | ||
<parameter key="security.authentication.session_information.class">Symfony\Component\Security\Http\Session\SessionInformation</parameter> | ||
</parameters> | ||
|
||
<services> | ||
<service id="security.authentication.concurrent_session_strategy" class="%security.authentication.concurrent_session_strategy.class%" public="false"> | ||
<argument type="service" id="security.authentication.session_registry" /> | ||
<argument /> <!-- maximum Sessions --> | ||
<argument /> <!-- Strategy --> | ||
</service> | ||
|
||
<service id="security.authentication.session_registry" class="%security.authentication.session_registry.class%" public="false"> | ||
<argument type="service" id="security.authentication.session_registry_storage" /> | ||
<argument>%security.authentication.session_information.class%</argument> | ||
</service> | ||
</services> | ||
</container> |
25 changes: 25 additions & 0 deletions
25
src/Symfony/Bundle/SecurityBundle/Resources/config/security_session_registry_dbal.xml
This file contains hidden or 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,25 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<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="security.authentication.session_registry_storage.class">Symfony\Component\Security\Http\Session\Dbal\SessionRegistryStorage</parameter> | ||
<parameter key="security.authentication.session_information.class">Symfony\Component\Security\Http\Session\Dbal\DbalSessionInformation</parameter> | ||
</parameters> | ||
|
||
<services> | ||
<service id="security.session_registry.dbal.connection" alias="database_connection" /> | ||
|
||
|
||
<service id="security.authentication.session_registry_storage" class="%security.authentication.session_registry_storage.class%" public="true"> | ||
<argument type="service" id="security.session_registry.dbal.connection" /> | ||
<argument type="collection"> | ||
<argument key="session_information_table_name">%security.session_registry.dbal.session_information_table_name%</argument> | ||
<argument key="session_information_class_name">%security.authentication.session_information.class%</argument> | ||
</argument> | ||
</service> | ||
|
||
</services> | ||
</container> |
37 changes: 37 additions & 0 deletions
37
src/Symfony/Component/Security/Http/Session/Dbal/DbalSessionInformation.php
This file contains hidden or 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,37 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien.potencier@symfony-project.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Component\Security\Http\Session\Dbal; | ||
|
||
use Symfony\Component\Security\Http\Session\SessionInformation; | ||
|
||
/** | ||
* DbalSessionInformation. | ||
* | ||
* Allows to persist SessionInformation using Doctrine DBAL. | ||
* | ||
* @author Stefan Paschke <stefan.paschke@gmail.com> | ||
*/ | ||
class DbalSessionInformation extends SessionInformation | ||
{ | ||
public function __construct($sessionId, $username, \DateTime $lastRequest = null, \DateTime $expired = null) | ||
{ | ||
parent::__construct($sessionId, $username); | ||
|
||
if (null !== $lastRequest) { | ||
$this->setLastRequest($lastRequest); | ||
} | ||
|
||
if (null !== $expired) { | ||
$this->setExpired($expired); | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should pass the loader to the method instead of creating a new one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done