Skip to content

Commit

Permalink
chore,test: upgrade to KERIpy 1.2.3 and fix tests; add docs (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
kentbull authored Jan 19, 2025
1 parent 5246899 commit 3350a14
Show file tree
Hide file tree
Showing 26 changed files with 368 additions and 251 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,17 @@ jobs:
os: [ macos-latest, ubuntu-latest ]

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.12.2
- uses: actions/checkout@v4.2.2
- name: Set up Python 3.12.6
uses: actions/setup-python@v2
with:
python-version: 3.12.2
python-version: 3.12.6
# This is needed so MacOS can find the libsodium library installed by Homebrew
- name: Install dependencies for MacOS
if: matrix.os == 'macos-latest'
run: |
export DYLD_LIBRARY_PATH="/usr/local/lib:/opt/homebrew/lib:$DYLD_LIBRARY_PATH"
echo "DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH" >> $GITHUB_ENV
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
4 changes: 2 additions & 2 deletions scripts/init_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import pytest
import requests
from keri import kering
from keri.core import coring, serdering
from keri.core import coring, serdering, signing
from keri.core.coring import Tiers

from signify.app.clienting import SignifyClient
Expand All @@ -22,7 +22,7 @@ def create_agent():

ims = input("Type of paste controller inception event:")
serder = serdering.SerderKERI(raw=ims.encode("utf-8"))
siger = coring.Siger(qb64=ims[serder.size:])
siger = signing.Siger(qb64=ims[serder.size:])

res = requests.post(url="http://localhost:3903/boot",
json=dict(
Expand Down
4 changes: 2 additions & 2 deletions scripts/join_new_multisig_issuer.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from time import sleep

from keri.core import eventing, coring, serdering
from keri.core import eventing, serdering, signing
from keri.core.coring import Tiers
from signify.app.clienting import SignifyClient

Expand Down Expand Up @@ -83,7 +83,7 @@ def accept_join_request(client, name, group):
op = groups.join(group, rot, sigs, gid, smids, rmids)

embeds = dict(
rot=eventing.messagize(serder=rot, sigers=[coring.Siger(qb64=sig) for sig in sigs])
rot=eventing.messagize(serder=rot, sigers=[signing.Siger(qb64=sig) for sig in sigs])
)

exchanges.send(name, "multisig", sender=hab, route="/multisig/rot",
Expand Down
4 changes: 2 additions & 2 deletions scripts/join_new_quadlet.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from time import sleep

from keri.core import eventing, coring, serdering
from keri.core import eventing, coring, serdering, signing
from keri.core.coring import Tiers
from signify.app.clienting import SignifyClient

Expand Down Expand Up @@ -80,7 +80,7 @@ def accept_join_request(client, name, group):
op = groups.join(group, rot, sigs, gid, smids, rmids)

embeds = dict(
rot=eventing.messagize(serder=rot, sigers=[coring.Siger(qb64=sig) for sig in sigs])
rot=eventing.messagize(serder=rot, sigers=[signing.Siger(qb64=sig) for sig in sigs])
)

exchanges.send(name, "multisig", sender=hab, route="/multisig/rot",
Expand Down
11 changes: 6 additions & 5 deletions scripts/multisig-create-credential.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from keri.app import signing
from keri.app.keeping import Algos
from keri.core import coring, eventing, serdering
from keri.core import signing as csigning
from keri.core.coring import Tiers
from signify.app.clienting import SignifyClient

Expand Down Expand Up @@ -106,7 +107,7 @@ def create_credential():
recp = [state['i'] for state in [multisig2, multisig1]]

embeds = dict(
icp=eventing.messagize(serder=icp, sigers=[coring.Siger(qb64=sig) for sig in isigs])
icp=eventing.messagize(serder=icp, sigers=[csigning.Siger(qb64=sig) for sig in isigs])
)

exchanges.send("multisig3", "multisig", sender=m3, route="/multisig/icp",
Expand Down Expand Up @@ -136,7 +137,7 @@ def create_credential():

embeds = dict(
vcp=vcp.raw,
anc=eventing.messagize(serder=anc, sigers=[coring.Siger(qb64=sig) for sig in rsigs])
anc=eventing.messagize(serder=anc, sigers=[csigning.Siger(qb64=sig) for sig in rsigs])
)

recp = ["EKYLUMmNPZeEs77Zvclf0bSN5IN-mLfLpx2ySb-HDlk4", "EJccSRTfXYF6wrUVuenAIHzwcx3hJugeiJsEKmndi5q1"]
Expand Down Expand Up @@ -170,7 +171,7 @@ def create_credential():
embeds = dict(
acdc=acdc,
iss=iss,
anc=eventing.messagize(serder=anc, sigers=[coring.Siger(qb64=sig) for sig in sigs])
anc=eventing.messagize(serder=anc, sigers=[csigning.Siger(qb64=sig) for sig in sigs])
)
exchanges.send("multisig3", "multisig", sender=m3, route="/multisig/iss",
payload=dict(gid=m["prefix"]),
Expand All @@ -184,12 +185,12 @@ def create_credential():
m = identifiers.get("multisig")
grant, sigs, end = ipex.grant(m, recp="ELjSFdrTdCebJlmvbFNX9-TLhR2PO0_60al1kQp5_e6k", acdc=acdc,
iss=iss, message="",
anc=eventing.messagize(serder=anc, sigers=[coring.Siger(qb64=sig) for sig in sigs]),
anc=eventing.messagize(serder=anc, sigers=[csigning.Siger(qb64=sig) for sig in sigs]),
dt=TIME)

mstate = m["state"]
seal = eventing.SealEvent(i=m["prefix"], s=mstate["ee"]["s"], d=mstate["ee"]["d"])
ims = eventing.messagize(serder=grant, sigers=[coring.Siger(qb64=sig) for sig in sigs], seal=seal)
ims = eventing.messagize(serder=grant, sigers=[csigning.Siger(qb64=sig) for sig in sigs], seal=seal)
ims.extend(end)
embeds = dict(
exn=ims
Expand Down
9 changes: 5 additions & 4 deletions scripts/multisig-holder.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from keri.app import signing
from keri.app.keeping import Algos
from keri.core import coring, eventing, serdering
from keri.core import signing as csigning
from keri.core.coring import Tiers
from keri.help import helping

Expand Down Expand Up @@ -216,7 +217,7 @@ def create_multisig(client, name, member, states):
recps = [x['i'] for x in states if x['i'] != member['prefix']]

embeds = dict(
icp=eventing.messagize(serder=icp, sigers=[coring.Siger(qb64=sig) for sig in isigs])
icp=eventing.messagize(serder=icp, sigers=[csigning.Siger(qb64=sig) for sig in isigs])
)

exchanges.send(member['name'], "multisig", sender=member, route="/multisig/icp",
Expand All @@ -239,7 +240,7 @@ def create_admit(client, participant, group, said, recp):

mstate = ghab["state"]
seal = eventing.SealEvent(i=ghab["prefix"], s=mstate["ee"]["s"], d=mstate["ee"]["d"])
ims = eventing.messagize(serder=admit, sigers=[coring.Siger(qb64=sig) for sig in sigs], seal=seal)
ims = eventing.messagize(serder=admit, sigers=[csigning.Siger(qb64=sig) for sig in sigs], seal=seal)
ims.extend(end)
embeds = dict(
exn=ims
Expand Down Expand Up @@ -280,7 +281,7 @@ def add_end_role_multisig(client, name, ghab, m, eid, stamp=None):

gstate = ghab["state"]
seal = eventing.SealEvent(i=ghab["prefix"], s=gstate["ee"]["s"], d=gstate["ee"]["d"])
ims = eventing.messagize(serder=rpy, sigers=[coring.Siger(qb64=sig) for sig in sigs], seal=seal)
ims = eventing.messagize(serder=rpy, sigers=[csigning.Siger(qb64=sig) for sig in sigs], seal=seal)
embeds = dict(
rpy=ims
)
Expand Down Expand Up @@ -339,7 +340,7 @@ def create_credential(client, holder):

grant, sigs, end = ipex.grant(issuer, recp=holder['i'], acdc=acdc,
iss=iss, message="",
anc=eventing.messagize(serder=anc, sigers=[coring.Siger(qb64=sig) for sig in sigs]))
anc=eventing.messagize(serder=anc, sigers=[csigning.Siger(qb64=sig) for sig in sigs]))
print(f"Sending grant {grant.said}")
exchanges.sendFromEvents("issuer", "credential", grant, sigs, end, [holder['i']])
print("... sent")
Expand Down
15 changes: 8 additions & 7 deletions scripts/multisig-issuer-holder.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from keri.app import signing
from keri.app.keeping import Algos
from keri.core import coring, eventing, serdering
from keri.core import signing as csigning
from keri.core.coring import Tiers
from keri.help import helping

Expand Down Expand Up @@ -306,7 +307,7 @@ def create_multisig(client, name, member, states):
recps = [x['i'] for x in states if x['i'] != member['prefix']]

embeds = dict(
icp=eventing.messagize(serder=icp, sigers=[coring.Siger(qb64=sig) for sig in isigs])
icp=eventing.messagize(serder=icp, sigers=[csigning.Siger(qb64=sig) for sig in isigs])
)

exchanges.send(member['name'], "multisig", sender=member, route="/multisig/icp",
Expand All @@ -330,7 +331,7 @@ def create_admit(client, participant, group, said, recp, stamp):
print(f"created ADMIT {admit.said}")
mstate = ghab["state"]
seal = eventing.SealEvent(i=ghab["prefix"], s=mstate["ee"]["s"], d=mstate["ee"]["d"])
ims = eventing.messagize(serder=admit, sigers=[coring.Siger(qb64=sig) for sig in sigs], seal=seal)
ims = eventing.messagize(serder=admit, sigers=[csigning.Siger(qb64=sig) for sig in sigs], seal=seal)
ims.extend(end)
embeds = dict(
exn=ims
Expand Down Expand Up @@ -370,7 +371,7 @@ def add_end_role_multisig(client, name, ghab, m, eid, stamp=None):

gstate = ghab["state"]
seal = eventing.SealEvent(i=ghab["prefix"], s=gstate["ee"]["s"], d=gstate["ee"]["d"])
ims = eventing.messagize(serder=rpy, sigers=[coring.Siger(qb64=sig) for sig in sigs], seal=seal)
ims = eventing.messagize(serder=rpy, sigers=[csigning.Siger(qb64=sig) for sig in sigs], seal=seal)
embeds = dict(
rpy=ims
)
Expand Down Expand Up @@ -405,7 +406,7 @@ def create_registry(client, localName, groupName, recp, name, nonce):

embeds = dict(
vcp=vcp.raw,
anc=eventing.messagize(serder=anc, sigers=[coring.Siger(qb64=sig) for sig in rsigs])
anc=eventing.messagize(serder=anc, sigers=[csigning.Siger(qb64=sig) for sig in rsigs])
)

exchanges.send(localName, groupName, sender=local, route="/multisig/vcp",
Expand Down Expand Up @@ -440,7 +441,7 @@ def create_credential(client, localName, groupName, recp, registryName, holder,
embeds = dict(
acdc=acdc,
iss=iss,
anc=eventing.messagize(serder=anc, sigers=[coring.Siger(qb64=sig) for sig in sigs])
anc=eventing.messagize(serder=anc, sigers=[csigning.Siger(qb64=sig) for sig in sigs])
)
exchanges.send(localName, groupName, sender=local, route="/multisig/iss",
payload=dict(gid=issuer["prefix"]),
Expand All @@ -465,12 +466,12 @@ def create_grant(client, localName, groupName, creder, iserder, anc, sigs, recp,

grant, sigs, end = ipex.grant(issuer, recp=holder, acdc=acdc,
iss=iss, message="", dt=stamp,
anc=eventing.messagize(serder=anc, sigers=[coring.Siger(qb64=sig) for sig in sigs]))
anc=eventing.messagize(serder=anc, sigers=[csigning.Siger(qb64=sig) for sig in sigs]))

print(f'created grant {grant.said}')
mstate = issuer["state"]
seal = eventing.SealEvent(i=issuer["prefix"], s=mstate["ee"]["s"], d=mstate["ee"]["d"])
ims = eventing.messagize(serder=grant, sigers=[coring.Siger(qb64=sig) for sig in sigs], seal=seal)
ims = eventing.messagize(serder=grant, sigers=[csigning.Siger(qb64=sig) for sig in sigs], seal=seal)
ims.extend(end.encode("utf-8"))
embeds = dict(
exn=ims
Expand Down
8 changes: 4 additions & 4 deletions scripts/multisig-kli-rotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import requests
from keri import kering
from keri.app.keeping import Algos
from keri.core import coring, eventing
from keri.core import coring, eventing, signing
from keri.core.coring import Tiers
from signify.app.clienting import SignifyClient

Expand Down Expand Up @@ -93,7 +93,7 @@ def create_multisig():
recp = [state['i'] for state in [multisig2, multisig1]]

embeds = dict(
icp=eventing.messagize(serder=icp, sigers=[coring.Siger(qb64=sig) for sig in isigs])
icp=eventing.messagize(serder=icp, sigers=[signing.Siger(qb64=sig) for sig in isigs])
)

exchanges.send("multisig3", "multisig", sender=m3, route="/multisig/icp",
Expand All @@ -112,7 +112,7 @@ def create_multisig():
ixn, xsigs, op = identifiers.interact("multisig", data=data)

embeds = dict(
ixn=eventing.messagize(serder=ixn, sigers=[coring.Siger(qb64=sig) for sig in xsigs])
ixn=eventing.messagize(serder=ixn, sigers=[signing.Siger(qb64=sig) for sig in xsigs])
)

exchanges.send("multisig3", "multisig", sender=m3, route="/multisig/ixn",
Expand Down Expand Up @@ -165,7 +165,7 @@ def create_multisig():

rot, rsigs, op = identifiers.rotate("multisig", states=states, rstates=rstates)
embeds = dict(
rot=eventing.messagize(serder=rot, sigers=[coring.Siger(qb64=sig) for sig in rsigs])
rot=eventing.messagize(serder=rot, sigers=[signing.Siger(qb64=sig) for sig in rsigs])
)

smids = [state['i'] for state in states]
Expand Down
5 changes: 3 additions & 2 deletions scripts/single-issuer-holder.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from requests import post
from pysodium import randombytes, crypto_sign_SEEDBYTES
from keri.app import signing
from keri.core import signing as csigning
from keri.core import coring, eventing, serdering
from keri.core.coring import Tiers
from keri.help import helping
Expand All @@ -22,7 +23,7 @@


def random_passcode():
return coring.Salter(raw=randombytes(crypto_sign_SEEDBYTES)).qb64
return csigning.Salter(raw=randombytes(crypto_sign_SEEDBYTES)).qb64


def create_timestamp():
Expand Down Expand Up @@ -104,7 +105,7 @@ def issue_credential(client: SignifyClient, name: str, registry_name: str, schem
grant, sigs, end = client.ipex().grant(hab, recp=recipient, acdc=acdc,
iss=iss, message="",
anc=eventing.messagize(serder=anc,
sigers=[coring.Siger(qb64=sig) for sig in sigs]),
sigers=[csigning.Siger(qb64=sig) for sig in sigs]),
dt=create_timestamp())

client.exchanges().sendFromEvents(name=name, topic="credential", exn=grant, sigs=sigs, atc=end,
Expand Down
57 changes: 41 additions & 16 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,23 @@
from glob import glob
from os.path import basename
from os.path import splitext
from pathlib import Path

from setuptools import find_packages, setup

# Prepares a nice long description for PyPi based on the README.md file
this_directory = Path(__file__).parent
if (this_directory / "README.md").exists(): # If building inside a container this file won't exist and fails the build
long_description = (this_directory / "README.md").read_text()
else:
long_description = "KERI Signing at the Edge Infrastructure"

setup(
name='signifypy',
version='0.1.1', # also change in src/signify/__init__.py
version='0.1.2', # also change in src/signify/__init__.py
license='Apache Software License 2.0',
description='Signify',
long_description="KERI Signing at the Edge Infrastructure",
description='SignifyPy: KERI Signing at the Edge',
long_description=long_description,
author='Philip S. Feairheller',
author_email='pfeairheller@gmail.com',
url='https://github.com/WebOfTrust/signifypy',
Expand All @@ -51,37 +60,53 @@
'Operating System :: Unix',
'Operating System :: POSIX',
'Operating System :: Microsoft :: Windows',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: Implementation :: CPython',
'Topic :: Utilities',
],
project_urls={
'Documentation': 'https://signifypy.readthedocs.io/',
'Changelog': 'https://signifypy.readthedocs.io/en/latest/changelog.html',
'Issue Tracker': 'https://github.com/WebOfTrust/signifypy/issues',
'Source': 'https://github.com/WebOfTrust/signifypy',
},
keywords=[
# eg: 'keyword1', 'keyword2', 'keyword3',
"signing at the eddge",
"signify",
"secure attribution",
"authentic data",
"discovery",
"resolver"
],
python_requires='>=3.12.2',
python_requires='>=3.12.6',
install_requires=[
'keri>=1.2.0-dev0',
'multicommand>=1.0.0',
'requests>=2.28',
'http_sfv>=0.9.8',
'msgpack>=1.0.4',
'cbor2>=5.4.3',
'keri==1.2.3',
'multicommand==1.0.0',
'requests==2.32.3',
'http_sfv==0.9.9',
'msgpack==1.1.0',
'cbor2>=5.6.5',
'sseclient>=0.0.27'
],
extras_require={
'test': [
'responses>=0.25.6',
'coverage>=7.6.10',
'pytest>=8.3.4',
'mockito==1.5.3'
],
'setup': [
'setuptools==75.8.0'
]
},
tests_require=[
'responses>=0.22.0',
'coverage>=6.5.0',
'pytest>=7.2.0',
'mockito==1.4.0'
'responses>=0.25.6',
'coverage>=7.6.10',
'pytest>=8.3.4',
'mockito==1.5.3'
],
setup_requires=[
'setuptools==75.8.0'
],
entry_points={
'console_scripts': [
Expand Down
2 changes: 1 addition & 1 deletion src/signify/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
main package
"""

__version__ = '0.1.1' # also change in setup.py
__version__ = '0.1.2' # also change in setup.py

Loading

0 comments on commit 3350a14

Please sign in to comment.