Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Validator] Add additional versions (*_NO_PUBLIC,*_ONLY_PRIV &*_ONLY_RES) in IP address constraint#51777
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…constraintAdded: MAC address constraintChanged: Default version filter from IPv4 to ALL (IPv4 & IPv6)
nicolas-grekas left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thanks for the PR. Here are some comments. Changing the defaults look undesired to me since it would change the behavior of existing apps without notice.
Can you also please update the title of your PR so that it can be useful for readers in the auto-generated changelog when doing the release?
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
xabbuh commentedOct 2, 2023
I am not convinced that a MAC address validator is a common enough use case to be included in the Symfony core. |
Co-authored-by: Nicolas Grekas <nicolas.grekas@gmail.com>
Co-authored-by: Nicolas Grekas <nicolas.grekas@gmail.com>
Co-authored-by: Nicolas Grekas <nicolas.grekas@gmail.com>
Co-authored-by: Nicolas Grekas <nicolas.grekas@gmail.com>
Co-authored-by: Nicolas Grekas <nicolas.grekas@gmail.com>
Co-authored-by: Nicolas Grekas <nicolas.grekas@gmail.com>
Co-authored-by: Nicolas Grekas <nicolas.grekas@gmail.com>
*_ONLY_PRIV &*_ONLY_RES in IP address constraintNinos commentedOct 5, 2023
Thx for review, merged your commits, reverted your comments & changed title :-) |
stof commentedOct 5, 2023
If we want to change the default version, we would have to make it configurable in the validator:
But to me, this deserves a separate PR than this one adding new version constants. It deserves to have a separate discussion instead of being bundled in the same decision to merge or no (note that I would have separated the Mac constraint as well, to allow separating the decisions as well). |
nicolas-grekas left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM with one comment about naming
| self::V4_ONLY_RES, | ||
| self::V6_ONLY_RES, | ||
| self::ALL_ONLY_RES, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
RES is super cryptic, let's go with the fullRESERVED word
Let's duplicate all consts to add these full-word names as aliases (PRIV also)
Ninos commentedNov 4, 2023
Seems my responses are still on pending... I'll reply as seperate comment:
|
Seb33300 commentedNov 4, 2023
@nicolas-grekas suggested to duplicate all names in his latest comment. |
Ninos commentedNov 5, 2023
@Seb33300@nicolas-grekas@OskarStark renamed & deprecated old constants. Hope it's fine now :-) |
Ninos commentedNov 6, 2023
I've also updated |
*_ONLY_PRIV &*_ONLY_RES) in IP address constraint*_NO_PUBLIC,*_ONLY_PRIV &*_ONLY_RES) in IP address constraintUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
nicolas-grekas commentedNov 20, 2023
(please rebase, don't merge - you can also squash as we won't keep the history) |
Ninos commentedNov 20, 2023
Ok now I have a problem.. :D Give me some min, may I'll create a new branch if possible to retag this MR :/ |
Ninos commentedNov 20, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@nicolas-grekas I've created a new branch based on 7.1, hope this is fine :( Sry for spamming, I'll try to rebase my mac addresses branch instead :) See also:#52658 |
… MAC address (Ninos)This PR was merged into the 7.1 branch.Discussion----------[Validator] Add `MacAddress` constraint for validating MAC address| Q | A| ------------- | ---| Branch? | 7.1| Bug fix? | no| New feature? | yes| Deprecations? | no| License | MITPossibility to validate against mac address.See also past discussion:#51777Commits-------06ccf62 [Validator] Add `MacAddress` constraint for validating MAC address
…_ONLY_PRIV` & `*_ONLY_RES`) in IP address & CIDR constraint (Ninos)This PR was squashed before being merged into the 7.1 branch.Discussion----------[Validator] Add additional versions (`*_NO_PUBLIC`, `*_ONLY_PRIV` & `*_ONLY_RES`) in IP address & CIDR constraint| Q | A| ------------- | ---| Branch? | 7.1| Bug fix? | no| New feature? | yes| Deprecations? | no| License | MITPossibility to allow no public, only private or only reserved ips.- Enhancement: Add `*_NO_PUBLIC`, `*_ONLY_PRIV` & `*_ONLY_RES` as possible versions in `Ip` constraint- Enhancement: Possibility to use all `Ip` versions in `Cidr` constraintSee also old MR:#51777Commits-------291ef1c [Validator] Add additional versions (`*_NO_PUBLIC`, `*_ONLY_PRIV` & `*_ONLY_RES`) in IP address & CIDR constraint
Uh oh!
There was an error while loading.Please reload this page.
Possibility to allow only private or only reserved ips.
*_NO_PUBLIC,*_ONLY_PRIV&*_ONLY_RESas possible versions inIpconstraintIpversions inCidrconstraintPS: InIpconstraint I changed the default version fromV4toALL, think it's time to support alsoV6by default :-) Otherwise we can revert that, but normally should not break much...