Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
04f35a5
Updated supported versions
jaredhendrickson13 Mar 25, 2021
c9fb374
Added models for dnsmasq host overrides
jaredhendrickson13 Mar 25, 2021
a16a56e
Added models to start, stop and restart the dnsmasq service
jaredhendrickson13 Mar 26, 2021
12766d0
Added endpoints for dnsmasq
jaredhendrickson13 Mar 26, 2021
b5bc2b5
Fixed duplicate sort functions for unbound and dnsmasq
jaredhendrickson13 Mar 26, 2021
60d9fd9
Fixed bad response code when updating dnsmasq host override to non-un…
jaredhendrickson13 Mar 26, 2021
b19529c
Fixed bad config array initialization
jaredhendrickson13 Mar 26, 2021
efbf8f4
Added stronger unique constraint checks to alias creations
jaredhendrickson13 Mar 26, 2021
d3ad405
Removed unique constraint from alias field as it is not enforced in w…
jaredhendrickson13 Mar 26, 2021
bfbe911
Removed all unique constraints on host override aliases for dnsmasq
jaredhendrickson13 Mar 26, 2021
99b46e9
Added unit tests for dnsmasq service control endpoints
jaredhendrickson13 Mar 26, 2021
4e19550
Changed variable names to constant names for consistency
jaredhendrickson13 Mar 26, 2021
6269185
Added documentation for dnsmasq endpoints
jaredhendrickson13 Mar 26, 2021
4dea980
Added model to read dnsmasq configuration
jaredhendrickson13 Mar 26, 2021
bb5c783
Added missing endpoint for /api/v1/services/dnsmasq
jaredhendrickson13 Mar 26, 2021
2c9ce4c
Added unit test for dnsmasq endpoint
jaredhendrickson13 Mar 26, 2021
7fb7248
Minor unit test corrections
jaredhendrickson13 Mar 26, 2021
9f7871d
Merge pull request #114 from jaredhendrickson13/dnsmasq_endpoint
jaredhendrickson13 Mar 27, 2021
f39650e
Merge branch 'master' into v130
jaredhendrickson13 Mar 31, 2021
565f9c0
Merge branch 'master' into v130
jaredhendrickson13 Apr 6, 2021
351f0f3
rebase
jaredhendrickson13 Apr 6, 2021
4707468
Addressing merge conflicts
jaredhendrickson13 Apr 7, 2021
45a0491
Addressing merge conflicts
jaredhendrickson13 Apr 7, 2021
a95856d
Moving docs
jaredhendrickson13 Apr 7, 2021
e647952
Merge branch 'master' into v130
jaredhendrickson13 Apr 7, 2021
cb80a3a
Regenerated documentation to include changes from master
jaredhendrickson13 Apr 7, 2021
81e0c45
Created APISystemAPISyncUpdate model to allow HA peers to sync API co…
jaredhendrickson13 Apr 7, 2021
b649694
Added HA sync settings to UI page
jaredhendrickson13 Apr 7, 2021
6417006
Updated /api/v1/system/api* endpoints to include new HA sync fields
jaredhendrickson13 Apr 7, 2021
6bfc1df
Added documentation for HA sync fields on /api/v1/system/api endpoint
jaredhendrickson13 Apr 7, 2021
93aebf4
Added sync option to pfsense-api CLI tool
jaredhendrickson13 Apr 7, 2021
3a62a07
Added missing sync data
jaredhendrickson13 Apr 7, 2021
17e8cea
Updated sync error messages, updating APIModel class to allow models …
jaredhendrickson13 Apr 8, 2021
6462898
Improved error messages for pfsense-api CLI tool, added sync call aft…
jaredhendrickson13 Apr 9, 2021
d427fa6
Implemented handling of CA certificates
mj84 Apr 12, 2021
991e56b
Merge pull request #125 from mj84/system_ca
jaredhendrickson13 May 2, 2021
7803fd8
Added documentation for /api/v1/system/ca endpoint
jaredhendrickson13 May 11, 2021
b99b125
Overhauled /api/v1/system/ca endpoint to sync with truststore and clo…
jaredhendrickson13 May 11, 2021
055e2eb
Merge pull request #143 from jaredhendrickson13/master
jaredhendrickson13 Jul 16, 2021
adffa6b
Merge branch 'master' into v130
jaredhendrickson13 Aug 10, 2021
80abfba
Added /api/v1/system/api/version endpoint to pull package version dat…
jaredhendrickson13 Aug 10, 2021
8cd8dd0
Added unit test for the /api/v1/system/api/version endpoint
jaredhendrickson13 Aug 10, 2021
507e16c
Added Update UI page to make API updates easier and more apparent
jaredhendrickson13 Aug 10, 2021
e63e296
Added release date and release link to UI update page
jaredhendrickson13 Aug 10, 2021
a4dc4a8
Changed minor formatting on /api/update/ page and added ability to re…
jaredhendrickson13 Aug 11, 2021
ecf56ca
Removed 2.4 conditions from APIServicesDHCPdLeaseRead.inc
jaredhendrickson13 Aug 11, 2021
b8730f6
Created /api/v1/diagnostics/command_prompt endpoint to remotely run s…
jaredhendrickson13 Aug 11, 2021
2dc4a1a
Added documentation for /api/v1/diagnostics/command_prompt endpoint
jaredhendrickson13 Aug 11, 2021
80b0418
Minor documentation adjustments and doc regen
jaredhendrickson13 Aug 11, 2021
21c3610
Created unit test for /api/v1/diagnostics/command_prompt endpoint
jaredhendrickson13 Aug 11, 2021
73d57c2
Fixed issue that exceeded Github API rate limits within APISystemAPIV…
jaredhendrickson13 Aug 11, 2021
4937526
Made minor adjustments to help text on /api/update/ UI page
jaredhendrickson13 Aug 12, 2021
59ac259
Added /api/v1/status/openvpn endpoint, documentation and unit test
jaredhendrickson13 Aug 13, 2021
88d7fa7
endpoints and models for OpenVPN Client Specific Overrides
Aug 16, 2021
0b93f8c
unit tests and minor changes
Aug 16, 2021
bad4e97
newline at end of unit test file
Aug 16, 2021
d840f1b
fixed wrong classnames
Aug 17, 2021
e59947c
testing
Aug 17, 2021
d514014
fixed typo
Aug 17, 2021
fa41672
fixed another typo
Aug 17, 2021
f5a6c33
non numeric server ids in server_list are just ignored
Aug 17, 2021
77c8560
server_list is now put in as is. It is only cast to string
Aug 17, 2021
b0b1735
generated documentation
Aug 18, 2021
a56b7af
generated documentation was weird so retry
Aug 18, 2021
b26fca8
replaced new broken readme with old readme
Aug 18, 2021
ba96525
replaced new bad index with old index
Aug 19, 2021
1e4a3ea
Added /api/v1/system/console endpoint to toggle password protected co…
jaredhendrickson13 Sep 25, 2021
574e530
Added /api/v1/interface/bridge endpoint to configure bridge interface…
jaredhendrickson13 Sep 25, 2021
7da1e33
Added /api/v1/services/unbound/access_list and /api/v1/services/unbou…
jaredhendrickson13 Sep 26, 2021
b136cc6
Added documentation for /api/v1/services/unbound/access_list endpoint
jaredhendrickson13 Sep 27, 2021
c4d9a40
Added documentation for /api/v1/services/unbound/access_list/row endp…
jaredhendrickson13 Sep 27, 2021
09a0836
Fixed bug that prevented 0 value system tunables from being set
jaredhendrickson13 Sep 27, 2021
cf442cd
Fixed bug that prevent DHCP Server from being updated when pfSense wa…
jaredhendrickson13 Sep 27, 2021
e157d22
Added bridge assignment test to tests/test_api_v1_interface.py
jaredhendrickson13 Sep 27, 2021
6542d9f
Moved existing /api/v1/routing/gateway to /api/v1/routing/gateway/det…
jaredhendrickson13 Sep 27, 2021
940c38f
Removed pfSense 2.4 specific conditions on APIInterfaceDelete.inc
jaredhendrickson13 Sep 27, 2021
9b7edca
Removed pfSense 2.4 specific conditions on APISystemDNSRead.inc
jaredhendrickson13 Sep 27, 2021
1219409
Removed pfSense 2.4 specific conditions from APISystemDNSUpdate.inc
jaredhendrickson13 Sep 27, 2021
7744211
Removed 2.4 references from documentation
jaredhendrickson13 Sep 27, 2021
2969a8d
Revamped /api/v1/system/ca endpoint to allow creation of internal and…
jaredhendrickson13 Sep 28, 2021
49cc607
Created /api/v1/firewall/rule/flush endpoint to delete all firewall r…
jaredhendrickson13 Sep 28, 2021
d31f09e
Updated documentation for /api/v1/system/ca to include all fields
jaredhendrickson13 Sep 28, 2021
0afbb25
Revamped /api/v1/system/certificate endpoint to allow internal certif…
jaredhendrickson13 Sep 29, 2021
f2eca41
Updated documentation for /api/v1/system/certificate endpoint
jaredhendrickson13 Sep 29, 2021
d4939b2
Updated APISystemCertificateDelete.inc to prevent deletion of certifi…
jaredhendrickson13 Sep 29, 2021
50bb493
Prevented user certificates from being set as the UI certificate in A…
jaredhendrickson13 Sep 29, 2021
71db054
Updated APIUserCreate.inc and APIUserUpdate.inc to allow assignment o…
jaredhendrickson13 Sep 29, 2021
5fe0562
Merge branch 'v130' into openvpn
jaredhendrickson13 Sep 29, 2021
d748eb4
Merge pull request #154 from Tristanhx/openvpn
jaredhendrickson13 Sep 29, 2021
73cf891
Fixed minor inconsistencies in openvpn csc feature
jaredhendrickson13 Sep 29, 2021
fbba0b5
Updated unit test for openvpn csc to test_api_v1_services_openvpn_csc…
jaredhendrickson13 Sep 29, 2021
f9208f5
Updated OpenVPN client specific override endpoints to actually reload…
jaredhendrickson13 Sep 29, 2021
beb22ff
Fixed bug that allowed non-numeric firewall rule trackers to be valid…
jaredhendrickson13 Sep 29, 2021
b13208d
Added /api/v1/system/notifications/email endpoint to update and read …
jaredhendrickson13 Sep 29, 2021
cb30311
Minor documentation corrections, updated /api/v1/system/config to all…
jaredhendrickson13 Sep 30, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,414 changes: 1,858 additions & 556 deletions README.md

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,17 @@ changes to the configuration by updating it's values. If you do make changes to
`$this->write_config()` to apply them.
- `$this->id` : A property to track the current instances configuration ID. This is primarily helpful for updating and
deleting objects.
- `$this->validate_id` : A boolean to dictate whether the model object should require validation of the configuraiton ID.
- `$this->validate_id` : A boolean to dictate whether the model object should require validation of the configuration ID.
This defaults to true, but can be useful for nested model object calls where you would like to validate a payload before
it's parent is created. It is entirely up to you to implement this property if desired.
- `$this->retain_read_mode` : A boolean to dictate whether this model should respect the API's read only setting if
set. If set to `false`, the model will be considered a read only model and will be allowed to answer requests when the
API is in read only mode, even if the request is not a GET request. Defaults to `true`.
- `$this->ignore_ifs` : A boolean to dictate whether or not this model should respect the allowed interfaces API
setting. If set to `true`, the model will be allowed to answer API requests regardless of the interface the request was
received on. Defaults to `false`.
- `$this->ignore_enabled` : A boolean to dictate whether or not this model should respect the API's enabled setting. If
set to true, this model will be allowed to answer API requests even if the API is disabled. Defaults to `false`.

#### Reading and Writing to pfSense's XML Configuration ####
Included in the API framework are properties and methods to read and write to pfSense's XML configuration. Please note
Expand Down
5 changes: 2 additions & 3 deletions docs/SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ Below are versions that are currently supported and will receive security update

| Version | Supported |
| ------- | ------------------ |
| 1.3.x | :white_check_mark: |
| 1.2.x | :white_check_mark: |
| 1.1.x | :white_check_mark: |
| 1.0.x | :x: |

| 1.1.x | :x: |

## Reporting a Vulnerability

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php
// Copyright 2021 Jared Hendrickson
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

require_once("api/framework/APIEndpoint.inc");

class APIDiagnosticsCommandPrompt extends APIEndpoint {
public function __construct() {
$this->url = "/api/v1/diagnostics/command_prompt";
}

protected function post() {
return (new APIDiagnosticsCommandPromptCreate())->call();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
// Copyright 2021 Jared Hendrickson
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

require_once("api/framework/APIEndpoint.inc");

class APIFirewallRuleFlush extends APIEndpoint {
public function __construct() {
$this->url = "/api/v1/firewall/rule/flush";
}

protected function delete() {
return (new APIFirewallRuleFlushDelete())->call();
}

}
38 changes: 38 additions & 0 deletions pfSense-pkg-API/files/etc/inc/api/endpoints/APIInterfaceBridge.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php
// Copyright 2021 Jared Hendrickson
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

require_once("api/framework/APIEndpoint.inc");

class APIInterfaceBridge extends APIEndpoint {
public function __construct() {
$this->url = "/api/v1/interface/bridge";
}

protected function get() {
return (new APIInterfaceBridgeRead())->call();
}

protected function post() {
return (new APIInterfaceBridgeCreate())->call();
}

protected function put() {
return (new APIInterfaceBridgeUpdate())->call();
}

protected function delete() {
return (new APIInterfaceBridgeDelete())->call();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class APIRoutingGateway extends APIEndpoint {
}

protected function get() {
return (new APIRoutingGatewayRead())->call();
return (new APIRoutingGatewayDetailRead())->call();
}

protected function post() {
Expand All @@ -35,4 +35,4 @@ class APIRoutingGateway extends APIEndpoint {
protected function delete() {
return (new APIRoutingGatewayDelete())->call();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php
// Copyright 2021 Jared Hendrickson
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

require_once("api/framework/APIEndpoint.inc");

class APIRoutingGatewayDetail extends APIEndpoint {
public function __construct() {
$this->url = "/api/v1/routing/gateway/detail";
}

protected function get() {
return (new APIRoutingGatewayDetailRead())->call();
}
}
26 changes: 26 additions & 0 deletions pfSense-pkg-API/files/etc/inc/api/endpoints/APIServicesDnsmasq.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php
// Copyright 2021 Jared Hendrickson
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

require_once("api/framework/APIEndpoint.inc");

class APIServicesDnsmasq extends APIEndpoint {
public function __construct() {
$this->url = "/api/v1/services/dnsmasq";
}

protected function get() {
return (new APIServicesDnsmasqRead())->call();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php
// Copyright 2021 Jared Hendrickson
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

require_once("api/framework/APIEndpoint.inc");

class APIServicesDnsmasqApply extends APIEndpoint {
public function __construct() {
$this->url = "/api/v1/services/dnsmasq/apply";
}

protected function post() {
return (new APIServicesDnsmasqApplyCreate())->call();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php
// Copyright 2021 Jared Hendrickson
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

require_once("api/framework/APIEndpoint.inc");

class APIServicesDnsmasqHostOverride extends APIEndpoint {
public function __construct() {
$this->url = "/api/v1/services/dnsmasq/host_override";
}

protected function get() {
return (new APIServicesDnsmasqHostOverrideRead())->call();
}
protected function post() {
return (new APIServicesDnsmasqHostOverrideCreate())->call();
}

protected function put() {
return (new APIServicesDnsmasqHostOverrideUpdate())->call();
}

protected function delete() {
return (new APIServicesDnsmasqHostOverrideDelete())->call();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php
// Copyright 2021 Jared Hendrickson
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

require_once("api/framework/APIEndpoint.inc");

class APIServicesDnsmasqHostOverrideAlias extends APIEndpoint {
public function __construct() {
$this->url = "/api/v1/services/dnsmasq/host_override/alias";
}

protected function post() {
return (new APIServicesDnsmasqHostOverrideAliasCreate())->call();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php
// Copyright 2021 Jared Hendrickson
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

require_once("api/framework/APIEndpoint.inc");

class APIServicesDnsmasqRestart extends APIEndpoint {
public function __construct() {
$this->url = "/api/v1/services/dnsmasq/restart";
}

protected function post() {
return (new APIServicesDnsmasqRestartCreate())->call();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php
// Copyright 2021 Jared Hendrickson
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

require_once("api/framework/APIEndpoint.inc");

class APIServicesDnsmasqStart extends APIEndpoint {
public function __construct() {
$this->url = "/api/v1/services/dnsmasq/start";
}

protected function post() {
return (new APIServicesDnsmasqStartCreate())->call();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php
// Copyright 2021 Jared Hendrickson
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

require_once("api/framework/APIEndpoint.inc");

class APIServicesDnsmasqStop extends APIEndpoint {
public function __construct() {
$this->url = "/api/v1/services/dnsmasq/stop";
}

protected function post() {
return (new APIServicesDnsmasqStopCreate())->call();
}
}
Loading