-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Custom Matcher #21944
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
Comments
Are you sure that this is related to the profiler configuration? I mean does the problem go away when you revert your changes to the profiler config? And if it is related, can you please show your implementation of the |
sure: app.super_admin_matcher:
class: AppBundle\Profiler\SuperAdminMatcher
arguments: ['@security.authorization_checker']
public: false SuperAdminMatcher.php: <?php
namespace AppBundle\Profiler;
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestMatcherInterface;
class SuperAdminMatcher implements RequestMatcherInterface{
protected $authorizationChecker;
public function __construct(AuthorizationCheckerInterface $authorizationChecker){
$this->authorizationChecker = $authorizationChecker;
}
public function matches(Request $request){
return $this->authorizationChecker->isGranted('ROLE_SUPER_ADMIN');
}
} |
Hello, I tested with Symfony 3.2.5 and FOSUser with a simple matcher: namespace AppBundle;
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestMatcherInterface;
class TestMatcher implements RequestMatcherInterface
{
protected $authorizationChecker;
public function __construct(AuthorizationCheckerInterface $authorizationChecker)
{
$this->authorizationChecker = $authorizationChecker;
}
public function matches(Request $request)
{
return $this->authorizationChecker->isGranted('ROLE_SUPER_ADMIN');
}
} I'm successfully logged with |
everything works before i did this. |
Here is the project I tested with. Can you run it to see if it's related to your system configuration ? # Commands to run after personalization of your parameters.yml
php bin/console doctrine:database:create
php bin/console doctrine:schema:update --force
php bin/console fos:user:create
php bin/console fos:user:promote You
php bin/console ca:cl --env=prod
php bin/console ser:run --env=prod
# Then go to /login to login |
i don't use fos ... |
Using FOS or not is not the point but this demonstrates that it works perfectly with user role data. Sorry, this is not a support forum. Feel free to give information about your problem on stack overflow so people can help you to solve it! (here is not the good place and we don't have any information that may help us to find what's your problem) |
but it's problem on symfony. issue with symfony |
@ben29 your problem sounds more related to how you implemented the matcher and not to symfony itself. If you want support for Symfony, go to stackoverflow or IRC channel. Symfony issues are used bugs in Symfony core, not to support. => http://symfony.com/support |
|
Well, without being able to reproduce your issue it will be hard to help you. Do you see anything else in the logs (either in the application logs, the web server's log or in the logs of PHP FPM)? Can you try to reproduce your issue on the Symfony Standard Edition and push such an example to GitHub? |
i did error_reporting i check few times on error log apache |
I try this on my computer:
i put memmory limit to php 512MB! the wired thing.
it's shows dead... try anothr thing:
it's stuck doing:
works! try also ROLE_ADMIN |
my security.yml
|
login : so only the problem it's on thanks! |
@xabbuh - see all the comment i did big debug |
Can you show your complete security config? |
yes:
|
i get the problem!!! why it's give :
just beacuse this option ? |
so the bug happen when i enable use_foward |
@ben29 thanks for all the debugging that you did and thanks to all the reviewers for your help. So, in summary, if you use the |
Is someone able to fork the Symfony Standard Edition, and make these changes so that we can reproduce the issue and investigate how to fix it? |
@javiereguiluz yea it's goes to out of memory just when i set this setting. |
any update about that? |
I didn't have the time to create a custom project that reproduces the issue to find out what exactly causes the issue. That's why I asked for a fork of the Symfony Standard Edition that makes this easier to reproduce and focus on investigating how to fix it (and the same applies to any other contributor who is willing to work on a patch). |
Hello, actually i think the problem comes from that The solution would be not calling the matches method when we're on these urls in if (null !== $this->matcher && !preg_match('/(_(profiler|wdt|error))/', $route) && !$this->matcher->matches($request)) {
return;
} On the other hand i didn't manage to reproduce the out of memory error, but it could be related. Here is a repo to reproduce the problem i am talking about : help this works |
any update? |
Actually, we now are thinking about removing the entire "matcher" feature from the profiler. See #24077 If we finally do that, we'll need to close this as 2won't fix". So let's wait a bit. Thanks! |
trying to do:
http://symfony.com/doc/current/profiler/matchers.html
when trying to logout on my website.
i'm getting
also i try on last symfony 3.2.5
still not work
The text was updated successfully, but these errors were encountered: