Skip to content

Commit f22b92d

Browse files
Merge pull request #841 from pfrest/next_patch
v2.7.2 Features
2 parents 6261733 + 8d193df commit f22b92d

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/FirewallRule.inc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ class FirewallRule extends Model {
7474
allow_interface_groups: true,
7575
allow_ipsec_interface: true,
7676
allow_openvpn_interface: true,
77+
allow_custom: ['any'],
7778
many: true,
7879
help_text: 'The interface where packets must originate to match this rule.',
7980
);

pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/APIModelsFirewallRuleTestCase.inc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -993,4 +993,21 @@ class APIModelsFirewallRuleTestCase extends TestCase {
993993
$this->assert_equals($rule->updated_by->value, "$client->username@$client->ip_address (API)");
994994
}
995995
}
996+
997+
/**
998+
* Checks that we can create a floating firewall rule with the 'any' interface
999+
*/
1000+
public function test_floating_rule_with_any_interface(): void {
1001+
# Create a firewall rule to test with
1002+
$rule = new FirewallRule(
1003+
type: 'pass',
1004+
interface: ['any'],
1005+
ipprotocol: 'inet',
1006+
protocol: 'tcp',
1007+
source: 'any',
1008+
destination: 'any',
1009+
floating: true,
1010+
);
1011+
$rule->validate();
1012+
}
9961013
}

0 commit comments

Comments
 (0)