Skip to content

Commit 591b571

Browse files
Merge pull request #618 from jaredhendrickson13/next_minor
v2.3.0 Features & Fixes
2 parents 2bbd123 + d333b43 commit 591b571

31 files changed

+1084
-199
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ jobs:
3030
PFSENSE_VERSION: "2.7.2"
3131
- FREEBSD_VERSION: FreeBSD-15.0-CURRENT
3232
PFSENSE_VERSION: "24.03"
33+
- FREEBSD_VERSION: FreeBSD-15.0-CURRENT
34+
PFSENSE_VERSION: "24.11"
3335

3436
steps:
3537
- uses: actions/checkout@v4

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ Install on pfSense Plus:
4545
pkg-static -C /dev/null add https://github.com/jaredhendrickson13/pfsense-api/releases/latest/download/pfSense-24.03-pkg-RESTAPI.pkg
4646
```
4747

48-
## Support for pfSense Plus 24.11
48+
> [!WARNING]
49+
> Before installing the package, always ensure your pfSense version is supported! Supported versions are listed [here](https://pfrest.org/INSTALL_AND_CONFIG/#supported-pfsense-versions).
50+
> Installation of the package on unsupported versions of pfSense may result in unexpected behavior and/or system instability.
4951
50-
Working on supporting in https://github.com/jaredhendrickson13/pfsense-api/discussions/610
51-
52-
> [!IMPORTANT]
52+
> [!TIP]
5353
> You may need to customize the installation command to reference the package built for your pfSense version. Check
5454
> the [releases page](https://github.com/jaredhendrickson13/pfsense-api/releases) to find the package built for
5555
> your version of pfSense.

composer.lock

Lines changed: 140 additions & 150 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/INSTALL_AND_CONFIG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ run pfSense. It's recommended to follow Netgate's [minimum hardware requirements
1616

1717
- pfSense CE 2.7.2
1818
- pfSense Plus 24.03
19+
- pfSense Plus 24.11
1920

21+
!!! Warning
22+
Installation of the package on unsupported versions of pfSense may result in unexpected behavior and/or system instability.
23+
2024
!!! Tip
2125
Don't see your version of pfSense? Older versions of pfSense may be supported by older versions of this package.
2226
Check the [releases page](https://github.com/jaredhendrickson13/pfsense-api/releases).

pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Core/Auth.inc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,14 @@ class Auth {
162162
public function authorize(): bool {
163163
# Variables
164164
$is_not_authorized = false;
165-
$this->client_privileges = get_user_privileges(getUserEntry($this->username));
165+
166+
# Start with pfSense 24.11, getUserEntry returns an array with the key 'item' containing the user data.
167+
# We need to handle both cases to support both.
168+
$user_ent = getUserEntry($this->username);
169+
$user_ent = array_key_exists('item', $user_ent) ? $user_ent['item'] : $user_ent;
170+
171+
# Obtain the client's privileges and check if they have the required privileges
172+
$this->client_privileges = get_user_privileges($user_ent);
166173

167174
# This client is not authorized if the client does not have at least one of the required privileges
168175
if ($this->required_privileges and !array_intersect($this->required_privileges, $this->client_privileges)) {

0 commit comments

Comments
 (0)