Skip to content

Commit

Permalink
Merge pull request #618 from jaredhendrickson13/next_minor
Browse files Browse the repository at this point in the history
v2.3.0 Features & Fixes
  • Loading branch information
jaredhendrickson13 authored Dec 18, 2024
2 parents 2bbd123 + d333b43 commit 591b571
Show file tree
Hide file tree
Showing 31 changed files with 1,084 additions and 199 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ jobs:
PFSENSE_VERSION: "2.7.2"
- FREEBSD_VERSION: FreeBSD-15.0-CURRENT
PFSENSE_VERSION: "24.03"
- FREEBSD_VERSION: FreeBSD-15.0-CURRENT
PFSENSE_VERSION: "24.11"

steps:
- uses: actions/checkout@v4
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ Install on pfSense Plus:
pkg-static -C /dev/null add https://github.com/jaredhendrickson13/pfsense-api/releases/latest/download/pfSense-24.03-pkg-RESTAPI.pkg
```

## Support for pfSense Plus 24.11
> [!WARNING]
> 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).
> Installation of the package on unsupported versions of pfSense may result in unexpected behavior and/or system instability.
Working on supporting in https://github.com/jaredhendrickson13/pfsense-api/discussions/610

> [!IMPORTANT]
> [!TIP]
> You may need to customize the installation command to reference the package built for your pfSense version. Check
> the [releases page](https://github.com/jaredhendrickson13/pfsense-api/releases) to find the package built for
> your version of pfSense.
Expand Down
290 changes: 140 additions & 150 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions docs/INSTALL_AND_CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ run pfSense. It's recommended to follow Netgate's [minimum hardware requirements

- pfSense CE 2.7.2
- pfSense Plus 24.03
- pfSense Plus 24.11

!!! Warning
Installation of the package on unsupported versions of pfSense may result in unexpected behavior and/or system instability.

!!! Tip
Don't see your version of pfSense? Older versions of pfSense may be supported by older versions of this package.
Check the [releases page](https://github.com/jaredhendrickson13/pfsense-api/releases).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,14 @@ class Auth {
public function authorize(): bool {
# Variables
$is_not_authorized = false;
$this->client_privileges = get_user_privileges(getUserEntry($this->username));

# Start with pfSense 24.11, getUserEntry returns an array with the key 'item' containing the user data.
# We need to handle both cases to support both.
$user_ent = getUserEntry($this->username);
$user_ent = array_key_exists('item', $user_ent) ? $user_ent['item'] : $user_ent;

# Obtain the client's privileges and check if they have the required privileges
$this->client_privileges = get_user_privileges($user_ent);

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

0 comments on commit 591b571

Please sign in to comment.