Skip to content

Commit

Permalink
refactor: serials to kinds and upgrade to keripy version (WebOfTrust#294
Browse files Browse the repository at this point in the history
)

* Fixed imports from keri to use core instead of coring. Salter Encrypter Decrypter all moved
so import from core instead of core.coring

* Refactor Serials to Kinds to match keripy

* Updated encrypter.encrypt call signature to support latest changes in keripy Encrypter to support all types of ciphers.

* build: update to latest keripy version

---------

Co-authored-by: Samuel M Smith <sam@samuelsmith.org>
  • Loading branch information
iFergal and SmithSamuelM authored Sep 19, 2024
1 parent 529b468 commit 7152dbb
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
python_requires='>=3.12.2',
install_requires=[
'hio>=0.6.14',
'keri==1.2.0.dev11',
'keri==1.2.0.dev13',
'mnemonic>=0.21',
'multicommand>=1.0.0',
'falcon>=3.1.3',
Expand Down
4 changes: 2 additions & 2 deletions src/keria/app/indirecting.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from keri.app import httping
from keri.core import eventing
from keri.core.coring import Ilks, Sadder
from keri.kering import Protocols
from keri.kering import Protocols, Kinds

CESR_DESTINATION_HEADER = "CESR-DESTINATION"

Expand Down Expand Up @@ -78,7 +78,7 @@ def on_post(self, req, rep):
rep.set_header('connection', "close")

cr = httping.parseCesrHttpRequest(req=req)
serder = Sadder(ked=cr.payload, kind=eventing.Serials.json)
serder = Sadder(ked=cr.payload, kind=Kinds.json)
msg = bytearray(serder.raw)
msg.extend(cr.attachments.encode("utf-8"))

Expand Down
6 changes: 3 additions & 3 deletions src/keria/testing/testing_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,9 @@ def inceptRandy(bran, count=1, sith="1", wits=None, toad="0"):

creator = keeping.RandyCreator()
signers = creator.create(count=count)
prxs = [encrypter.encrypt(matter=signer).qb64 for signer in signers]
prxs = [encrypter.encrypt(prim=signer).qb64 for signer in signers]
nsigners = creator.create(count=count)
nxts = [encrypter.encrypt(matter=signer).qb64 for signer in nsigners]
nxts = [encrypter.encrypt(prim=signer).qb64 for signer in nsigners]

keys = [signer.verfer.qb64 for signer in signers]
ndigs = [coring.Diger(ser=nsigner.verfer.qb64b) for nsigner in nsigners]
Expand Down Expand Up @@ -422,7 +422,7 @@ def interact(pre, bran, pidx, ridx, sn, dig, data):
signers = creator.create(pidx=pidx, ridx=ridx, tier=coring.Tiers.low, temp=False, count=1)
sigers = [signer.sign(ser=serder.raw, index=0).qb64 for signer in signers]
return serder, sigers

@staticmethod
def createRotate(aid, salt, signers, pidx, ridx, kidx, wits, toad):
salter = core.Salter(raw=salt)
Expand Down
10 changes: 5 additions & 5 deletions tests/app/test_aiding.py
Original file line number Diff line number Diff line change
Expand Up @@ -793,8 +793,8 @@ def test_identifier_collection_end(helpers):
ndigs=[diger.qb64 for diger in ndigs])

sigers = [signer.sign(ser=serder.raw, index=0).qb64 for signer in signers]
prxs = [encrypter.encrypt(matter=signer).qb64 for signer in signers]
nxts = [encrypter.encrypt(matter=signer).qb64 for signer in nsigners]
prxs = [encrypter.encrypt(prim=signer).qb64 for signer in signers]
nxts = [encrypter.encrypt(prim=signer).qb64 for signer in nsigners]

body = {'rot': serder.ked,
'sigs': sigers,
Expand Down Expand Up @@ -883,8 +883,8 @@ def test_identifier_collection_end(helpers):
)

sigers = [signer.sign(ser=serder.raw, index=0).qb64 for signer in signers]
prxs = [encrypter.encrypt(matter=signer).qb64 for signer in signers]
nxts = [encrypter.encrypt(matter=signer).qb64 for signer in nsigners]
prxs = [encrypter.encrypt(prim=signer).qb64 for signer in signers]
nxts = [encrypter.encrypt(prim=signer).qb64 for signer in nsigners]

body = {'rot': serder.ked,
'sigs': sigers,
Expand Down Expand Up @@ -1722,4 +1722,4 @@ def test_rotation(helpers):
# rotate aid3
body = helpers.createRotate(aid=aid3, salt=salt, signers=signers3, pidx=3, ridx=1, kidx=3, wits=wits3, toad=toad3)
res = client.simulate_post(path=f"/identifiers/{aid3['name']}/events", body=json.dumps(body))
assert res.status_code == 200
assert res.status_code == 200

0 comments on commit 7152dbb

Please sign in to comment.