-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…constraint Added: MAC address constraint Changed: Default version filter from IPv4 to ALL (IPv4 & IPv6)
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?
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 <[email protected]>
Co-authored-by: Nicolas Grekas <[email protected]>
Co-authored-by: Nicolas Grekas <[email protected]>
Co-authored-by: Nicolas Grekas <[email protected]>
Co-authored-by: Nicolas Grekas <[email protected]>
Co-authored-by: Nicolas Grekas <[email protected]>
Co-authored-by: Nicolas Grekas <[email protected]>
*_ONLY_PRIV
& *_ONLY_RES
in IP address constraint
Thx for review, merged your commits, reverted your comments & changed title :-) |
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). |
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 full RESERVED
word
Let's duplicate all consts to add these full-word names as aliases (PRIV also)
Seems my responses are still on pending... I'll reply as seperate comment:
|
@nicolas-grekas suggested to duplicate all names in his latest comment. |
@Seb33300 @nicolas-grekas @OskarStark renamed & deprecated old constants. Hope it's fine now :-) |
I've also updated |
*_ONLY_PRIV
& *_ONLY_RES
) in IP address constraint*_NO_PUBLIC
, *_ONLY_PRIV
& *_ONLY_RES
) in IP address constraint
(please rebase, don't merge - you can also squash as we won't keep the history) |
Ok now I have a problem.. :D Give me some min, may I'll create a new branch if possible to retag this MR :/ |
@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 | MIT Possibility to validate against mac address. See also past discussion: #51777 Commits ------- 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 | MIT Possibility 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` constraint See also old MR: #51777 Commits ------- 291ef1c [Validator] Add additional versions (`*_NO_PUBLIC`, `*_ONLY_PRIV` & `*_ONLY_RES`) in IP address & CIDR constraint
Possibility to allow only private or only reserved ips.
*_NO_PUBLIC
,*_ONLY_PRIV
&*_ONLY_RES
as possible versions inIp
constraintIp
versions inCidr
constraintPS: InIp
constraint I changed the default version fromV4
toALL
, think it's time to support alsoV6
by default :-) Otherwise we can revert that, but normally should not break much...