-
-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #225 from jaredhendrickson13/v141
v1.4.1 Fixes & Features
- Loading branch information
Showing
16 changed files
with
262 additions
and
265 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
pfSense-pkg-API/files/etc/inc/api/endpoints/APIInterfaceAvailable.inc
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
// Copyright 2022 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 APIInterfaceAvailable extends APIEndpoint { | ||
public function __construct() { | ||
$this->url = "/api/v1/interface/available"; | ||
} | ||
|
||
protected function get() { | ||
return (new APIInterfaceAvailableRead())->call(); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
pfSense-pkg-API/files/etc/inc/api/endpoints/APIServicesUnboundHostOverrideFlush.inc
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
// Copyright 2022 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 APIServicesUnboundHostOverrideFlush extends APIEndpoint { | ||
public function __construct() { | ||
$this->url = "/api/v1/services/unbound/host_override/flush"; | ||
} | ||
|
||
protected function delete() { | ||
return (new APIServicesUnboundHostOverrideFlushDelete())->call(); | ||
} | ||
} |
This file contains 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
31 changes: 31 additions & 0 deletions
31
pfSense-pkg-API/files/etc/inc/api/models/APIInterfaceAvailableRead.inc
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
// Copyright 2022 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/APIModel.inc"); | ||
require_once("api/framework/APIResponse.inc"); | ||
|
||
|
||
class APIInterfaceAvailableRead extends APIModel { | ||
# Create our method constructor | ||
public function __construct() { | ||
parent::__construct(); | ||
$this->privileges = ["page-all", "page-interfaces-assignnetworkports"]; | ||
|
||
} | ||
|
||
public function action() { | ||
return APIResponse\get(0, APITools\get_all_avail_interfaces()); | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
pfSense-pkg-API/files/etc/inc/api/models/APIServicesUnboundHostOverrideFlushDelete.inc
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
// Copyright 2022 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/APIModel.inc"); | ||
require_once("api/framework/APIResponse.inc"); | ||
|
||
class APIServicesUnboundHostOverrideFlushDelete extends APIModel { | ||
# Create our method constructor | ||
public function __construct() { | ||
parent::__construct(); | ||
$this->privileges = ["page-all", "page-services-dnsresolver-edithost"]; | ||
$this->change_note = "Flushed DNS Resolver host overrides via API"; | ||
} | ||
|
||
public function action() { | ||
# Capture the host overrides being deleted, if empty, default to empty array | ||
$this->validated_data = ($this->config["unbound"]["hosts"]) ?: []; | ||
|
||
# Remove the host overrides from the configuration | ||
unset($this->config["unbound"]["hosts"]); | ||
$this->write_config(); | ||
|
||
# Mark the Unbound subsystem as changed, but do not allow clients to immediately apply the change. | ||
mark_subsystem_dirty("unbound"); | ||
|
||
return APIResponse\get(0, $this->validated_data); | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
Binary file removed
BIN
-665 Bytes
pfSense-pkg-API/files/usr/local/www/api/documentation/favicon-16x16.png
Binary file not shown.
Binary file removed
BIN
-628 Bytes
pfSense-pkg-API/files/usr/local/www/api/documentation/favicon-32x32.png
Binary file not shown.
This file contains 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
Oops, something went wrong.