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

Add safeIpv4 and safeIpv6 #831

Open
wants to merge 1 commit into
base: 2.0
Choose a base branch
from
Open

Conversation

ttrig
Copy link

@ttrig ttrig commented Dec 7, 2023

What is the reason for this PR?

Add the posibility to generate "safe" documentation IP addresses:

  • A new feature
  • Fixed an issue (resolve #ID)

Author's checklist

Summary of changes

Added two new methods:

  • safeIpv4
  • safeIpv6

Review checklist

  • All checks have passed
  • Changes are added to the CHANGELOG.md
  • Changes are approved by maintainer

Copy link

stale bot commented Mar 13, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 1 week if no further activity occurs. Thank you for your contributions.

@brother
Copy link

brother commented Mar 13, 2024

I think the issue is valid as proposed.

@stale stale bot removed the lifecycle/stale label Mar 13, 2024
Copy link

stale bot commented Apr 22, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 1 week if no further activity occurs. Thank you for your contributions.

@brother
Copy link

brother commented Apr 22, 2024

Still a neat feature suggestion. Having real IPs in test data is not a great pattern really.

@stale stale bot removed the lifecycle/stale label Apr 24, 2024
@pimjansen
Copy link

Still a neat feature suggestion. Having real IPs in test data is not a great pattern really.

Define "real" ip addresses. For each usecase there is something to be said. If you want it strict you would need to manually provide the cidr ranges which means it gets too complex as well. And it that case its more like a 1.1.1.1 till 255.255.255.255 as well

@brother
Copy link

brother commented Apr 25, 2024

Still a neat feature suggestion. Having real IPs in test data is not a great pattern really.

Define "real" ip addresses. For each usecase there is something to be said. If you want it strict you would need to manually provide the cidr ranges which means it gets too complex as well. And it that case its more like a 1.1.1.1 till 255.255.255.255 as well

Real in contrast to them provided in this helper which are defined as for documentation purposes.
For the rare cases where you actually need a routable IP the current IP helpers are available still and would work fine.

And I understand the problem changing the default into the documentation IPs and so on, that hasn't been proposed (yet).

@pimjansen
Copy link

If we want to do something we need to review our interfaces clearly on how we define IP ranges. We have methods to get a random ipv4 and ipv6 address which is fine.

However calling something "safe" is pretty opiniated:

To fix this we need to work with valid CIDR blocks and let the user choose for which block they IP should be generated.
10.0.0.0/8 → 10.0.0.0 to 10.255.255.255
172.16.0.0/12 → 172.16.0.0 to 172.31.255.255
192.168.0.0/16 → 192.168.0.0 to 192.168.255.255

Like the method "localIpv4" is also something that is not really valid since it only applies to a CIDR 8 block and not the other addresses

So my suggestion in this case is to review the current interface and define a new one (InternetExtension) is still something that is open:

  • username
  • password
  • domainName
  • tld
  • url
  • slug
  • ipv4
  • localIpv4(int $cidr)
  • ipv6
  • macAddress

If im also correct a local IPV6 adderss is not really needed since there is actually no usecase for that. There are more then 16 million address available in a 10.0.0.0/8 ranges locally

@brother
Copy link

brother commented Feb 20, 2025

For IPv6 the link local prefix (fe80::) is probably the closest?

@pimjansen
Copy link

For IPv6 the link local prefix (fe80::) is probably the closest?

In general who is ever going to use ipv6 in a local network?

@brother
Copy link

brother commented Feb 24, 2025

For IPv6 the link local prefix (fe80::) is probably the closest?

In general who is ever going to use ipv6 in a local network?

Thought everyone did but I might be of a different breed. I donät use linc local addressing though.

Not sure this project is the best place to make thouse judgment calls really.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants