summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordu.net>2015-08-20 17:35:25 +0200
committerLinus Nordberg <linus@nordu.net>2015-08-20 17:35:25 +0200
commit03b95596ecc425cfbb0d29d40ba9accbc9e67729 (patch)
tree500fc13e4f7731444b80bef5e93570dea21f36cd
parentb9694d350c5a9db0730772334b65b13532eec545 (diff)
Follow internal HTTP API URL changes.internal-api
-rw-r--r--tools/certtools.py2
-rwxr-xr-xtools/compileconfig.py44
-rwxr-xr-xtools/merge.py26
3 files changed, 36 insertions, 36 deletions
diff --git a/tools/certtools.py b/tools/certtools.py
index dfd5b24..307a728 100644
--- a/tools/certtools.py
+++ b/tools/certtools.py
@@ -308,7 +308,7 @@ def http_request(url, data=None, key=None, verifynode=None, publickeydir="."):
def get_signature(baseurl, data, key=None):
try:
params = json.dumps({"plop_version":1, "data": base64.b64encode(data)})
- result = http_request(baseurl + "ct/signing/sth", params, key=key)
+ result = http_request(baseurl + "plop/v1/signing/sth", params, key=key)
parsed_result = json.loads(result)
return base64.b64decode(parsed_result.get(u"result"))
except urllib2.HTTPError, e:
diff --git a/tools/compileconfig.py b/tools/compileconfig.py
index d493226..eb0ddc6 100755
--- a/tools/compileconfig.py
+++ b/tools/compileconfig.py
@@ -115,21 +115,21 @@ def gen_http_servers(nodetype, nodeconfig, bind_address, bind_publicaddress, bin
def allowed_clients_frontend(mergenodenames, primarymergenode):
return [
- ("/ct/frontend/sendentry", mergenodenames),
- ("/ct/frontend/sendlog", mergenodenames),
- ("/ct/frontend/sendsth", [primarymergenode]),
- ("/ct/frontend/currentposition", mergenodenames),
- ("/ct/frontend/missingentries", mergenodenames),
+ ("/plop/v1/frontend/sendentry", mergenodenames),
+ ("/plop/v1/frontend/sendlog", mergenodenames),
+ ("/plop/v1/frontend/sendsth", [primarymergenode]),
+ ("/plop/v1/frontend/currentposition", mergenodenames),
+ ("/plop/v1/frontend/missingentries", mergenodenames),
]
def allowed_clients_mergesecondary(primarymergenode):
return [
- ("/catlfish/merge/sendentry", [primarymergenode]),
- ("/catlfish/merge/sendlog", [primarymergenode]),
- ("/catlfish/merge/verifyroot", [primarymergenode]),
- ("/catlfish/merge/verifiedsize", [primarymergenode]),
- ("/catlfish/merge/setverifiedsize", [primarymergenode]),
- ("/catlfish/merge/missingentries", [primarymergenode]),
+ ("/plop/v1/merge/sendentry", [primarymergenode]),
+ ("/plop/v1/merge/sendlog", [primarymergenode]),
+ ("/plop/v1/merge/verifyroot", [primarymergenode]),
+ ("/plop/v1/merge/verifiedsize", [primarymergenode]),
+ ("/plop/v1/merge/setverifiedsize", [primarymergenode]),
+ ("/plop/v1/merge/missingentries", [primarymergenode]),
]
def allowed_clients_public():
@@ -147,23 +147,23 @@ def allowed_clients_public():
def allowed_clients_signing(frontendnodenames, primarymergenode):
return [
- ("/ct/signing/sct", frontendnodenames),
- ("/ct/signing/sth", [primarymergenode]),
+ ("/plop/v1/signing/sct", frontendnodenames),
+ ("/plop/v1/signing/sth", [primarymergenode]),
]
def allowed_clients_storage(frontendnodenames, mergenodenames):
return [
- ("/ct/storage/sendentry", frontendnodenames),
- ("/ct/storage/entrycommitted", frontendnodenames),
- ("/ct/storage/fetchnewentries", mergenodenames),
- ("/ct/storage/getentry", mergenodenames),
+ ("/plop/v1/storage/sendentry", frontendnodenames),
+ ("/plop/v1/storage/entrycommitted", frontendnodenames),
+ ("/plop/v1/storage/fetchnewentries", mergenodenames),
+ ("/plop/v1/storage/getentry", mergenodenames),
]
def allowed_servers_frontend(signingnodenames, storagenodenames):
return [
- ("/ct/storage/sendentry", storagenodenames),
- ("/ct/storage/entrycommitted", storagenodenames),
- ("/ct/signing/sct", signingnodenames),
+ ("/plop/v1/storage/sendentry", storagenodenames),
+ ("/plop/v1/storage/entrycommitted", storagenodenames),
+ ("/plop/v1/signing/sct", signingnodenames),
]
def parse_ratelimit_expression(expression):
@@ -263,10 +263,10 @@ def gen_config(nodename, config, localconfig):
]
signingnodes = config["signingnodes"]
- signingnodeaddresses = ["https://%s/ct/signing/" % node["address"] for node in config["signingnodes"]]
+ signingnodeaddresses = ["https://%s/plop/v1/signing/" % node["address"] for node in config["signingnodes"]]
mergenodenames = [node["name"] for node in config["mergenodes"]]
primarymergenode = config["primarymergenode"]
- storagenodeaddresses = ["https://%s/ct/storage/" % node["address"] for node in config["storagenodes"]]
+ storagenodeaddresses = ["https://%s/plop/v1/storage/" % node["address"] for node in config["storagenodes"]]
frontendnodenames = [node["name"] for node in config["frontendnodes"]]
allowed_clients = []
diff --git a/tools/merge.py b/tools/merge.py
index f02ce39..2065a2d 100755
--- a/tools/merge.py
+++ b/tools/merge.py
@@ -83,7 +83,7 @@ def fsync_logorder():
def get_new_entries(node, baseurl):
try:
- result = http_request(baseurl + "ct/storage/fetchnewentries", key=own_key, verifynode=node, publickeydir=paths["publickeys"])
+ result = http_request(baseurl + "plop/v1/storage/fetchnewentries", key=own_key, verifynode=node, publickeydir=paths["publickeys"])
parsed_result = json.loads(result)
if parsed_result.get(u"result") == u"ok":
return [base64.b64decode(entry) for entry in parsed_result[u"entries"]]
@@ -96,7 +96,7 @@ def get_new_entries(node, baseurl):
def get_entries(node, baseurl, hashes):
try:
params = urllib.urlencode({"hash":[base64.b64encode(hash) for hash in hashes]}, doseq=True)
- result = http_request(baseurl + "ct/storage/getentry?" + params, key=own_key, verifynode=node, publickeydir=paths["publickeys"])
+ result = http_request(baseurl + "plop/v1/storage/getentry?" + params, key=own_key, verifynode=node, publickeydir=paths["publickeys"])
parsed_result = json.loads(result)
if parsed_result.get(u"result") == u"ok":
entries = dict([(base64.b64decode(entry["hash"]), base64.b64decode(entry["entry"])) for entry in parsed_result[u"entries"]])
@@ -111,7 +111,7 @@ def get_entries(node, baseurl, hashes):
def get_curpos(node, baseurl):
try:
- result = http_request(baseurl + "ct/frontend/currentposition", key=own_key, verifynode=node, publickeydir=paths["publickeys"])
+ result = http_request(baseurl + "plop/v1/frontend/currentposition", key=own_key, verifynode=node, publickeydir=paths["publickeys"])
parsed_result = json.loads(result)
if parsed_result.get(u"result") == u"ok":
return parsed_result[u"position"]
@@ -123,7 +123,7 @@ def get_curpos(node, baseurl):
def get_verifiedsize(node, baseurl):
try:
- result = http_request(baseurl + "catlfish/merge/verifiedsize", key=own_key, verifynode=node, publickeydir=paths["publickeys"])
+ result = http_request(baseurl + "plop/v1/merge/verifiedsize", key=own_key, verifynode=node, publickeydir=paths["publickeys"])
parsed_result = json.loads(result)
if parsed_result.get(u"result") == u"ok":
return parsed_result[u"size"]
@@ -137,7 +137,7 @@ def get_verifiedsize(node, baseurl):
def sendlog(node, baseurl, submission):
try:
- result = http_request(baseurl + "ct/frontend/sendlog",
+ result = http_request(baseurl + "plop/v1/frontend/sendlog",
json.dumps(submission), key=own_key, verifynode=node, publickeydir=paths["publickeys"])
return json.loads(result)
except urllib2.HTTPError, e:
@@ -155,7 +155,7 @@ def sendlog(node, baseurl, submission):
def backup_sendlog(node, baseurl, submission):
try:
- result = http_request(baseurl + "catlfish/merge/sendlog",
+ result = http_request(baseurl + "plop/v1/merge/sendlog",
json.dumps(submission), key=own_key, verifynode=node, publickeydir=paths["publickeys"])
return json.loads(result)
except urllib2.HTTPError, e:
@@ -173,7 +173,7 @@ def backup_sendlog(node, baseurl, submission):
def sendentry(node, baseurl, entry, hash):
try:
- result = http_request(baseurl + "ct/frontend/sendentry",
+ result = http_request(baseurl + "plop/v1/frontend/sendentry",
json.dumps({"entry":base64.b64encode(entry), "treeleafhash":base64.b64encode(hash)}), key=own_key,
verifynode=node, publickeydir=paths["publickeys"])
return json.loads(result)
@@ -191,7 +191,7 @@ def sendentry(node, baseurl, entry, hash):
def sendentry_merge(node, baseurl, entry, hash):
try:
- result = http_request(baseurl + "catlfish/merge/sendentry",
+ result = http_request(baseurl + "plop/v1/merge/sendentry",
json.dumps({"entry":base64.b64encode(entry), "treeleafhash":base64.b64encode(hash)}), key=own_key,
verifynode=node, publickeydir=paths["publickeys"])
return json.loads(result)
@@ -209,7 +209,7 @@ def sendentry_merge(node, baseurl, entry, hash):
def sendsth(node, baseurl, submission):
try:
- result = http_request(baseurl + "ct/frontend/sendsth",
+ result = http_request(baseurl + "plop/v1/frontend/sendsth",
json.dumps(submission), key=own_key, verifynode=node, publickeydir=paths["publickeys"])
return json.loads(result)
except urllib2.HTTPError, e:
@@ -226,7 +226,7 @@ def sendsth(node, baseurl, submission):
def verifyroot(node, baseurl, treesize):
try:
- result = http_request(baseurl + "catlfish/merge/verifyroot",
+ result = http_request(baseurl + "plop/v1/merge/verifyroot",
json.dumps({"tree_size":treesize}), key=own_key, verifynode=node, publickeydir=paths["publickeys"])
return json.loads(result)
except urllib2.HTTPError, e:
@@ -243,7 +243,7 @@ def verifyroot(node, baseurl, treesize):
def setverifiedsize(node, baseurl, treesize):
try:
- result = http_request(baseurl + "catlfish/merge/setverifiedsize",
+ result = http_request(baseurl + "plop/v1/merge/setverifiedsize",
json.dumps({"size":treesize}), key=own_key, verifynode=node, publickeydir=paths["publickeys"])
return json.loads(result)
except urllib2.HTTPError, e:
@@ -260,7 +260,7 @@ def setverifiedsize(node, baseurl, treesize):
def get_missingentries(node, baseurl):
try:
- result = http_request(baseurl + "ct/frontend/missingentries", key=own_key, verifynode=node, publickeydir=paths["publickeys"])
+ result = http_request(baseurl + "plop/v1/frontend/missingentries", key=own_key, verifynode=node, publickeydir=paths["publickeys"])
parsed_result = json.loads(result)
if parsed_result.get(u"result") == u"ok":
return parsed_result[u"entries"]
@@ -272,7 +272,7 @@ def get_missingentries(node, baseurl):
def get_missingentriesforbackup(node, baseurl):
try:
- result = http_request(baseurl + "catlfish/merge/missingentries", key=own_key, verifynode=node, publickeydir=paths["publickeys"])
+ result = http_request(baseurl + "plop/v1/merge/missingentries", key=own_key, verifynode=node, publickeydir=paths["publickeys"])
parsed_result = json.loads(result)
if parsed_result.get(u"result") == u"ok":
return parsed_result[u"entries"]