Skip to content
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

[Security] Make impersonation_path() argument mandatory and add impersonation_url() #51804

Merged
merged 1 commit into from Oct 2, 2023

Conversation

alexandre-daubois
Copy link
Contributor

@alexandre-daubois alexandre-daubois commented Oct 2, 2023

Q A
Branch? 6.4
Bug fix? yes
New feature? yes
Deprecations? no
Tickets -
License MIT

Follow-up of #50030

When documenting this function, I found out that theidentifier argument was optional, which seemed weird to me given the function purpose.

I then had a look at the implementation, and I saw that ImpersonateUrlGenerator::generateImpersonationPath() accepts a nullable string. However, the underlying call to ImpersonateUrlGenerator::buildPath() doesn't accept a nullable string. I propose to make the identifier argument mandatory, which makes more sense here.

I also added the missing Changelog line and impersonation_url()

@stof
Copy link
Member

stof commented Oct 2, 2023

Should we also add impersonate_url() to be consistent with impersonate_exit_* exposing both path and url functions in Twig ?

@alexandre-daubois alexandre-daubois changed the title [Security] Make impersonation_path() argument mandatory [Security] Make impersonation_path() argument mandatory and add impersonation_url() Oct 2, 2023
@alexandre-daubois
Copy link
Contributor Author

I think that's a good idea, I added the new function

@fabpot
Copy link
Member

fabpot commented Oct 2, 2023

Thank you @alexandre-daubois.

@fabpot fabpot merged commit e11ae31 into symfony:6.4 Oct 2, 2023
4 of 9 checks passed
@alexandre-daubois alexandre-daubois deleted the fix-impersonation-path branch October 2, 2023 11:41
javiereguiluz added a commit to javiereguiluz/symfony-docs that referenced this pull request Oct 4, 2023
…ation path (alexandre-daubois)

This PR was merged into the 6.4 branch.

Discussion
----------

Add new Twig bridge function to generate impersonation path

Fix
- symfony#18960

Fix
- symfony#18968

However, I think we should wait for this PR to be merged (or not), because it seems the current implementation has a problem:
- symfony/symfony#51804

~This doc PR takes into account my fix PR above.~ Merged 👍

Commits
-------

061bc3f [TwigBridge] Add new Twig bridge function to generate impersonation path
@PhilETaylor
Copy link
Contributor

Thank you for cleaning up my mess! Appreciate it.

This was referenced Oct 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants