Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HA Sync fields cannot be set via /api/v1/system/api #290

Closed
jaredhendrickson13 opened this issue Oct 18, 2022 · 0 comments · Fixed by #289
Closed

HA Sync fields cannot be set via /api/v1/system/api #290

jaredhendrickson13 opened this issue Oct 18, 2022 · 0 comments · Fixed by #289
Labels
bug Something isn't working

Comments

@jaredhendrickson13
Copy link
Owner

Describe the bug
The hasync_hosts, hasync_username and hasync_password fields are not being set during PUT requests to /api/v1/system/api. This is because the field validation is not using isset($this->validated_data["hasync"]) to trigger the logic and is instead using $this->validated_data["hasync"] which never triggers because pfSense stores the value as an empty string.

To Reproduce

curl -s -k -u admin:pfsense -X PUT https://localhost/api/v1/system/api -d '{"hasync": true, "hasync_hosts": ["127.0.0.1"], "hasync_username": "admin", "hasync_password": "pfsense"}'

Expected behavior
Whenever hasync is set to true, the hasync_hosts, hasync_username and hasync_password fields should become required. Instead, they are being skipped entirely.

pfSense Version & Package Version:

  • pfSense Version: All
  • Package Version v1.5.0 and earlier

Affected Endpoints:

  • /api/v1/system/api
@jaredhendrickson13 jaredhendrickson13 added the bug Something isn't working label Oct 18, 2022
@jaredhendrickson13 jaredhendrickson13 linked a pull request Oct 18, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant