Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[HttpKernel] Fix handling ofMapRequest* attributes#50125

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
chalasr merged 1 commit intosymfony:6.3fromnicolas-grekas:hk-map-req
May 2, 2023

Conversation

@nicolas-grekas
Copy link
Member

QA
Branch?6.3
Bug fix?yes
New feature?no
Deprecations?no
TicketsFix#50120
LicenseMIT
Doc PR-

@artyuum
Copy link
Contributor

@nicolas-grekas I cloned your repo, checked out your branch and used thelink script to copy that specific version of Symfony into a working Sf project and I'm having the following error (even after nuking the cache):

Attempted to call an undefined method named "onKernelControllerArguments" of class "Symfony\Component\HttpKernel\Controller\ArgumentResolver\TraceableValueResolver".

Stacktrace
Symfony\Component\ErrorHandler\Error\UndefinedMethodError:Attempted to call an undefined method named "onKernelControllerArguments" of class "Symfony\Component\HttpKernel\Controller\ArgumentResolver\TraceableValueResolver".  at /var/www/html/test/vendor/symfony/event-dispatcher/Debug/WrappedListener.php:116  at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke()     (/var/www/html/test/vendor/symfony/event-dispatcher/EventDispatcher.php:220)  at Symfony\Component\EventDispatcher\EventDispatcher->callListeners()     (/var/www/html/test/vendor/symfony/event-dispatcher/EventDispatcher.php:56)  at Symfony\Component\EventDispatcher\EventDispatcher->dispatch()     (/var/www/html/test/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:139)  at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch()     (/var/www/html/test/vendor/symfony/http-kernel/HttpKernel.php:161)  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()     (/var/www/html/test/vendor/symfony/http-kernel/HttpKernel.php:74)  at Symfony\Component\HttpKernel\HttpKernel->handle()     (/var/www/html/test/vendor/symfony/http-kernel/EventListener/ErrorListener.php:108)  at Symfony\Component\HttpKernel\EventListener\ErrorListener->onKernelException()     (/var/www/html/test/vendor/symfony/event-dispatcher/Debug/WrappedListener.php:116)  at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke()     (/var/www/html/test/vendor/symfony/event-dispatcher/EventDispatcher.php:220)  at Symfony\Component\EventDispatcher\EventDispatcher->callListeners()     (/var/www/html/test/vendor/symfony/event-dispatcher/EventDispatcher.php:56)  at Symfony\Component\EventDispatcher\EventDispatcher->dispatch()     (/var/www/html/test/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:139)  at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch()     (/var/www/html/test/vendor/symfony/http-kernel/HttpKernel.php:224)  at Symfony\Component\HttpKernel\HttpKernel->handleThrowable()     (/var/www/html/test/vendor/symfony/http-kernel/HttpKernel.php:117)  at Symfony\Component\HttpKernel\HttpKernel->terminateWithException()     (/var/www/html/test/vendor/symfony/http-kernel/EventListener/DebugHandlersListener.php:74)  at Symfony\Component\HttpKernel\EventListener\DebugHandlersListener::Symfony\Component\HttpKernel\EventListener\{closure}()     (/var/www/html/test/vendor/symfony/error-handler/ErrorHandler.php:537)  at Symfony\Component\ErrorHandler\ErrorHandler->handleException()

Do you have the same error?

@nicolas-grekas
Copy link
MemberAuthor

Yes, I do. This should now be fixed. Can you please try again?

@artyuum
Copy link
Contributor

@nicolas-grekas it works. I commented on the issue.

@Koc
Copy link
Contributor

Koc commentedApr 23, 2023

We should be careful with usage of the payload as Subject from Controller Arguments in#[IsGranted Attribute

Copy link
MemberAuthor

@nicolas-grekasnicolas-grekas left a comment
edited
Loading

Choose a reason for hiding this comment

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

We should be careful with usage of the payload as Subject from Controller Arguments in [#IsGranted Attribute

Accessing unserialized payloads in#[IsGranted] directly contradicts the expectations described in#50120: the expectation there is that a payload shouldn't be parsed if we can rule out access to some route before said parsing happens, which makes sense to me.

One way to solve this would be to allow registering an IsGranted attribute for late evaluation, aka after other controller argument listeners. There might be others.

Let's merge this PR and solve late the case of accessing the parsed subject from IsGranted?

artyuum reacted with thumbs up emoji
@nicolas-grekas
Copy link
MemberAuthor

I updated the way traceable resolvers and serializers are wired so that we don't rely on service decoration, but use standard decoration instead. This preserves the definition of the original decorated service, so that we can e.g. use several tags on them without conflicts.

@nicolas-grekasnicolas-grekas added the ❄️ Feature FreezeImportant Pull Requests to finish before the next Symfony "feature freeze" labelApr 24, 2023
@nicolas-grekas
Copy link
MemberAuthor

PR rebased on top of#50158 to split the concern of decoration apart.

@nicolas-grekas
Copy link
MemberAuthor

PR rebased and ready.

@chalasr
Copy link
Member

Thanks@nicolas-grekas.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@derrabusderrabusderrabus approved these changes

@chalasrchalasrchalasr approved these changes

@wouterjwouterjAwaiting requested review from wouterj

@dunglasdunglasAwaiting requested review from dunglas

+1 more reviewer

@KocKocKoc left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

BugHttpKernel❄️ Feature FreezeImportant Pull Requests to finish before the next Symfony "feature freeze"Status: Reviewed

Projects

None yet

Milestone

6.3

Development

Successfully merging this pull request may close these issues.

[HttpKernel]#[MapRequestPayload] is "handled" before#[IsGranted]

6 participants

@nicolas-grekas@artyuum@Koc@chalasr@derrabus@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp