-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Security] Allow enums in SignatureHasher::computeSignatureHash()
#60302
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
Open
BenMorel
wants to merge
3
commits into
symfony:7.3
Choose a base branch
from
BenMorel:signature_hasher_enum
base: 7.3
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tests? 🙃 |
SignatureHasher::computeSignatureHash()
SignatureHasher::computeSignatureHash()
SignatureHasher::computeSignatureHash()
Only option 2 makes sense to me. If you need your enum to have a canonical scalar representation, you should use a backed enum (that's what they are about).
that's not something we need to detect IMO (your DB would also have issues in such case, and this would require an insane architecture IMO) |
5c6d8d2
to
554fb1f
Compare
554fb1f
to
8b14913
Compare
3815106
to
d13454c
Compare
@chalasr @derrabus @stof Ready for review. I've split the PR into 3 commits:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, using
remember_me.signature_properties
on a property holding an enum fails with:We can add support for enums in one of three ways:
int|string
)In the current PR I went with option 2, but I'm thinking that option 3 could be better:
Pros:
Cons:
I would welcome feedback here.