Skip to content

Commit

Permalink
Merge branch 'main' into issue-258
Browse files Browse the repository at this point in the history
  • Loading branch information
pfeairheller authored Jul 11, 2024
2 parents a539181 + 1232405 commit 959b6c3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 49 deletions.
2 changes: 1 addition & 1 deletion src/keria/app/agenting.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,7 @@ def __init__(self, kvy, rgy, rvy, tvy, exc, vry, registrar, credentialer, tock=0
self.registrar = registrar
self.credentialer = credentialer
self.tock = tock

super(Escrower, self).__init__(tock=self.tock)

def recur(self, tyme):
Expand All @@ -776,7 +777,6 @@ def recur(self, tyme):
self.vry.processEscrows()
self.registrar.processEscrows()
self.credentialer.processEscrows()

return False


Expand Down
36 changes: 0 additions & 36 deletions src/keria/app/aiding.py
Original file line number Diff line number Diff line change
Expand Up @@ -746,42 +746,6 @@ def on_put(self, req, rep, name):
rep.content_type = "application/json"
rep.data = json.dumps(data).encode("utf-8")

def on_delete(self, req, rep, name):
"""Identifier delete endpoint
Parameters:
req (Request): falcon.Request HTTP request object
rep (Response): falcon.Response HTTP response object
name (str): human-readable name for Hab to delete
---
summary: Delete an identifier.
description: This endpoint deletes an identifier by its name.
tags:
- Identifier
parameters:
- in: path
name: name
schema:
type: string
required: true
description: The human-readable name of the identifier.
responses:
200:
description: Successfully deleted the identifier.
400:
description: Bad request. This could be due to a missing or invalid name parameter.
404:
description: The requested identifier was not found.
"""
if not name:
raise falcon.HTTPBadRequest(description="name is required")
agent = req.context.agent
hab = agent.hby.habByName(name)
if hab is None:
raise falcon.HTTPNotFound(title=f"No AID with name {name} found")
agent.hby.deleteHab(name)
rep.status = falcon.HTTP_200

def on_post(self, req, rep, name):
"""Identifier events endpoint
Expand Down
15 changes: 4 additions & 11 deletions tests/app/test_aiding.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,13 +485,6 @@ def test_identifier_collection_end(helpers):
aid = res.json
assert aid["name"] == "aid3Renamed"

# delete aid3renamed
res = client.simulate_delete(path="/identifiers/aid3Renamed")
assert res.status_code == 200
res = client.simulate_get(path="/identifiers")
assert res.status_code == 200
assert len(res.json) == 2

# create member habs for group AID
p1 = p1hby.makeHab(name="p1")
assert p1.pre == "EBPtjiAY9ITdvScWFGeeCu3Pf6_CFFr57siQqffVt9Of"
Expand Down Expand Up @@ -619,8 +612,8 @@ def test_identifier_collection_end(helpers):

res = client.simulate_get(path="/identifiers")
assert res.status_code == 200
assert len(res.json) == 3
aid = res.json[2]
assert len(res.json) == 4
aid = res.json[3]
assert aid["name"] == "multisig"
assert aid["prefix"] == serder.pre
group = aid["group"]
Expand Down Expand Up @@ -688,8 +681,8 @@ def test_identifier_collection_end(helpers):
# Make sure keys got rotated
res = client.simulate_get(path="/identifiers")
assert res.status_code == 200
assert len(res.json) == 3
aid = res.json[2]
assert len(res.json) == 4
aid = res.json[3]
assert aid["name"] == "multisig"
assert aid["prefix"] == rserder.pre
group = aid["group"]
Expand Down
2 changes: 1 addition & 1 deletion tests/app/test_specing.py

Large diffs are not rendered by default.

0 comments on commit 959b6c3

Please sign in to comment.