Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Security] Support for SwitchUserToken instances serialized with 4.4/5.1 #39187

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

Merged

Conversation

derrabus
Copy link
Member

@derrabus derrabus commented Nov 27, 2020

Q A
Branch? 5.2
Bug fix? yes
New feature? no
Deprecations? no
Tickets Fix #39177
License MIT
Doc PR N/A

This PR enables SwitchUserToken to unserialize earlier versions of itself.

I've executed the following script on the 4.4 branch with php 7.2 to create the fixture included with this PR:

$token = new SwitchUserToken(
    new User('john', null, ['ROLE_USER']),
    ['foo' => 'bar'],
    'main',
    ['ROLE_USER'],
    new UsernamePasswordToken(new User('jane', null, ['ROLE_USER']), ['foo' => 'bar'], 'main', ['ROLE_USER'])
);

file_put_contents(__DIR__.'/switch-user-token-4.4.txt', serialize($token));

@carsonbot carsonbot added this to the 5.2 milestone Nov 27, 2020
@derrabus derrabus force-pushed the bugfix/upgrade-serialized-switch-user-token branch 2 times, most recently from 1ce9fae to 14328b1 Compare November 27, 2020 00:16
@derrabus derrabus force-pushed the bugfix/upgrade-serialized-switch-user-token branch from 14328b1 to 608c9af Compare November 27, 2020 01:02
@derrabus derrabus force-pushed the bugfix/upgrade-serialized-switch-user-token branch from 608c9af to 01bea3c Compare November 27, 2020 01:03
@fabpot
Copy link
Member

fabpot commented Nov 27, 2020

Thank you @derrabus.

@fabpot fabpot merged commit 9f484e6 into symfony:5.2 Nov 27, 2020
@fabpot fabpot mentioned this pull request Nov 30, 2020
@derrabus derrabus deleted the bugfix/upgrade-serialized-switch-user-token branch March 13, 2021 15:22
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.

3 participants