Accepting port ranges when creating firewall rules#7
Open
andreisusanu wants to merge 1 commit intomalc0mn:masterfrom
Open
Accepting port ranges when creating firewall rules#7andreisusanu wants to merge 1 commit intomalc0mn:masterfrom
andreisusanu wants to merge 1 commit intomalc0mn:masterfrom
Conversation
API definition: port string (optional) TCP/UDP only. This field can be an integer value specifying a port or a colon separated port range. @see https://www.vultr.com/api/#firewall
Owner
|
Thanks for bringing this up, but I would prefer to separate the ports in that case, something along the lines of: <?php
public function createRule(
$groupId,
$ipType,
$protocol,
$subnet,
$subnetSize,
$port = null,
$portEnd = null,
$direction = 'in'
) { ) {
// ...
if ($port !== null) {
$args['port'] = (int) $port;
if ($portEnd !== null) {
$args['port'] .= ':' . $portEnd;
}
}
// ...Ideally, this will also throw an exception when using ports with protocol |
Author
|
Thanks for checking this out. I see two BIG issues:
I think the case is clear, and the library should allow port ranges when creating firewall rules. Thanks again! |
Owner
|
Just want to understand your comment properly as I'm not familiar with the Vultr firewall rules feature...
<?php
createRule(5, 'v4', 'tcp', '10.234.22.0', 24, 5090, 5100);Which will cover 11 ports in this case ranging from 5090 up to and including 5100.
|
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
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.
API definition: port string (optional) TCP/UDP only. This field can be an integer value specifying a port or a colon separated port range.
@see https://www.vultr.com/api/#firewall