Skip to content

Commit

Permalink
Update to reply message handling, allowing the client to communicate …
Browse files Browse the repository at this point in the history
…coordinated end role authorizations in multisig groups (#112)

Signed-off-by: pfeairheller <[email protected]>
  • Loading branch information
pfeairheller authored Sep 30, 2023
1 parent 2acb65b commit e2a6b96
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
3 changes: 3 additions & 0 deletions src/keria/app/agenting.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
from keri.core.coring import Ilks, randomNonce
from keri.db import dbing
from keri.db.basing import OobiRecord
from keri.vc import protocoling

from keria.end import ending
from keri.help import helping, ogler
from keri.peer import exchanging
Expand Down Expand Up @@ -324,6 +326,7 @@ def __init__(self, hby, rgy, agentHab, agency, caid, **opts):
handlers = [challengeHandler]
self.exc = exchanging.Exchanger(hby=hby, handlers=handlers)
grouping.loadHandlers(exc=self.exc, mux=self.mux)
protocoling.loadHandlers(hby=self.hby, exc=self.exc, rgy=self.rgy, notifier=self.notifier)

self.rvy = routing.Revery(db=hby.db, cues=self.cues)
self.kvy = eventing.Kevery(db=hby.db,
Expand Down
27 changes: 11 additions & 16 deletions src/keria/app/aiding.py
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,16 @@ class EndRoleCollectionEnd:

@staticmethod
def on_get(req, rep, name=None, aid=None, role=None):
""" GET endpoint for end role collection
Parameters:
req (Request): falcon HTTP request object
rep (Response): falcon HTTP response object
name (str): human readable alias for AID
aid (str): aid to use instead of name
role (str): optional role to search for
"""
agent = req.context.agent

if name is not None:
Expand Down Expand Up @@ -721,7 +731,7 @@ def on_get(req, rep, name=None, aid=None, role=None):

@staticmethod
def on_post(req, rep, name, aid=None, role=None):
"""
""" POST endpoint for end role collection
Args:
req (Request): Falcon HTTP request object
Expand Down Expand Up @@ -761,21 +771,6 @@ def on_post(req, rep, name, aid=None, role=None):
except kering.UnverifiedReplyError:
pass

if isinstance(hab, habbing.SignifyGroupHab):
seal = eventing.SealEvent(i=hab.kever.prefixer.qb64,
s=hex(hab.kever.lastEst.s),
d=hab.kever.lastEst.d)
msg = eventing.messagize(serder=rserder,
sigers=rsigers,
seal=seal,
pipelined=True)
atc = bytes(msg[rserder.size:])

others = [smid for smid in hab.db.signingMembers(hab.pre) if smid != hab.mhab.pre]
for o in others:
agent.postman.send(hab=agent.agentHab, dest=o, topic="multisig", serder=rserder,
attachment=atc)

oid = ".".join([pre, role, eid])
op = agent.monitor.submit(oid, longrunning.OpTypes.endrole, metadata=dict(cid=pre, role=role, eid=eid))

Expand Down

0 comments on commit e2a6b96

Please sign in to comment.