Skip to content

Commit d7c41c1

Browse files
Merge pull request #115 from jaredhendrickson13/v130
v1.3.0
2 parents ad249d8 + cb30311 commit d7c41c1

114 files changed

Lines changed: 12684 additions & 1594 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 1858 additions & 556 deletions
Large diffs are not rendered by default.

docs/CONTRIBUTING.md

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

129137
#### Reading and Writing to pfSense's XML Configuration ####
130138
Included in the API framework are properties and methods to read and write to pfSense's XML configuration. Please note

docs/SECURITY.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ Below are versions that are currently supported and will receive security update
66

77
| Version | Supported |
88
| ------- | ------------------ |
9+
| 1.3.x | :white_check_mark: |
910
| 1.2.x | :white_check_mark: |
10-
| 1.1.x | :white_check_mark: |
11-
| 1.0.x | :x: |
12-
11+
| 1.1.x | :x: |
1312

1413
## Reporting a Vulnerability
1514

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
// Copyright 2021 Jared Hendrickson
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// http://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
16+
require_once("api/framework/APIEndpoint.inc");
17+
18+
class APIDiagnosticsCommandPrompt extends APIEndpoint {
19+
public function __construct() {
20+
$this->url = "/api/v1/diagnostics/command_prompt";
21+
}
22+
23+
protected function post() {
24+
return (new APIDiagnosticsCommandPromptCreate())->call();
25+
}
26+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
// Copyright 2021 Jared Hendrickson
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// http://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
16+
require_once("api/framework/APIEndpoint.inc");
17+
18+
class APIFirewallRuleFlush extends APIEndpoint {
19+
public function __construct() {
20+
$this->url = "/api/v1/firewall/rule/flush";
21+
}
22+
23+
protected function delete() {
24+
return (new APIFirewallRuleFlushDelete())->call();
25+
}
26+
27+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
// Copyright 2021 Jared Hendrickson
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// http://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
16+
require_once("api/framework/APIEndpoint.inc");
17+
18+
class APIInterfaceBridge extends APIEndpoint {
19+
public function __construct() {
20+
$this->url = "/api/v1/interface/bridge";
21+
}
22+
23+
protected function get() {
24+
return (new APIInterfaceBridgeRead())->call();
25+
}
26+
27+
protected function post() {
28+
return (new APIInterfaceBridgeCreate())->call();
29+
}
30+
31+
protected function put() {
32+
return (new APIInterfaceBridgeUpdate())->call();
33+
}
34+
35+
protected function delete() {
36+
return (new APIInterfaceBridgeDelete())->call();
37+
}
38+
}

pfSense-pkg-API/files/etc/inc/api/endpoints/APIRoutingGateway.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class APIRoutingGateway extends APIEndpoint {
2121
}
2222

2323
protected function get() {
24-
return (new APIRoutingGatewayRead())->call();
24+
return (new APIRoutingGatewayDetailRead())->call();
2525
}
2626

2727
protected function post() {
@@ -35,4 +35,4 @@ class APIRoutingGateway extends APIEndpoint {
3535
protected function delete() {
3636
return (new APIRoutingGatewayDelete())->call();
3737
}
38-
}
38+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
// Copyright 2021 Jared Hendrickson
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// http://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
16+
require_once("api/framework/APIEndpoint.inc");
17+
18+
class APIRoutingGatewayDetail extends APIEndpoint {
19+
public function __construct() {
20+
$this->url = "/api/v1/routing/gateway/detail";
21+
}
22+
23+
protected function get() {
24+
return (new APIRoutingGatewayDetailRead())->call();
25+
}
26+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
// Copyright 2021 Jared Hendrickson
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// http://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
16+
require_once("api/framework/APIEndpoint.inc");
17+
18+
class APIServicesDnsmasq extends APIEndpoint {
19+
public function __construct() {
20+
$this->url = "/api/v1/services/dnsmasq";
21+
}
22+
23+
protected function get() {
24+
return (new APIServicesDnsmasqRead())->call();
25+
}
26+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
// Copyright 2021 Jared Hendrickson
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// http://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
16+
require_once("api/framework/APIEndpoint.inc");
17+
18+
class APIServicesDnsmasqApply extends APIEndpoint {
19+
public function __construct() {
20+
$this->url = "/api/v1/services/dnsmasq/apply";
21+
}
22+
23+
protected function post() {
24+
return (new APIServicesDnsmasqApplyCreate())->call();
25+
}
26+
}

0 commit comments

Comments
 (0)