From 4b2e7f5aa69078205bca6b765b762a7b30b81302 Mon Sep 17 00:00:00 2001
From: Mark Tearle <mtearle@ucc.asn.au>
Date: Mon, 18 Jan 2021 21:36:24 +0800
Subject: [PATCH] Start working out REST service from desec.io to call

---
 quovadis/quovadis.php | 36 +++++++++++++++++++++++++++++++++++-
 1 file changed, 35 insertions(+), 1 deletion(-)

diff --git a/quovadis/quovadis.php b/quovadis/quovadis.php
index 854a53b..a26fc44 100644
--- a/quovadis/quovadis.php
+++ b/quovadis/quovadis.php
@@ -6,7 +6,7 @@ error_reporting(E_ALL);
 
 require_once 'config.php';
 use Ramsey\Uuid\Uuid;
-
+use RestService\RestService;
 
 function check_username($username) {
 	// returns true if we get some info about the username
@@ -23,6 +23,40 @@ function check_challenge($challenge) {
 	return 1;
 }
 
+// methods to alter and update desec.io
+
+//
+// curl -X PUT https://desec.io/api/v1/domains/{name}/rrsets/{subname}/{type}/ \
+//    --header "Authorization: Token {token}" \
+//    --header "Content-Type: application/json" --data @- <<EOF
+//    {
+//      "subname": "{subname}",
+//      "type": "{type}",
+//      "ttl": 3600,
+//      "records": ["..."]
+//    }
+// EOF
+//
+
+function update_desec_txt($name, $txt) {
+
+	$restService = new RestService();
+
+// $response = $restService
+//     ->setEndpoint('https://jsonplaceholder.typicode.com')
+//    ->get('/posts/1');
+
+// $restService
+//     ->setEndpoint('https://jsonplaceholder.typicode.com')
+//     ->put('/posts/1',
+//         [
+//             'id' => 1,
+//             'text' => 'Test'
+//         ]
+//     );
+	
+}
+
 // Instantiate Leaf
 $leaf = new Leaf\App;
 
-- 
GitLab