Skip to content

Commit 57f123d

Browse files
Merge pull request #123 from grillp/Fix-priviledge-for-page-firewall-alias-edit
Corrected page-firewall-alias-edit privilege
2 parents 23b1054 + 2359841 commit 57f123d

9 files changed

Lines changed: 9014 additions & 10242 deletions

File tree

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,7 @@ URL: https://{{$hostname}}/api/v1/access_token
893893

894894
Add a new host, network or port firewall alias.<br><br>
895895

896-
_Requires at least one of the following privileges:_ [`page-all`, `page-firewall-aliases-edit`]
896+
_Requires at least one of the following privileges:_ [`page-all`, `page-firewall-alias-edit`]
897897

898898

899899
***Endpoint:***
@@ -937,7 +937,7 @@ URL: https://{{$hostname}}/api/v1/firewall/alias
937937

938938
Delete an existing alias and reload filter.<br><br>
939939

940-
_Requires at least one of the following privileges:_ [`page-all`, `page-firewall-aliases-edit`]
940+
_Requires at least one of the following privileges:_ [`page-all`, `page-firewall-alias-edit`]
941941

942942

943943
***Endpoint:***
@@ -983,7 +983,7 @@ URL: https://{{$hostname}}/api/v1/firewall/alias
983983

984984
Modify an existing firewall alias.<br><br>
985985

986-
_Requires at least one of the following privileges:_ [`page-all`, `page-firewall-aliases-edit`]
986+
_Requires at least one of the following privileges:_ [`page-all`, `page-firewall-alias-edit`]
987987

988988

989989
***Endpoint:***
@@ -1020,7 +1020,7 @@ URL: https://{{$hostname}}/api/v1/firewall/alias
10201020

10211021
Add new entries to an existing firewall alias.<br><br>
10221022

1023-
_Requires at least one of the following privileges:_ [`page-all`, `page-firewall-aliases-edit`]
1023+
_Requires at least one of the following privileges:_ [`page-all`, `page-firewall-alias-edit`]
10241024

10251025

10261026
***Endpoint:***
@@ -1060,7 +1060,7 @@ URL: https://{{$hostname}}/api/v1/firewall/alias/entry
10601060

10611061
Delete existing entries from an existing firewall alias.<br><br>
10621062

1063-
_Requires at least one of the following privileges:_ [`page-all`, `page-firewall-aliases-edit`]
1063+
_Requires at least one of the following privileges:_ [`page-all`, `page-firewall-alias-edit`]
10641064

10651065

10661066
***Endpoint:***
@@ -1102,7 +1102,7 @@ URL: https://{{$hostname}}/api/v1/firewall/alias/entry
11021102

11031103
Apply pending firewall changes. This will reload all filter items. This endpoint returns no data.<br><br>
11041104

1105-
_Requires at least one of the following privileges:_ [`page-all`, `page-firewall-rules`, `page-firewall-rules-edit`, `page-firewall-aliases`, `page-firewall-aliases-edit`, `page-firewall-nat-1-1`, `page-firewall-nat-1-1-edit`, `page-firewall-nat-outbound`, `page-firewall-nat-outbound-edit`, `page-firewall-nat-portforward`, `page-firewall-nat-portforward-edit`]
1105+
_Requires at least one of the following privileges:_ [`page-all`, `page-firewall-rules`, `page-firewall-rules-edit`, `page-firewall-aliases`, `page-firewall-alias-edit`, `page-firewall-nat-1-1`, `page-firewall-nat-1-1-edit`, `page-firewall-nat-outbound`, `page-firewall-nat-outbound-edit`, `page-firewall-nat-portforward`, `page-firewall-nat-portforward-edit`]
11061106

11071107

11081108
***Endpoint:***

docs/documentation.json

Lines changed: 8996 additions & 10224 deletions
Large diffs are not rendered by default.

pfSense-pkg-API/files/etc/inc/api/models/APIFirewallAliasCreate.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class APIFirewallAliasCreate extends APIModel {
2020
# Create our method constructor
2121
public function __construct() {
2222
parent::__construct();
23-
$this->privileges = ["page-all", "page-firewall-aliases-edit"];
23+
$this->privileges = ["page-all", "page-firewall-alias-edit"];
2424
$this->change_note = "Added firewall alias via API";
2525
}
2626

pfSense-pkg-API/files/etc/inc/api/models/APIFirewallAliasDelete.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class APIFirewallAliasDelete extends APIModel {
2020
# Create our method constructor
2121
public function __construct() {
2222
parent::__construct();
23-
$this->privileges = ["page-all", "page-firewall-aliases-edit"];
23+
$this->privileges = ["page-all", "page-firewall-alias-edit"];
2424
$this->change_note = "Deleted firewall alias via API";
2525
}
2626

pfSense-pkg-API/files/etc/inc/api/models/APIFirewallAliasEntryCreate.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class APIFirewallAliasEntryCreate extends APIModel {
2020
# Create our method constructor
2121
public function __construct() {
2222
parent::__construct();
23-
$this->privileges = ["page-all", "page-firewall-aliases-edit"];
23+
$this->privileges = ["page-all", "page-firewall-alias-edit"];
2424
$this->change_note = "Added firewall alias address via API";
2525
}
2626

pfSense-pkg-API/files/etc/inc/api/models/APIFirewallAliasEntryDelete.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class APIFirewallAliasEntryDelete extends APIModel {
2020
# Create our method constructor
2121
public function __construct() {
2222
parent::__construct();
23-
$this->privileges = ["page-all", "page-firewall-aliases-edit"];
23+
$this->privileges = ["page-all", "page-firewall-alias-edit"];
2424
$this->change_note = "Deleted firewall alias address via API";
2525
}
2626

pfSense-pkg-API/files/etc/inc/api/models/APIFirewallAliasUpdate.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class APIFirewallAliasUpdate extends APIModel {
2323
# Create our method constructor
2424
public function __construct() {
2525
parent::__construct();
26-
$this->privileges = ["page-all", "page-firewall-aliases-edit"];
26+
$this->privileges = ["page-all", "page-firewall-alias-edit"];
2727
$this->change_note = "Modified firewall alias address via API";
2828
$this->type_changed = false;
2929
}

pfSense-pkg-API/files/etc/inc/api/models/APIFirewallApplyCreate.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class APIFirewallApplyCreate extends APIModel {
2626
"page-firewall-rules",
2727
"page-firewall-rules-edit",
2828
"page-firewall-aliases",
29-
"page-firewall-aliases-edit",
29+
"page-firewall-alias-edit",
3030
"page-firewall-nat-1-1",
3131
"page-firewall-nat-1-1-edit",
3232
"page-firewall-nat-outbound",

pfSense-pkg-API/files/usr/local/www/api/documentation/index.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@
667667
<a class=text-success data-toggle=collapse data-parent=#accordion-FIREWALL_2FALIAS href=#collapse-FIREWALL_2FALIAS-CreateFirewallAliases><h4 class=panel-title><span class="glyphicon glyphicon-plus"></span><strong>Create Firewall Aliases</strong> &nbsp;|&nbsp;
668668
<strong class="request-method border-success">POST</strong>
669669
&nbsp;
670-
https://<?echo $_SERVER['HTTP_HOST'];?>/api/v1/firewall/alias</h4></a></div><div id=collapse-FIREWALL_2FALIAS-CreateFirewallAliases class="panel-collapse collapse"><div class=panel-body><h5 class="label label-default">Description</h5><br><small><p>Add a new host, network or port firewall alias.<br><br><p><em>Requires at least one of the following privileges:</em> [<code>page-all</code>, <code>page-firewall-aliases-edit</code>]</small><br><br><h5 class="label label-info">Query</h5><table class="table table-hover"><thead><tr><th>Key<th>Value<th>Description<tbody><tr><td>name<td>string<td><p>Name of new alias. <em>Only alpha-numeric and underscore characters are allowed, other characters will be replaced</em><tr><td>type<td>string<td><p>Alias type. Current supported alias types are<code>host</code>, <code>network</code>, and <code>port</code> aliases.<tr><td>descr<td>string<td><p>Description of new alias (optional)<tr><td>address<td>string or array<td><p>Array of values to add to alias. A single value may be specified as string.<tr><td>detail<td>string or array<td><p>Array of descriptions for alias values. Descriptions must match the order the that they are specified in the <code>address</code> array. Single descriptions may be specified as string</table><h5 class="label label-primary">Body</h5><span class=resp-prettyprint>{
670+
https://<?echo $_SERVER['HTTP_HOST'];?>/api/v1/firewall/alias</h4></a></div><div id=collapse-FIREWALL_2FALIAS-CreateFirewallAliases class="panel-collapse collapse"><div class=panel-body><h5 class="label label-default">Description</h5><br><small><p>Add a new host, network or port firewall alias.<br><br><p><em>Requires at least one of the following privileges:</em> [<code>page-all</code>, <code>page-firewall-alias-edit</code>]</small><br><br><h5 class="label label-info">Query</h5><table class="table table-hover"><thead><tr><th>Key<th>Value<th>Description<tbody><tr><td>name<td>string<td><p>Name of new alias. <em>Only alpha-numeric and underscore characters are allowed, other characters will be replaced</em><tr><td>type<td>string<td><p>Alias type. Current supported alias types are<code>host</code>, <code>network</code>, and <code>port</code> aliases.<tr><td>descr<td>string<td><p>Description of new alias (optional)<tr><td>address<td>string or array<td><p>Array of values to add to alias. A single value may be specified as string.<tr><td>detail<td>string or array<td><p>Array of descriptions for alias values. Descriptions must match the order the that they are specified in the <code>address</code> array. Single descriptions may be specified as string</table><h5 class="label label-primary">Body</h5><span class=resp-prettyprint>{
671671
&#34;name&#34;: &#34;RFC1918&#34;,
672672
&#34;type&#34;: &#34;network&#34;,
673673
&#34;descr&#34;: &#34;Networks reserved in RFC1918&#34;,
@@ -677,7 +677,7 @@
677677
<a class=text-danger data-toggle=collapse data-parent=#accordion-FIREWALL_2FALIAS href=#collapse-FIREWALL_2FALIAS-DeleteFirewallAliases><h4 class=panel-title><span class="glyphicon glyphicon-plus"></span><strong>Delete Firewall Aliases</strong> &nbsp;|&nbsp;
678678
<strong class="request-method border-danger">DELETE</strong>
679679
&nbsp;
680-
https://<?echo $_SERVER['HTTP_HOST'];?>/api/v1/firewall/alias</h4></a></div><div id=collapse-FIREWALL_2FALIAS-DeleteFirewallAliases class="panel-collapse collapse"><div class=panel-body><h5 class="label label-default">Description</h5><br><small><p>Delete an existing alias and reload filter.<br><br><p><em>Requires at least one of the following privileges:</em> [<code>page-all</code>, <code>page-firewall-aliases-edit</code>]</small><br><br><h5 class="label label-primary">Body</h5><span class=resp-prettyprint>{
680+
https://<?echo $_SERVER['HTTP_HOST'];?>/api/v1/firewall/alias</h4></a></div><div id=collapse-FIREWALL_2FALIAS-DeleteFirewallAliases class="panel-collapse collapse"><div class=panel-body><h5 class="label label-default">Description</h5><br><small><p>Delete an existing alias and reload filter.<br><br><p><em>Requires at least one of the following privileges:</em> [<code>page-all</code>, <code>page-firewall-alias-edit</code>]</small><br><br><h5 class="label label-primary">Body</h5><span class=resp-prettyprint>{
681681
&#34;id&#34;: &#34;RFC1918&#34;
682682
}</span><div class=clearfix></div></div></div></div><div class="panel panel-info" id=jump-FIREWALL_2FALIAS-ReadFirewallAliases><div class=panel-heading><small class="pull-right text-muted">raw</small>
683683
<a class=text-info data-toggle=collapse data-parent=#accordion-FIREWALL_2FALIAS href=#collapse-FIREWALL_2FALIAS-ReadFirewallAliases><h4 class=panel-title><span class="glyphicon glyphicon-plus"></span><strong>Read Firewall Aliases</strong> &nbsp;|&nbsp;
@@ -687,7 +687,7 @@
687687
<a class=text-warning data-toggle=collapse data-parent=#accordion-FIREWALL_2FALIAS href=#collapse-FIREWALL_2FALIAS-UpdateFirewallAliases><h4 class=panel-title><span class="glyphicon glyphicon-plus"></span><strong>Update Firewall Aliases</strong> &nbsp;|&nbsp;
688688
<strong class="request-method border-warning">PUT</strong>
689689
&nbsp;
690-
https://<?echo $_SERVER['HTTP_HOST'];?>/api/v1/firewall/alias</h4></a></div><div id=collapse-FIREWALL_2FALIAS-UpdateFirewallAliases class="panel-collapse collapse"><div class=panel-body><h5 class="label label-default">Description</h5><br><small><p>Modify an existing firewall alias.<br><br><p><em>Requires at least one of the following privileges:</em> [<code>page-all</code>, <code>page-firewall-aliases-edit</code>]</small><br><br><h5 class="label label-primary">Body</h5><span class=resp-prettyprint>{
690+
https://<?echo $_SERVER['HTTP_HOST'];?>/api/v1/firewall/alias</h4></a></div><div id=collapse-FIREWALL_2FALIAS-UpdateFirewallAliases class="panel-collapse collapse"><div class=panel-body><h5 class="label label-default">Description</h5><br><small><p>Modify an existing firewall alias.<br><br><p><em>Requires at least one of the following privileges:</em> [<code>page-all</code>, <code>page-firewall-alias-edit</code>]</small><br><br><h5 class="label label-primary">Body</h5><span class=resp-prettyprint>{
691691
&#34;id&#34;: &#34;RFC1918&#34;,
692692
&#34;name&#34;: &#34;UPDATED_RFC1918&#34;,
693693
&#34;type&#34;: &#34;network&#34;,
@@ -699,23 +699,23 @@
699699
<a class=text-success data-toggle=collapse data-parent=#accordion-FIREWALL_2FALIAS_2FENTRY href=#collapse-FIREWALL_2FALIAS_2FENTRY-CreateFirewallAliasEntries><h4 class=panel-title><span class="glyphicon glyphicon-plus"></span><strong>Create Firewall Alias Entries</strong> &nbsp;|&nbsp;
700700
<strong class="request-method border-success">POST</strong>
701701
&nbsp;
702-
https://<?echo $_SERVER['HTTP_HOST'];?>/api/v1/firewall/alias/entry</h4></a></div><div id=collapse-FIREWALL_2FALIAS_2FENTRY-CreateFirewallAliasEntries class="panel-collapse collapse"><div class=panel-body><h5 class="label label-default">Description</h5><br><small><p>Add new entries to an existing firewall alias.<br><br><p><em>Requires at least one of the following privileges:</em> [<code>page-all</code>, <code>page-firewall-aliases-edit</code>]</small><br><br><h5 class="label label-info">Query</h5><table class="table table-hover"><thead><tr><th>Key<th>Value<th>Description<tbody><tr><td>name<td>string<td><p>Name of alias to add new address values<tr><td>address<td>string or array<td><p>Array of values to add to alias. A single value may be specified as string.<tr><td>detail<td>string or array<td><p>Array of descriptions for alias values. Descriptions must match the order the that they are specified in the <code>address</code> array. Single descriptions may be specified as string. If you pass In less <code>detail</code> values than <code>address</code> values, a default auto-created detail will be applied to the remaining values. (optional)</table><h5 class="label label-primary">Body</h5><span class=resp-prettyprint>{
702+
https://<?echo $_SERVER['HTTP_HOST'];?>/api/v1/firewall/alias/entry</h4></a></div><div id=collapse-FIREWALL_2FALIAS_2FENTRY-CreateFirewallAliasEntries class="panel-collapse collapse"><div class=panel-body><h5 class="label label-default">Description</h5><br><small><p>Add new entries to an existing firewall alias.<br><br><p><em>Requires at least one of the following privileges:</em> [<code>page-all</code>, <code>page-firewall-alias-edit</code>]</small><br><br><h5 class="label label-info">Query</h5><table class="table table-hover"><thead><tr><th>Key<th>Value<th>Description<tbody><tr><td>name<td>string<td><p>Name of alias to add new address values<tr><td>address<td>string or array<td><p>Array of values to add to alias. A single value may be specified as string.<tr><td>detail<td>string or array<td><p>Array of descriptions for alias values. Descriptions must match the order the that they are specified in the <code>address</code> array. Single descriptions may be specified as string. If you pass In less <code>detail</code> values than <code>address</code> values, a default auto-created detail will be applied to the remaining values. (optional)</table><h5 class="label label-primary">Body</h5><span class=resp-prettyprint>{
703703
&#34;name&#34;: &#34;RFC1918&#34;,
704704
&#34;address&#34;: [&#34;10.0.0.0/8&#34;, &#34;172.16.0.0/12&#34;, &#34;192.168.0.0/16&#34;],
705705
&#34;detail&#34;: &#34;Hypervisor&#34;
706706
}</span><div class=clearfix></div></div></div></div><div class="panel panel-danger" id=jump-FIREWALL_2FALIAS_2FENTRY-DeleteFirewallAliasEntries><div class=panel-heading><small class="pull-right text-muted">raw</small>
707707
<a class=text-danger data-toggle=collapse data-parent=#accordion-FIREWALL_2FALIAS_2FENTRY href=#collapse-FIREWALL_2FALIAS_2FENTRY-DeleteFirewallAliasEntries><h4 class=panel-title><span class="glyphicon glyphicon-plus"></span><strong>Delete Firewall Alias Entries</strong> &nbsp;|&nbsp;
708708
<strong class="request-method border-danger">DELETE</strong>
709709
&nbsp;
710-
https://<?echo $_SERVER['HTTP_HOST'];?>/api/v1/firewall/alias/entry</h4></a></div><div id=collapse-FIREWALL_2FALIAS_2FENTRY-DeleteFirewallAliasEntries class="panel-collapse collapse"><div class=panel-body><h5 class="label label-default">Description</h5><br><small><p>Delete existing entries from an existing firewall alias.<br><br><p><em>Requires at least one of the following privileges:</em> [<code>page-all</code>, <code>page-firewall-aliases-edit</code>]</small><br><br><h5 class="label label-info">Query</h5><table class="table table-hover"><thead><tr><th>Key<th>Value<th>Description<tbody><tr><td>name<td>string<td><p>Name of alias to delete address values from<tr><td>address<td>string<td><p>Array of values to delete from alias. A single value may be specified as string.</table><h5 class="label label-primary">Body</h5><span class=resp-prettyprint>{
710+
https://<?echo $_SERVER['HTTP_HOST'];?>/api/v1/firewall/alias/entry</h4></a></div><div id=collapse-FIREWALL_2FALIAS_2FENTRY-DeleteFirewallAliasEntries class="panel-collapse collapse"><div class=panel-body><h5 class="label label-default">Description</h5><br><small><p>Delete existing entries from an existing firewall alias.<br><br><p><em>Requires at least one of the following privileges:</em> [<code>page-all</code>, <code>page-firewall-alias-edit</code>]</small><br><br><h5 class="label label-info">Query</h5><table class="table table-hover"><thead><tr><th>Key<th>Value<th>Description<tbody><tr><td>name<td>string<td><p>Name of alias to delete address values from<tr><td>address<td>string<td><p>Array of values to delete from alias. A single value may be specified as string.</table><h5 class="label label-primary">Body</h5><span class=resp-prettyprint>{
711711
&#34;name&#34;: &#34;RFC1918&#34;,
712712
&#34;address&#34;: [&#34;10.0.0.0/8&#34;, &#34;172.16.0.0/12&#34;]
713713
}</span><div class=clearfix></div></div></div></div></div></div></div></div><div class="panel panel-default"><div class=panel-heading><h3 class=panel-title id=FIREWALL_2FAPPLY>FIREWALL/APPLY
714714
<span class=badge>1</span></h3></div><div class=panel-body><p><div class=request-item><div class=panel-group id=accordion-FIREWALL_2FAPPLY><div class="panel panel-success" id=jump-FIREWALL_2FAPPLY-ApplyFirewall><div class=panel-heading><small class="pull-right text-muted">raw</small>
715715
<a class=text-success data-toggle=collapse data-parent=#accordion-FIREWALL_2FAPPLY href=#collapse-FIREWALL_2FAPPLY-ApplyFirewall><h4 class=panel-title><span class="glyphicon glyphicon-plus"></span><strong>Apply Firewall</strong> &nbsp;|&nbsp;
716716
<strong class="request-method border-success">POST</strong>
717717
&nbsp;
718-
https://<?echo $_SERVER['HTTP_HOST'];?>/api/v1/firewall/apply</h4></a></div><div id=collapse-FIREWALL_2FAPPLY-ApplyFirewall class="panel-collapse collapse"><div class=panel-body><h5 class="label label-default">Description</h5><br><small><p>Apply pending firewall changes. This will reload all filter items. This endpoint returns no data.<br><br><p><em>Requires at least one of the following privileges:</em> [<code>page-all</code>, <code>page-firewall-rules</code>, <code>page-firewall-rules-edit</code>, <code>page-firewall-aliases</code>, <code>page-firewall-aliases-edit</code>, <code>page-firewall-nat-1-1</code>, <code>page-firewall-nat-1-1-edit</code>, <code>page-firewall-nat-outbound</code>, <code>page-firewall-nat-outbound-edit</code>, <code>page-firewall-nat-portforward</code>, <code>page-firewall-nat-portforward-edit</code>]</small><br><br><h5 class="label label-primary">Body</h5><span class=resp-prettyprint>{
718+
https://<?echo $_SERVER['HTTP_HOST'];?>/api/v1/firewall/apply</h4></a></div><div id=collapse-FIREWALL_2FAPPLY-ApplyFirewall class="panel-collapse collapse"><div class=panel-body><h5 class="label label-default">Description</h5><br><small><p>Apply pending firewall changes. This will reload all filter items. This endpoint returns no data.<br><br><p><em>Requires at least one of the following privileges:</em> [<code>page-all</code>, <code>page-firewall-rules</code>, <code>page-firewall-rules-edit</code>, <code>page-firewall-aliases</code>, <code>page-firewall-alias-edit</code>, <code>page-firewall-nat-1-1</code>, <code>page-firewall-nat-1-1-edit</code>, <code>page-firewall-nat-outbound</code>, <code>page-firewall-nat-outbound-edit</code>, <code>page-firewall-nat-portforward</code>, <code>page-firewall-nat-portforward-edit</code>]</small><br><br><h5 class="label label-primary">Body</h5><span class=resp-prettyprint>{
719719
}</span><div class=clearfix></div></div></div></div></div></div></div></div><div class="panel panel-default"><div class=panel-heading><h3 class=panel-title id=FIREWALL_2FNAT_2FONETOONE>FIREWALL/NAT/ONE_TO_ONE
720720
<span class=badge>4</span></h3></div><div class=panel-body><p><div class=request-item><div class=panel-group id=accordion-FIREWALL_2FNAT_2FONETOONE><div class="panel panel-success" id=jump-FIREWALL_2FNAT_2FONETOONE-CreateNAT1to1Mappings><div class=panel-heading><small class="pull-right text-muted">raw</small>
721721
<a class=text-success data-toggle=collapse data-parent=#accordion-FIREWALL_2FNAT_2FONETOONE href=#collapse-FIREWALL_2FNAT_2FONETOONE-CreateNAT1to1Mappings><h4 class=panel-title><span class="glyphicon glyphicon-plus"></span><strong>Create NAT 1-to-1 Mappings</strong> &nbsp;|&nbsp;

0 commit comments

Comments
 (0)