Skip to content

Commit 5f06007

Browse files
authored
Update reference to KERI in development branches to point to the now published development releases of KERI on PyPi. (WebOfTrust#226)
Fixed broken tests from recent PRs and KERI branch confusion. Signed-off-by: pfeairheller <pfeairheller@gmail.com>
1 parent eeafb71 commit 5f06007

File tree

3 files changed

+20
-14
lines changed

3 files changed

+20
-14
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
python_requires='>=3.12.2',
7777
install_requires=[
7878
'hio>=0.6.12',
79-
'keri @ git+https://git@github.com/weboftrust/keripy.git@development',
79+
'keri>=1.2.0-dev0',
8080
'mnemonic>=0.20',
8181
'multicommand>=1.0.0',
8282
'falcon>=3.1.3',

src/keria/app/aiding.py

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ def on_get(req, rep):
296296

297297
end = start + (len(res) - 1) if len(res) > 0 else 0
298298
rep.set_header("Accept-Ranges", "aids")
299-
rep.set_header("Content-Range", f"aids {start}-{end}/{count-1}")
299+
rep.set_header("Content-Range", f"aids {start}-{end}/{count - 1}")
300300
rep.content_type = "application/json"
301301
rep.data = json.dumps(res).encode("utf-8")
302302

@@ -483,17 +483,19 @@ def on_put(self, req, rep, name):
483483
raise falcon.HTTPNotFound(title=f"No AID with name {name} found")
484484
body = req.get_media()
485485
newName = body.get("name")
486-
habord = hab.db.habs.get(keys=name)
487-
hab.db.habs.put(keys=newName,
488-
val=habord)
489-
hab.db.habs.rem(keys=name)
486+
habord = hab.db.habs.get(keys=(hab.pre,))
487+
habord.name = newName
488+
hab.db.habs.pin(keys=(hab.pre,),
489+
val=habord)
490+
hab.db.names.pin(keys=("", newName), val=hab.pre)
491+
hab.db.names.rem(keys=("", name))
490492
hab.name = newName
491493
hab = agent.hby.habByName(newName)
492494
data = info(hab, agent.mgr, full=True)
493495
rep.status = falcon.HTTP_200
494496
rep.content_type = "application/json"
495497
rep.data = json.dumps(data).encode("utf-8")
496-
498+
497499
def on_delete(self, req, rep, name):
498500
""" Identifier delete endpoint
499501
@@ -509,7 +511,7 @@ def on_delete(self, req, rep, name):
509511
hab = agent.hby.habByName(name)
510512
if hab is None:
511513
raise falcon.HTTPNotFound(title=f"No AID with name {name} found")
512-
hab.db.habs.rem(keys=name)
514+
agent.hby.deleteHab(name)
513515
rep.status = falcon.HTTP_200
514516

515517
def on_post(self, req, rep, name):
@@ -532,7 +534,7 @@ def on_post(self, req, rep, name):
532534
op = self.interact(agent, name, body)
533535
else:
534536
raise falcon.HTTPBadRequest(title="invalid request",
535-
description=f"required field 'rot' or 'ixn' missing from request")
537+
description=f"required field 'rot' or 'ixn' missing from request")
536538

537539
rep.status = falcon.HTTP_200
538540
rep.content_type = "application/json"
@@ -709,7 +711,8 @@ def on_get(req, rep, name):
709711
if role in (kering.Roles.witness,): # Fetch URL OOBIs for all witnesses
710712
oobis = []
711713
for wit in hab.kever.wits:
712-
urls = hab.fetchUrls(eid=wit, scheme=kering.Schemes.http) or hab.fetchUrls(eid=wit, scheme=kering.Schemes.https)
714+
urls = hab.fetchUrls(eid=wit, scheme=kering.Schemes.http) or hab.fetchUrls(eid=wit,
715+
scheme=kering.Schemes.https)
713716
if not urls:
714717
raise falcon.HTTPNotFound(description=f"unable to query witness {wit}, no http endpoint")
715718

@@ -719,7 +722,8 @@ def on_get(req, rep, name):
719722
res["oobis"] = oobis
720723
elif role in (kering.Roles.controller,): # Fetch any controller URL OOBIs
721724
oobis = []
722-
urls = hab.fetchUrls(eid=hab.pre, scheme=kering.Schemes.http) or hab.fetchUrls(eid=hab.pre, scheme=kering.Schemes.https)
725+
urls = hab.fetchUrls(eid=hab.pre, scheme=kering.Schemes.http) or hab.fetchUrls(eid=hab.pre,
726+
scheme=kering.Schemes.https)
723727
if not urls:
724728
raise falcon.HTTPNotFound(description=f"unable to query controller {hab.pre}, no http endpoint")
725729

@@ -728,7 +732,10 @@ def on_get(req, rep, name):
728732
oobis.append(urljoin(up.geturl(), f"/oobi/{hab.pre}/controller"))
729733
res["oobis"] = oobis
730734
elif role in (kering.Roles.agent,): # Fetch URL OOBIs for all witnesses
731-
roleUrls = hab.fetchRoleUrls(cid=hab.pre, role=kering.Roles.agent, scheme=kering.Schemes.http) or hab.fetchRoleUrls(cid=hab.pre, role=kering.Roles.agent, scheme=kering.Schemes.https)
735+
roleUrls = hab.fetchRoleUrls(cid=hab.pre, role=kering.Roles.agent,
736+
scheme=kering.Schemes.http) or hab.fetchRoleUrls(cid=hab.pre,
737+
role=kering.Roles.agent,
738+
scheme=kering.Schemes.https)
732739
if kering.Roles.agent not in roleUrls:
733740
res['oobis'] = []
734741
else:

tests/app/test_aiding.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ def test_identifier_collection_end(helpers):
376376
'salty': {'stem': 'signify:aid', 'pidx': 0, 'tier': 'low', 'sxlt': sxlt,
377377
'icodes': [MtrDex.Ed25519_Seed], 'ncodes': [MtrDex.Ed25519_Seed]}
378378
}
379-
res = client.simulate_put(path="/identifiers/aid1", body=json.dumps(body))
379+
res = client.simulate_post(path="/identifiers/aid1/events", body=json.dumps(body))
380380
assert res.status_code == 500
381381

382382
# Test with witnesses
@@ -419,7 +419,6 @@ def test_identifier_collection_end(helpers):
419419
assert res.status_code == 200
420420
assert res.json['done'] is False
421421

422-
423422
assert len(agent.witners) == 1
424423
res = client.simulate_get(path="/identifiers")
425424
assert res.status_code == 200

0 commit comments

Comments
 (0)