plugins icon indicating copy to clipboard operation
plugins copied to clipboard

[os-ddclient] Flexibility of custom POST/PUT requests

Open MikeBishop opened this issue 4 months ago • 0 comments

Important notices Before you add a new report, we ask you kindly to acknowledge the following:

  • [x] I have read the contributing guide lines at https://github.com/opnsense/plugins/blob/master/CONTRIBUTING.md
  • [x] I have searched the existing issues, open and closed, and I'm convinced that mine is new.
  • [x] When the request is meant for an existing plugin, I've added its name to the title.

Is your feature request related to a problem? Please describe. I can update my DNS provider's records with a PUT like this:

https://api.linode.com/:apiVersion/domains/:domainId/records/:recordId

{
  "target": "__MYIP__",
  "ttl_sec": 3600
}

However, I haven't been able to figure out how to produce a request like this from the "custom PUT" provider in OPNsense.

Looking at https://github.com/opnsense/plugins/blob/3a3984f01f9930bc70d5b7455515d28a293868c5/dns/ddclient/src/opnsense/scripts/ddclient/lib/account/dyndns2.py#L70, the custom PUT can't support this because it's lacking a couple of things:

  • There is no way to provide the payload of the PUT request; it apparently just sends an empty PUT?
  • Authentication is restricted to HTTP Basic, when my provider uses a Bearer token

Given the lack of a payload, it's unclear what providers the PUT or POST can successfully be used with, but I can't make claims about that because I don't know that someone doesn't accept an empty one.

Describe the solution you'd like I would like an input field (either new or an existing one repurposed) to be used a request body for PUT and POST requests. The same replacements that are currently done on the URI should be usable in this body as well (i.e. MYIP and HOSTNAME).

I would like a selection as to whether to use Basic or Bearer; in the Bearer case, the password field should be used as the Bearer token and the username field ignored.

Describe alternatives you've considered Running curl as a scheduled task. Using the os-caddy dynamic DNS functionality, which I then learned has been deprecated in favor of this plugin.

MikeBishop avatar Sep 03 '25 19:09 MikeBishop