Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

End Role Authorization fix #112

Merged
merged 1 commit into from
Sep 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading