forked from WebOfTrust/keripy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New and updated kli commands for witnesss, watchers and mailboxes. De…
…legation fixes (WebOfTrust#805) * New kli commands for listing witnesss, watchers and mailboxes. Update to kli command `kli watcher add` to use new BADA-RUN protected data structures for tracking AIDs being observed by a watcher on behalf of a controller New kli command to perform key event adjudication across the set of watchers watching an AID. This command will retrieve updated key state if a threshold satisfying number watchers response with non-duplicitous key state change. Addition to rotate and delegate confirm to all the specification of witness auth code time stamps. Update to delegation processing to propagate the delegator anchor event to witnesses after delegation approval New databases to track observed AIDs (observed by watchers) and delegation propogation escrow. Bug fix in `kli mailbox debug` to account for empty local state. Signed-off-by: pfeairheller <[email protected]> * Factoring several classes and methods into a watching package including a new Adjudicator class that can be used outside of the KERIpy command line. Signed-off-by: pfeairheller <[email protected]> * Added tests for Adjudicator and diffState Signed-off-by: pfeairheller <[email protected]> --------- Signed-off-by: pfeairheller <[email protected]>
- Loading branch information
1 parent
4eb36e9
commit 48c637a
Showing
18 changed files
with
1,144 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# -*- encoding: utf-8 -*- | ||
""" | ||
KERI | ||
keri.kli.commands module | ||
""" | ||
import argparse | ||
|
||
from hio import help | ||
from hio.base import doing | ||
|
||
from keri.app import connecting | ||
from keri.app.cli.common import existing | ||
from keri.kering import ConfigurationError, Roles | ||
|
||
logger = help.ogler.getLogger() | ||
|
||
parser = argparse.ArgumentParser(description='List current mailboxes') | ||
parser.set_defaults(handler=lambda args: handle(args), | ||
transferable=True) | ||
parser.add_argument('--name', '-n', help='keystore name and file location of KERI keystore', required=True) | ||
parser.add_argument('--alias', '-a', help='human readable alias for the identifier to whom the credential was issued', | ||
required=True) | ||
parser.add_argument('--base', '-b', help='additional optional prefix to file location of KERI keystore', | ||
required=False, default="") | ||
parser.add_argument('--passcode', '-p', help='22 character encryption passcode for keystore (is not saved)', | ||
dest="bran", default=None) # passcode => bran | ||
|
||
|
||
def handle(args): | ||
""" Command line handler for adding an aid to a watcher's list of AIds to watch | ||
Parameters: | ||
args(Namespace): parsed command line arguments | ||
""" | ||
|
||
kwa = dict(args=args) | ||
return [doing.doify(listMailboxes, **kwa)] | ||
|
||
|
||
def listMailboxes(tymth, tock=0.0, **opts): | ||
""" Command line status handler | ||
""" | ||
_ = (yield tock) | ||
args = opts["args"] | ||
name = args.name | ||
alias = args.alias | ||
base = args.base | ||
bran = args.bran | ||
|
||
try: | ||
with existing.existingHby(name=name, base=base, bran=bran) as hby: | ||
org = connecting.Organizer(hby=hby) | ||
if alias is None: | ||
alias = existing.aliasInput(hby) | ||
|
||
hab = hby.habByName(alias) | ||
|
||
for (aid, role, eid), ender in hab.db.ends.getItemIter(keys=(hab.pre, Roles.mailbox)): | ||
if ender.allowed: | ||
contact = org.get(eid) | ||
print(f"{contact['alias']}: {eid}") | ||
|
||
except ConfigurationError as e: | ||
print(f"identifier prefix for {name} does not exist, incept must be run first", ) | ||
return -1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.