Skip to content

Commit

Permalink
Small docker and OOBI fixes (WebOfTrust#619)
Browse files Browse the repository at this point in the history
* Fix a few old creder field references not caught in tests.

Signed-off-by: pfeairheller <[email protected]>

* Update OOBI processing to fail gracefully with a broken URL

Signed-off-by: pfeairheller <[email protected]>

---------

Signed-off-by: pfeairheller <[email protected]>
  • Loading branch information
pfeairheller authored Dec 3, 2023
1 parent 5fd24cb commit 4e7dd7b
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 8 deletions.
12 changes: 10 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@

.PHONY: build-keri
build-keri:
@docker build --no-cache -f images/keripy.dockerfile --tag gleif/keri:1.0.0 .
@docker buildx build --platform=linux/amd64 --no-cache -f images/keripy.dockerfile --tag weboftrust/keri:1.1.0 .

.PHONY: build-witness-demo
build-witness-demo:
@docker build --no-cache -f images/witness.demo.dockerfile --tag gleif/keri-witness-demo:1.0.0 .
@@docker buildx build --platform=linux/amd64 --no-cache -f images/witness.demo.dockerfile --tag weboftrust/keri-witness-demo:1.1.0 .

.PHONY: publish-keri
publish-keri:
@docker push weboftrust/keri --all-tags

.PHONY: publish-keri-witness-demo
publish-keri-witness-demo:
@docker push weboftrust/keri-witness-demo --all-tags
2 changes: 1 addition & 1 deletion images/witness.demo.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM gleif/keri:1.0.0
FROM gleif/keri:1.1.0

SHELL ["/bin/bash", "-c"]
EXPOSE 5632
Expand Down
12 changes: 8 additions & 4 deletions src/keri/app/httping.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,14 @@ def __init__(self):
def request(self, method, url, body=None, headers=None):
purl = parse.urlparse(url)

client = http.clienting.Client(scheme=purl.scheme,
hostname=purl.hostname,
port=purl.port,
portOptional=True)
try:
client = http.clienting.Client(scheme=purl.scheme,
hostname=purl.hostname,
port=purl.port,
portOptional=True)
except Exception as e:
print(f"error establishing client connection={e}")
return None

client.request(
method=method,
Expand Down
13 changes: 12 additions & 1 deletion src/keri/app/oobiing.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,13 @@ def processClients(self):
except (kering.ValidationError, ValueError):
pass

serder = serdering.SerderKERI(raw=bytearray(response["body"]))
try:
serder = serdering.SerderKERI(raw=bytearray(response["body"]))
except ValueError:
obr.state = Result.failed
self.hby.db.coobi.rem(keys=(url,))
self.hby.db.roobi.put(keys=(url,), val=obr)
continue
if not serder.ked['t'] == coring.Ilks.rpy:
obr.state = Result.failed
self.hby.db.coobi.rem(keys=(url,))
Expand Down Expand Up @@ -512,6 +518,11 @@ def processRetries(self):

def request(self, url, obr):
client = self.clienter.request("GET", url=url)
if client is None:
self.hby.db.oobis.rem(keys=(url,))
print(f"error getting client for {url}, aborting OOBI")
return

self.clients[url] = client
self.hby.db.oobis.rem(keys=(url,))
self.hby.db.coobi.pin(keys=(url,), val=obr)
Expand Down

0 comments on commit 4e7dd7b

Please sign in to comment.