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

/system/notifications/email returns nothing #196

Closed
ccl0utier opened this issue Feb 8, 2022 · 1 comment · Fixed by #200
Closed

/system/notifications/email returns nothing #196

ccl0utier opened this issue Feb 8, 2022 · 1 comment · Fixed by #200
Assignees
Labels
bug Something isn't working

Comments

@ccl0utier
Copy link

ccl0utier commented Feb 8, 2022

While testing the API, trying to get email notification settings from my configured pfSense returns nothing, despite everything else working perfectly well.

Did I miss anything?

pfSense Details

Community Edition
image

pfSense API Version

image

pfSense Notifications configuration

image

GET on endpoint: /api/v1/system/notifications/email returns:

image

CURL request details

❯ curl -v -s -k "Content-Type: application/json" -d '{"client-id": "61646d696e", "client-token": "<some_client_token>"}' -X GET https://pfsense/api/v1/system/notifications/email
* Closing connection -1
*   Trying 192.168.1.200...
* TCP_NODELAY set
* Connected to pfsense (192.168.1.200) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/cert.pem
  CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* ALPN, server accepted to use h2
* Server certificate:
*  subject: C=CA; ST=QC; L=<REDACTED>; CN=pfsense
*  start date: Apr 21 20:17:08 2017 GMT
*  expire date: Apr 19 20:17:08 2027 GMT
*  issuer: C=CA; ST=QC; L=<REDACTED>
*  SSL certificate verify result: self signed certificate in certificate chain (19), continuing anyway.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x7f80ba00ca00)
> GET /api/v1/system/notifications/email HTTP/2
> Host: pfsense
> User-Agent: curl/7.64.1
> Accept: */*
> Content-Length: 79
> Content-Type: application/x-www-form-urlencoded
>
* Connection state changed (MAX_CONCURRENT_STREAMS == 128)!
* We are completely uploaded and fine
< HTTP/2 200
< server: nginx
< date: Tue, 08 Feb 2022 14:12:00 GMT
< content-type: application/json
< referer: no-referrer
< strict-transport-security: max-age=31536000
< x-content-type-options: nosniff
<
{"status":"ok","code":200,"return":0,"message":"Success","data":[]}
* Connection #0 to host pfsense left intact
* Closing connection 0
@jaredhendrickson13
Copy link
Owner

Hey!

Thanks for pointing this out. Looks like this is a bug. The code is not populating the return data before the data is returned by the API. I'll have this patched in the next release this weekend.

Thanks!

@jaredhendrickson13 jaredhendrickson13 added the bug Something isn't working label Feb 20, 2022
@jaredhendrickson13 jaredhendrickson13 self-assigned this Feb 20, 2022
@jaredhendrickson13 jaredhendrickson13 linked a pull request Feb 20, 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.

2 participants