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

refactor: serials to kinds and upgrade to keripy version #294

Merged
Prev Previous commit
Next Next commit
Updated encrypter.encrypt call signature to support latest changes in…
… keripy Encrypter to support all types of ciphers.
SmithSamuelM committed Aug 5, 2024
commit 7cf2465655ba3534acf99d770c75af46b1c6d1a2
10 changes: 5 additions & 5 deletions src/keria/testing/testing_helper.py
Original file line number Diff line number Diff line change
@@ -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]
@@ -422,13 +422,13 @@ 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)
creator = keeping.SaltyCreator(salt=salter.qb64, stem="signify:aid", tier=coring.Tiers.low)
encrypter = core.Encrypter(verkey=signers[0].verfer.qb64)
sxlt = encrypter.encrypt(salter.qb64).qb64
sxlt = encrypter.encrypt(ser=salter.qb64).qb64

rsigners = creator.create(pidx=pidx, ridx=ridx, tier=coring.Tiers.low, temp=False, count=1)
rnsigners = creator.create(pidx=pidx, ridx=ridx+1, tier=coring.Tiers.low, temp=False, count=1)
@@ -468,7 +468,7 @@ def createAid(client, name, salt, wits=None, toad="0", delpre=None):

salter = core.Salter(raw=salt)
encrypter = core.Encrypter(verkey=signers[0].verfer.qb64)
sxlt = encrypter.encrypt(salter.qb64).qb64
sxlt = encrypter.encrypt(ser=salter.qb64).qb64

sigers = [signer.sign(ser=serder.raw, index=0).qb64 for signer in signers]

18 changes: 9 additions & 9 deletions tests/app/test_aiding.py
Original file line number Diff line number Diff line change
@@ -293,7 +293,7 @@ def test_identifier_collection_end(helpers):

salter = core.Salter(raw=salt)
encrypter = core.Encrypter(verkey=signers[0].verfer.qb64)
sxlt = encrypter.encrypt(salter.qb64).qb64
sxlt = encrypter.encrypt(ser=salter.qb64).qb64

body = {'name': 'aid1',
'icp': serder.ked,
@@ -782,8 +782,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,
@@ -872,8 +872,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,
@@ -913,7 +913,7 @@ def test_identifier_collection_end(helpers):

salter = core.Salter(raw=salt)
encrypter = core.Encrypter(verkey=signers[0].verfer.qb64)
sxlt = encrypter.encrypt(salter.qb64).qb64
sxlt = encrypter.encrypt(ser=salter.qb64).qb64

sigers = [signer.sign(ser=serder.raw, index=0).qb64 for signer in signers]

@@ -1307,7 +1307,7 @@ def test_identifier_resource_end(helpers):
sigers = [signer.sign(ser=serder.raw, index=0).qb64 for signer in signers]
salter = core.Salter(raw=salt)
encrypter = core.Encrypter(verkey=signers[0].verfer.qb64)
sxlt = encrypter.encrypt(salter.qb64).qb64
sxlt = encrypter.encrypt(ser=salter.qb64).qb64

body = {'name': 'aid1',
'icp': serder.ked,
@@ -1589,7 +1589,7 @@ def test_rotation(helpers):

salter = core.Salter(raw=salt)
encrypter = core.Encrypter(verkey=signers1[0].verfer.qb64)
sxlt = encrypter.encrypt(salter.qb64).qb64
sxlt = encrypter.encrypt(ser=salter.qb64).qb64

bodyid1 = {'name': 'aid1',
'icp': serder1.ked,
@@ -1707,4 +1707,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