Skip to content

Commit

Permalink
Adding new class for non-keri event SADs. (#259)
Browse files Browse the repository at this point in the history
  • Loading branch information
pfeairheller authored Aug 11, 2022
1 parent 0cab7fc commit 25293e6
Show file tree
Hide file tree
Showing 52 changed files with 2,272 additions and 1,090 deletions.
3 changes: 3 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[run]
omit =
src/keri/app/cli/*
1 change: 0 additions & 1 deletion scripts/demo/basic/demo-witness-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ isSuccess

kli status --name witness-test --alias trans-wits

# TODO: Fix, this currently blocks because of a problem getting receipts from newly added witnesses.
kli rotate --name witness-test --alias trans-wits --witness-add Bgoq68HCmYNUDgOz4Skvlu306o_NY-NrYuKAVhk3Zh9c
isSuccess

Expand Down
3 changes: 1 addition & 2 deletions scripts/demo/vLEI/issue-xbrl-attestation.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash

# To run this script you need to run the following 2 commands in separate terminals:
# > kli agent demo --config-file demo-witness-oobis-schema
# To run this script you need to run the following command in a separate terminals:
# > kli witness demo
# and from the vLEI repo run:
# > vLEI-server -s ./schema/acdc -c ./samples/acdc/ -o ./samples/oobis/
Expand Down
5 changes: 4 additions & 1 deletion scripts/keri/cf/main/wan.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"dt": "2022-01-20T12:57:59.823350+00:00",
"curls": ["tcp://127.0.0.1:5632/", "http://127.0.0.1:5642/"],
"wan": {
"dt": "2022-01-20T12:57:59.823350+00:00",
"curls": ["tcp://127.0.0.1:5632/", "http://127.0.0.1:5642/"]
},
"iurls": [
]
}
5 changes: 4 additions & 1 deletion scripts/keri/cf/main/wes.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"wes": {
"dt": "2022-01-20T12:57:59.823350+00:00",
"curls": ["tcp://127.0.0.1:5634/", "http://127.0.0.1:5644/"]
},
"dt": "2022-01-20T12:57:59.823350+00:00",
"curls": ["tcp://127.0.0.1:5634/", "http://127.0.0.1:5644/"],
"iurls": [
]
}
5 changes: 4 additions & 1 deletion scripts/keri/cf/main/wil.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"wil": {
"dt": "2022-01-20T12:57:59.823350+00:00",
"curls": ["tcp://127.0.0.1:5633/", "http://127.0.0.1:5643/"]
},
"dt": "2022-01-20T12:57:59.823350+00:00",
"curls": ["tcp://127.0.0.1:5633/", "http://127.0.0.1:5643/"],
"iurls": [
]
}
6 changes: 2 additions & 4 deletions scripts/keri/cf/vlei-gar-oobis-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@
"iurls": [
"http://127.0.0.1:5642/oobi/BGKVzj4ve0VSd8z_AmvhLg4lqcC_9WYX90k03q-R_Ydo/controller",
"http://127.0.0.1:5643/oobi/BuyRFMideczFZoapylLIyCjSdhtqVb31wZkRKvPfNqkw/controller",
"http://127.0.0.1:5644/oobi/Bgoq68HCmYNUDgOz4Skvlu306o_NY-NrYuKAVhk3Zh9c/controller"
"http://127.0.0.1:5644/oobi/Bgoq68HCmYNUDgOz4Skvlu306o_NY-NrYuKAVhk3Zh9c/controller",
"http://127.0.0.1:7723/.well-known/keri/oobi/gleif-root?name=GLEIF%20Root"
],
"durls": [
"http://127.0.0.1:7723/oobi/E2RzmSCFmG2a5U2OqZF-yUobeSYkW-a3FsN82eZXMxY0",
"http://127.0.0.1:7723/oobi/Ehwr6tZh6XakKBKWQW07otQ9uCwg0g7CF-dPz9qb_fwQ",
"http://127.0.0.1:7723/oobi/EKrJtKr528-QBE9VkhKLwpXXGJ4YyVrzYWSkR7KpsNdw",
"http://127.0.0.1:7723/oobi/EWJkQCFvKuyxZi582yJPb0wcwuW3VXmFNuvbQuBpgmIs",
"http://127.0.0.1:7723/oobi/EWCeT9zTxaZkaC_3-amV2JtG6oUxNA36sCC0P5MI7Buw"
],
"nurls": [
{"alias": "GLEIF Root", "oobi": "http://127.0.0.1:7723/.well-known/keri/oobi/gleif-root"}
]
}
6 changes: 2 additions & 4 deletions scripts/keri/cf/vlei-lar-oobis-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@
"iurls": [
"http://127.0.0.1:5642/oobi/BGKVzj4ve0VSd8z_AmvhLg4lqcC_9WYX90k03q-R_Ydo/controller",
"http://127.0.0.1:5643/oobi/BuyRFMideczFZoapylLIyCjSdhtqVb31wZkRKvPfNqkw/controller",
"http://127.0.0.1:5644/oobi/Bgoq68HCmYNUDgOz4Skvlu306o_NY-NrYuKAVhk3Zh9c/controller"
"http://127.0.0.1:5644/oobi/Bgoq68HCmYNUDgOz4Skvlu306o_NY-NrYuKAVhk3Zh9c/controller",
"http://127.0.0.1:7723/.well-known/keri/oobi/gleif-root?name=GLEIF%20Root"
],
"durls": [
"http://127.0.0.1:7723/oobi/E2RzmSCFmG2a5U2OqZF-yUobeSYkW-a3FsN82eZXMxY0",
"http://127.0.0.1:7723/oobi/Ehwr6tZh6XakKBKWQW07otQ9uCwg0g7CF-dPz9qb_fwQ",
"http://127.0.0.1:7723/oobi/EKrJtKr528-QBE9VkhKLwpXXGJ4YyVrzYWSkR7KpsNdw",
"http://127.0.0.1:7723/oobi/EWJkQCFvKuyxZi582yJPb0wcwuW3VXmFNuvbQuBpgmIs",
"http://127.0.0.1:7723/oobi/EWCeT9zTxaZkaC_3-amV2JtG6oUxNA36sCC0P5MI7Buw"
],
"nurls": [
{"alias": "GLEIF Root", "oobi": "http://127.0.0.1:7723/.well-known/keri/oobi/E4tEHaAAg8LbvdyUwxchP9WO_lZ2vtXyyFFKmTxVGY9U"}
]
}
6 changes: 2 additions & 4 deletions scripts/keri/cf/vlei-qar-oobis-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@
"iurls": [
"http://127.0.0.1:5642/oobi/BGKVzj4ve0VSd8z_AmvhLg4lqcC_9WYX90k03q-R_Ydo/controller",
"http://127.0.0.1:5643/oobi/BuyRFMideczFZoapylLIyCjSdhtqVb31wZkRKvPfNqkw/controller",
"http://127.0.0.1:5644/oobi/Bgoq68HCmYNUDgOz4Skvlu306o_NY-NrYuKAVhk3Zh9c/controller"
"http://127.0.0.1:5644/oobi/Bgoq68HCmYNUDgOz4Skvlu306o_NY-NrYuKAVhk3Zh9c/controller",
"http://127.0.0.1:7723/.well-known/keri/oobi/gleif-external?name=GLEIF%20External"
],
"durls": [
"http://127.0.0.1:7723/oobi/E2RzmSCFmG2a5U2OqZF-yUobeSYkW-a3FsN82eZXMxY0",
"http://127.0.0.1:7723/oobi/Ehwr6tZh6XakKBKWQW07otQ9uCwg0g7CF-dPz9qb_fwQ",
"http://127.0.0.1:7723/oobi/EKrJtKr528-QBE9VkhKLwpXXGJ4YyVrzYWSkR7KpsNdw",
"http://127.0.0.1:7723/oobi/EWJkQCFvKuyxZi582yJPb0wcwuW3VXmFNuvbQuBpgmIs",
"http://127.0.0.1:7723/oobi/EWCeT9zTxaZkaC_3-amV2JtG6oUxNA36sCC0P5MI7Buw"
],
"nurls": [
{"alias": "GLEIF External", "oobi": "http://127.0.0.1:7723/.well-known/keri/oobi/gleif-external"}
]
}
8 changes: 3 additions & 5 deletions scripts/keri/cf/vlei-root-oobis-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,15 @@
"iurls": [
"http://127.0.0.1:5642/oobi/BGKVzj4ve0VSd8z_AmvhLg4lqcC_9WYX90k03q-R_Ydo/controller",
"http://127.0.0.1:5643/oobi/BuyRFMideczFZoapylLIyCjSdhtqVb31wZkRKvPfNqkw/controller",
"http://127.0.0.1:5644/oobi/Bgoq68HCmYNUDgOz4Skvlu306o_NY-NrYuKAVhk3Zh9c/controller"
"http://127.0.0.1:5644/oobi/Bgoq68HCmYNUDgOz4Skvlu306o_NY-NrYuKAVhk3Zh9c/controller",
"http://127.0.0.1:7723/.well-known/keri/oobi/gleif-external?name=GLEIF%20External",
"http://127.0.0.1:7723/.well-known/keri/oobi/gleif-internal?name=GLEIF%20Internal"
],
"durls": [
"http://127.0.0.1:7723/oobi/E2RzmSCFmG2a5U2OqZF-yUobeSYkW-a3FsN82eZXMxY0",
"http://127.0.0.1:7723/oobi/Ec7NSIUfktTAofFOSaXhnKHdOqoILdSLvvMtin9uQk_s",
"http://127.0.0.1:7723/oobi/EKrJtKr528-QBE9VkhKLwpXXGJ4YyVrzYWSkR7KpsNdw",
"http://127.0.0.1:7723/oobi/EWJkQCFvKuyxZi582yJPb0wcwuW3VXmFNuvbQuBpgmIs",
"http://127.0.0.1:7723/oobi/EWCeT9zTxaZkaC_3-amV2JtG6oUxNA36sCC0P5MI7Buw"
],
"nurls": [
{"alias": "GLEIF External", "oobi": "http://127.0.0.1:7723/.well-known/keri/oobi/gleif-external"},
{"alias": "GLEIF Internal", "oobi": "http://127.0.0.1:7723/.well-known/keri/oobi/gleif-internal"}
]
}
4 changes: 1 addition & 3 deletions src/keri/app/booting.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ def on_put(self, req, rep):
rep.data = json.dumps(body).encode("utf-8")


def setup(servery, controller="", configFile=None, configDir=None, insecure=True, tcp=5621, adminHttpPort=5623, path="",
def setup(servery, controller="", configFile=None, configDir=None, insecure=True, path="",
headDirPath=None):
""" Set up an agent in bootloader mode """
app = falcon.App(middleware=falcon.CORSMiddleware(
Expand All @@ -414,9 +414,7 @@ def setup(servery, controller="", configFile=None, configDir=None, insecure=True
kwargs = dict(
controller=controller,
insecure=insecure,
tcp=tcp,
staticPath=path,
adminHttpPort=adminHttpPort,
)

ends = loadEnds(app=app, configFile=configFile, configDir=configDir, path=path, servery=servery,
Expand Down
19 changes: 6 additions & 13 deletions src/keri/app/challenging.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,20 @@
keri.vc.challenging module
"""
import json

from hio.base import doing
from hio.help import decking


def loadHandlers(hby, exc, mbx, controller):
def loadHandlers(signaler, exc):
""" Load handlers for the peer-to-peer challenge response protocol
Parameters:
hby (Habery): Database and keystore for environment
signaler (Signaler): Signaler for transient messages for the controller of the agent
exc (Exchanger): Peer-to-peer message router
mbx (Mailboxer): Database for storing mailbox messages
controller (str): qb64 identifier prefix of controller
"""
chacha = ChallengeHandler(hby=hby, mbx=mbx, controller=controller)
chacha = ChallengeHandler(signaler=signaler)
exc.addHandler(chacha)


Expand All @@ -28,14 +25,12 @@ class ChallengeHandler(doing.Doer):

resource = "/challenge/response"

def __init__(self, hby, mbx, controller):
def __init__(self, signaler):
""" Initialize peer to peer challange response messsage """

self.hby = hby
self.mbx = mbx
self.controller = controller
self.msgs = decking.Deck()
self.cues = decking.Deck()
self.signaler = signaler
super(ChallengeHandler, self).__init__()

def do(self, tymth, *, tock=0.0, **opts):
Expand All @@ -61,13 +56,11 @@ def do(self, tymth, *, tock=0.0, **opts):
words = payload["words"]

msg = dict(
r="/challenge",
signer=signer.qb64,
words=words
)

raw = json.dumps(msg).encode("utf-8")
self.mbx.storeMsg(self.controller+"/challenge", raw)
self.signaler.push(msg, topic="/challenge")

yield self.tock
yield self.tock
Expand Down
22 changes: 11 additions & 11 deletions src/keri/app/cli/commands/agent/vlei.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,72 +27,72 @@ def vlei(args):
rootGAR1 = booting.Servery(port=5620)
booting.setup(servery=rootGAR1, controller="E59KmDbpjK0tRf9Rmc7OlueZVz7LB94DdD3cjQVvPcng",
configFile="vlei-root-oobis-schema",
configDir="./scripts", insecure=True, tcp=5720, adminHttpPort=5620,
configDir="./scripts", insecure=True,
path=start.STATIC_DIR_PATH)
# RootGAR2
rootGAR2 = booting.Servery(port=5621)
booting.setup(servery=rootGAR2, controller="E59KmDbpjK0tRf9Rmc7OlueZVz7LB94DdD3cjQVvPcng",
configFile="vlei-root-oobis-schema",
configDir="./scripts", insecure=True, tcp=5721, adminHttpPort=5621,
configDir="./scripts", insecure=True,
path=start.STATIC_DIR_PATH)

# ExtGAR1
extGAR1 = booting.Servery(port=5622)
booting.setup(servery=extGAR1, controller="E59KmDbpjK0tRf9Rmc7OlueZVz7LB94DdD3cjQVvPcng",
configFile="vlei-gar-oobis-schema",
configDir="./scripts", insecure=True, tcp=5722, adminHttpPort=5622,
configDir="./scripts", insecure=True,
path=start.STATIC_DIR_PATH)
# ExtGAR2
extGAR2 = booting.Servery(port=5623)
booting.setup(servery=extGAR2, controller="E59KmDbpjK0tRf9Rmc7OlueZVz7LB94DdD3cjQVvPcng",
configFile="vlei-gar-oobis-schema",
configDir="./scripts", insecure=True, tcp=5723, adminHttpPort=5623,
configDir="./scripts", insecure=True,
path=start.STATIC_DIR_PATH)

# IntGAR1
intGAR1 = booting.Servery(port=5624)
booting.setup(servery=intGAR1, controller="E59KmDbpjK0tRf9Rmc7OlueZVz7LB94DdD3cjQVvPcng",
configFile="vlei-gar-oobis-schema",
configDir="./scripts", insecure=True, tcp=5724, adminHttpPort=5624,
configDir="./scripts", insecure=True,
path=start.STATIC_DIR_PATH)
# IntGAR2
intGAR2 = booting.Servery(port=5625)
booting.setup(servery=intGAR2, controller="E59KmDbpjK0tRf9Rmc7OlueZVz7LB94DdD3cjQVvPcng",
configFile="vlei-gar-oobis-schema",
configDir="./scripts", insecure=True, tcp=5725, adminHttpPort=5625,
configDir="./scripts", insecure=True,
path=start.STATIC_DIR_PATH)

# QAR1
qar1 = booting.Servery(port=5626)
booting.setup(servery=qar1, controller="E59KmDbpjK0tRf9Rmc7OlueZVz7LB94DdD3cjQVvPcng",
configFile="vlei-qar-oobis-schema",
configDir="./scripts", insecure=True, tcp=5726, adminHttpPort=5626,
configDir="./scripts", insecure=True,
path=start.STATIC_DIR_PATH)
# QAR2
qar2 = booting.Servery(port=5627)
booting.setup(servery=qar2, controller="E59KmDbpjK0tRf9Rmc7OlueZVz7LB94DdD3cjQVvPcng",
configFile="vlei-qar-oobis-schema",
configDir="./scripts", insecure=True, tcp=5727, adminHttpPort=5627,
configDir="./scripts", insecure=True,
path=start.STATIC_DIR_PATH)

# LAR1
lar1 = booting.Servery(port=5628)
booting.setup(servery=lar1, controller="E59KmDbpjK0tRf9Rmc7OlueZVz7LB94DdD3cjQVvPcng",
configFile="vlei-qar-oobis-schema",
configDir="./scripts", insecure=True, tcp=5728, adminHttpPort=5628,
configDir="./scripts", insecure=True,
path=start.STATIC_DIR_PATH)
# LAR2
lar2 = booting.Servery(port=5629)
booting.setup(servery=lar2, controller="E59KmDbpjK0tRf9Rmc7OlueZVz7LB94DdD3cjQVvPcng",
configFile="vlei-qar-oobis-schema",
configDir="./scripts", insecure=True, tcp=5729, adminHttpPort=5629,
configDir="./scripts", insecure=True,
path=start.STATIC_DIR_PATH)

# Person
person = booting.Servery(port=5630)
booting.setup(servery=person, controller="E59KmDbpjK0tRf9Rmc7OlueZVz7LB94DdD3cjQVvPcng",
configFile="vlei-qar-oobis-schema",
configDir="./scripts", insecure=True, tcp=5730, adminHttpPort=5630,
configDir="./scripts", insecure=True,
path=start.STATIC_DIR_PATH)

return [rootGAR1, rootGAR2, extGAR1, extGAR2, intGAR1, intGAR2, qar1, qar2, lar1, lar2, person]
5 changes: 1 addition & 4 deletions src/keri/app/cli/commands/challenge/verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,10 @@
from hio import help
from hio.base import doing

from keri import kering
from keri.app import indirecting, challenging, storing, connecting
from keri.app.cli.common import existing, terming
from keri.core import scheming
from keri.app.cli.common import existing
from keri.help import helping
from keri.peer import exchanging
from keri.vdr import credentialing, verifying

logger = help.ogler.getLogger()

Expand Down
11 changes: 4 additions & 7 deletions src/keri/app/cli/commands/oobi/resolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
parser.add_argument('--name', '-n', help='keystore name and file location of KERI keystore', required=True)
parser.add_argument('--base', '-b', help='additional optional prefix to file location of KERI keystore',
required=False, default="")
parser.add_argument('--alias', '-a', help='human readable alias for the new identifier prefix', required=False,
default=None)
parser.add_argument("--oobi", "-o", help="out-of-band introduciton to load", required=True)
parser.add_argument("--oobi-alias", dest="oobiAlias", help="alias for AID resolved from out-of-band introduciton",
required=False, default=None)
Expand All @@ -44,10 +42,9 @@ def resolve(args):
base = args.base
bran = args.bran
oobi = args.oobi
alias = args.alias
oobiAlias = args.oobiAlias

icpDoer = OobiDoer(name=name, oobi=oobi, bran=bran, base=base, alias=alias, oobiAlias=oobiAlias)
icpDoer = OobiDoer(name=name, oobi=oobi, bran=bran, base=base, oobiAlias=oobiAlias)

doers = [icpDoer]
return doers
Expand All @@ -56,18 +53,18 @@ def resolve(args):
class OobiDoer(doing.DoDoer):
""" DoDoer for loading oobis and waiting for the results """

def __init__(self, name, oobi, alias, oobiAlias, bran=None, base=None):
def __init__(self, name, oobi, oobiAlias, bran=None, base=None):

self.processed = 0

self.hby = existing.setupHby(name=name, base=base, bran=bran)
self.hbyDoer = habbing.HaberyDoer(habery=self.hby)

self.obl = oobiing.OobiLoader(hby=self.hby)
if alias is None or oobiAlias is None:
if oobiAlias is None:
msg = dict(url=oobi)
else:
msg = dict(alias=alias, oobialias=oobiAlias, url=oobi)
msg = dict(oobialias=oobiAlias, url=oobi)

self.obl.queue([msg])

Expand Down
1 change: 1 addition & 0 deletions src/keri/app/cli/kli.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ def main():
print(f"ERR: {ex}")
return -1


if __name__ == "__main__":
main()
Loading

0 comments on commit 25293e6

Please sign in to comment.