Skip to content

Fix deprecated SecurityContextInterface usage #315

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

Conversation

soullivaneuh
Copy link
Contributor

This PR fix deprecated SecurityContextInterface usage, introduce since Symfony 2.6.

Symfony 2.3+ BC kept.

@willdurand @stof Have you any suggestion of how handle it easily? Thanks.

@soullivaneuh
Copy link
Contributor Author

Tests added. Ready for review.

@@ -6,6 +6,7 @@

<parameters>
<parameter key="fos_oauth_server.security.authentication.provider.class">FOS\OAuthServerBundle\Security\Authentication\Provider\OAuthProvider</parameter>
<parameter key="fos_oauth_server.security.authentication.listener.legacy.class">FOS\OAuthServerBundle\Security\Firewall\LegacyOAuthListener</parameter>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please don't introduce any new class parameters, given that Symfony discourages this usage

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I'll put it directly on Symfony definition. I don't know that is discouraged also for external bundles.

@soullivaneuh
Copy link
Contributor Author

@stof I following your recommendation and take profit to remove all parameters classes on security.xml configuration file.

Thanks for your advice, this PR is now ready for review and merge.

@ghost
Copy link

ghost commented Jul 9, 2015

@soullivaneuh did you find out why the tests fail?

@soullivaneuh soullivaneuh force-pushed the security-context branch 2 times, most recently from cd72c3b to d2851ea Compare July 9, 2015 12:18
@soullivaneuh
Copy link
Contributor Author

Tests should be fixed. 👍

@soullivaneuh
Copy link
Contributor Author

Don't know for the lowest deps failling test, can't reproduce it on my local.

Any idea?

@soullivaneuh
Copy link
Contributor Author

@stof Could you please restart it?

@soullivaneuh
Copy link
Contributor Author

Seems to be an issue with php 5.3. Still investigating.

@soullivaneuh
Copy link
Contributor Author

Can't understand what happen. I got the same error on my local with PHP 5.3 but the ContainerBuilder class exists...

@sarcher
Copy link

sarcher commented Aug 19, 2015

I thought perhaps this error was due to the odd namespace (from a different bundle) on the new test. Tried to update this PR with it but looks like I can't do that. Maybe @soullivaneuh could do that and we'll see if it passes? Would be nice to get this merged in.

@soullivaneuh
Copy link
Contributor Author

Note: Test @sarcher commit: sarcher@89d96ef

@@ -16,6 +16,7 @@
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\DefinitionDecorator;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\HttpKernel\Kernel;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this use statement looks unused

@soullivaneuh soullivaneuh force-pushed the security-context branch 2 times, most recently from 76304be to cbca50a Compare August 20, 2015 08:21
@soullivaneuh
Copy link
Contributor Author

@stof Don't know why, but tests fail on php 5.3 becaue of symfony/dependency-injection 2.0.

I added a conflict to bump it to 2.1.

* @var \Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface
* @var TokenStorageInterface|SecurityContextInterface
*/
protected $tokenStorage;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please make the new property private. Using private visibility makes maintenance much easier, as we don't need to care about BC on them

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, will work on it.

BTW, if we don't want override, class should be final later. ;-)

@soullivaneuh
Copy link
Contributor Author

@stof review fixed.

@GuilhemN GuilhemN closed this Jan 13, 2016
@soullivaneuh
Copy link
Contributor Author

I'm sorry but why closing this @Ener-Getick?

@GuilhemN
Copy link
Member

I closed it in favor of #374 which fixes all compatibility issues with symfony 3.0 ;-)

@soullivaneuh
Copy link
Contributor Author

OK great. 👍

@soullivaneuh soullivaneuh deleted the security-context branch January 13, 2016 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants