fix return OpResponse json, fix TXT record deletion #36

Merged
cloudymax merged 2 commits from refs/pull/36/head into main 2026-06-23 18:48:48 +00:00
cloudymax commented 2026-06-23 18:45:16 +00:00 (Migrated from git.smallhack.org)
  1. Fix issue where TXT records would not be deleted. Turns out you have to explicitly include double-quotes in the string match

    This one fails:

    "remove": [
      {
        "name": "_acme-challenge.test",
        "ttl": 600,
        "type": "TXT",
        "value": "1234-everybody-walk-the-dinosaur"
      }
    ],
    

    This one works:

    "remove": [
      {
        "name": "_acme-challenge.test",
        "ttl": 600,
        "type": "TXT",
        "value": "\"1234-everybody-walk-the-dinosaur\""
      }
    ],
    
  2. Fix issue with the ZoneOpResponse struct which caused incomplete return output to be displayed:

    Before:

    {
      "code": 0,
      "desc": "",
      "maintenance": false
    }
    

    After:

    {
      "code": 0,
      "data": {
        "success": true
      },
      "desc": "",
      "maintenance": false
    }
    
  3. In test.sh ZONEID can now be retrieved from output and doesnt need to be expliccitly exported.

    export ZONEID=$(curl -sX GET \
         "https://api.openprovider.eu/v1beta/dns/zones?name_pattern=${FULL_DOMAIN}" \
         -H "Authorization: Bearer ${TOKEN}" |jq -r '.data.results[0].id')
    
1. Fix issue where TXT records would not be deleted. Turns out you have to explicitly include double-quotes in the string match This one fails: ```json "remove": [ { "name": "_acme-challenge.test", "ttl": 600, "type": "TXT", "value": "1234-everybody-walk-the-dinosaur" } ], ``` This one works: ```json "remove": [ { "name": "_acme-challenge.test", "ttl": 600, "type": "TXT", "value": "\"1234-everybody-walk-the-dinosaur\"" } ], ``` 2. Fix issue with the `ZoneOpResponse` struct which caused incomplete return output to be displayed: Before: ```json { "code": 0, "desc": "", "maintenance": false } ``` After: ```json { "code": 0, "data": { "success": true }, "desc": "", "maintenance": false } ``` 3. In `test.sh` ZONEID can now be retrieved from output and doesnt need to be expliccitly exported. ```bash export ZONEID=$(curl -sX GET \ "https://api.openprovider.eu/v1beta/dns/zones?name_pattern=${FULL_DOMAIN}" \ -H "Authorization: Bearer ${TOKEN}" |jq -r '.data.results[0].id') ```
jessebot (Migrated from git.smallhack.org) approved these changes 2026-06-23 18:48:26 +00:00
Sign in to join this conversation.
No description provided.