Skip to content

Commit

Permalink
Update to use keripy 1.1.21 (#77)
Browse files Browse the repository at this point in the history
* update version number in config files

Signed-off-by: Jonathan Rayback <[email protected]>

* update package dependencies

Signed-off-by: Jonathan Rayback <[email protected]>

* fix fromDidWeb() to ignore properly formatted did:webs dids

Signed-off-by: Jonathan Rayback <[email protected]>

* update keripy version to 1.1.21; pull from arm64 image to support apple silicon

Signed-off-by: Jonathan Rayback <[email protected]>

* add temporary shell script for demo purposes

Signed-off-by: Jonathan Rayback <[email protected]>

* update python version in github action

Signed-off-by: Jonathan Rayback <[email protected]>

* don't ignore demo runtime files required for pytest

Signed-off-by: Jonathan Rayback <[email protected]>

---------

Signed-off-by: Jonathan Rayback <[email protected]>
  • Loading branch information
jrayback authored Oct 28, 2024
1 parent ce04c0e commit e70f0c0
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.10
- name: Set up Python 3.12.3
uses: actions/setup-python@v2
with:
python-version: 3.12.2
python-version: 3.12.3
- name: Clear databases
run: |
rm -Rf /usr/local/var/keri/*
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,7 @@ dmypy.json

# Ignore runtime files
/volume/dkr/examples/E*
/volume/dkr/pages/
/volume/dkr/pages/E*
# But allow the specific directory "ENro7uf0ePmiK3jdTo2YCdXLqW7z7xoP6qhhBou6gBLe" for pytest
!/volume/dkr/examples/ENro7uf0ePmiK3jdTo2YCdXLqW7z7xoP6qhhBou6gBLe/
!/volume/dkr/pages/ENro7uf0ePmiK3jdTo2YCdXLqW7z7xoP6qhhBou6gBLe/
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
witnesshost:
container_name: witnesshost
hostname: witnesshost
image: weboftrust/keri:1.1.4
image: weboftrust/keri:1.1.21
platform: linux/amd64
tty: true
volumes:
Expand Down
8 changes: 4 additions & 4 deletions images/webs.dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM weboftrust/keri:1.1.4
FROM weboftrust/keri:1.1.21-arm64

WORKDIR /usr/local/var

RUN mkdir webs
RUN mkdir -p /usr/local/var/webs
COPY . /usr/local/var/webs

WORKDIR /usr/local/var/webs/
WORKDIR /usr/local/var/webs

RUN pip install -r requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

WORKDIR /usr/local/var/webs/volume/dkr/examples
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
keywords=[
# eg: 'keyword1', 'keyword2', 'keyword3',
],
python_requires='>=3.10.13',
python_requires='>=3.12.1',
install_requires=[
'aiohttp>=3.7.4',
'lmdb>=1.3.0',
Expand All @@ -73,7 +73,7 @@
'cbor2>=5.4.3',
'multidict>=6.0.2',
'ordered-set>=4.1.0',
'keri>=1.1.4',
'keri>=1.1.21',
'hio>=0.6.9',
'multicommand>=1.0.0',
'jsonschema>=4.17.0',
Expand All @@ -87,7 +87,8 @@
'cryptography>=39.0.2',
'requests>=2.28',
'pytest>=6.2.5',
'pytest-timeout>=2.3.1'
'pytest-timeout>=2.3.1',
'simplejson>=3.17.0'
],
extras_require={
},
Expand Down
18 changes: 15 additions & 3 deletions src/dkr/core/didding.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,21 @@ def toDidWeb(diddoc):
return diddoc

def fromDidWeb(diddoc):
diddoc['id'] = diddoc['id'].replace('did:web', 'did:webs')
for verificationMethod in diddoc[VMETH_FIELD]:
verificationMethod['controller'] = verificationMethod['controller'].replace('did:web', 'did:webs')
# Log the original state of the DID and controller
print(f"fromDidWeb() called with id: {diddoc['id']}")
initial_controller = diddoc['verificationMethod'][0]['controller']
print(f"Initial controller in fromDidWeb: {initial_controller}")

# Apply the replacement only if necessary
if 'did:web' in diddoc['id'] and 'did:webs' not in diddoc['id']:
diddoc['id'] = diddoc['id'].replace('did:web', 'did:webs')
print(f"Updated id in fromDidWeb: {diddoc['id']}")

for verificationMethod in diddoc['verificationMethod']:
if 'did:web' in verificationMethod['controller'] and 'did:webs' not in verificationMethod['controller']:
verificationMethod['controller'] = verificationMethod['controller'].replace('did:web', 'did:webs')
print(f"Updated controller in fromDidWeb: {verificationMethod['controller']}")

return diddoc

def desAliases(hby: habbing.Habery, aid: str, reg_name: str=None):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"id": "did:web:did-webs-service%3a7676:ENro7uf0ePmiK3jdTo2YCdXLqW7z7xoP6qhhBou6gBLe", "verificationMethod": [{"id": "#DHr0-I-mMN7h6cLMOTRJkkfPuMd0vgQPrOk4Y3edaHjr", "type": "JsonWebKey", "controller": "did:web:did-webs-service%3a7676:ENro7uf0ePmiK3jdTo2YCdXLqW7z7xoP6qhhBou6gBLe", "publicKeyJwk": {"kid": "DHr0-I-mMN7h6cLMOTRJkkfPuMd0vgQPrOk4Y3edaHjr", "kty": "OKP", "crv": "Ed25519", "x": "evT4j6Yw3uHpwsw5NEmSR8-4x3S-BA-s6Thjd51oeOs"}}], "service": [], "alsoKnownAs": ["did:web:did-webs-service%3a7676:ENro7uf0ePmiK3jdTo2YCdXLqW7z7xoP6qhhBou6gBLe", "did:webs:did-webs-service%3a7676:ENro7uf0ePmiK3jdTo2YCdXLqW7z7xoP6qhhBou6gBLe", "did:web:example.com:ENro7uf0ePmiK3jdTo2YCdXLqW7z7xoP6qhhBou6gBLe", "did:web:foo.com:ENro7uf0ePmiK3jdTo2YCdXLqW7z7xoP6qhhBou6gBLe", "did:webs:foo.com:ENro7uf0ePmiK3jdTo2YCdXLqW7z7xoP6qhhBou6gBLe"]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"v":"KERI10JSON00012b_","t":"icp","d":"ENro7uf0ePmiK3jdTo2YCdXLqW7z7xoP6qhhBou6gBLe","i":"ENro7uf0ePmiK3jdTo2YCdXLqW7z7xoP6qhhBou6gBLe","s":"0","kt":"1","k":["DHr0-I-mMN7h6cLMOTRJkkfPuMd0vgQPrOk4Y3edaHjr"],"nt":"1","n":["ELa775aLyane1vdiJEuexP8zrueiIoG995pZPGJiBzGX"],"bt":"0","b":[],"c":[],"a":[]}-VAn-AABAADjfOjbPu9OWce59OQIc-y3Su4kvfC2BAd_e_NLHbXcOK8-3s6do5vBfrxQ1kDyvFGCPMcSl620dLMZ4QDYlvME-EAB0AAAAAAAAAAAAAAAAAAAAAAA1AAG2024-10-27T16c12c27d142807p00c00{"v":"KERI10JSON00013a_","t":"ixn","d":"ECDPHxFNfZ_rihCMUEy4hztjQInJlmIWK7TKOEfviFK1","i":"ENro7uf0ePmiK3jdTo2YCdXLqW7z7xoP6qhhBou6gBLe","s":"1","p":"ENro7uf0ePmiK3jdTo2YCdXLqW7z7xoP6qhhBou6gBLe","a":[{"i":"EHfE7gojVcX5Ldu8zzBr9WZhVz2ZP7XoYDaVEtqcyDRP","s":"0","d":"EHfE7gojVcX5Ldu8zzBr9WZhVz2ZP7XoYDaVEtqcyDRP"}]}-VAn-AABAABvGM3wTvM66FbVSf88AhFw5-X54C26f4VyQyMt6z7pcKJrqElPYSggukFAC32Sx0KcHhQKtOOlqHBoU8dzXPgJ-EAB0AAAAAAAAAAAAAAAAAAAAAAB1AAG2024-10-27T16c12c55d145260p00c00{"v":"KERI10JSON00013a_","t":"ixn","d":"EOqpGbTgwS7TGYsR9yATabvCNYL4R0oLi2TH8b9vg8OA","i":"ENro7uf0ePmiK3jdTo2YCdXLqW7z7xoP6qhhBou6gBLe","s":"2","p":"ECDPHxFNfZ_rihCMUEy4hztjQInJlmIWK7TKOEfviFK1","a":[{"i":"EIEXitNCXQ_Y7HC6I7oiY7fPrRJyJzwvn_YIjvSHPzav","s":"0","d":"EBK4vxXrJS0V42rbuX4Sgx2pYXV_WRKuH5dkqGepKPQ4"}]}-VAn-AABAABjOszRBBdz0iniBvntOC987pkQWdCa_Xd-8JGXbz71YYTl5X25-xo0FOS6MX4wp6ZceabT-q1Lzk-JczwHeqwA-EAB0AAAAAAAAAAAAAAAAAAAAAAC1AAG2024-10-27T16c12c57d877051p00c00{"v":"KERI10JSON000113_","t":"vcp","d":"EHfE7gojVcX5Ldu8zzBr9WZhVz2ZP7XoYDaVEtqcyDRP","i":"EHfE7gojVcX5Ldu8zzBr9WZhVz2ZP7XoYDaVEtqcyDRP","ii":"ENro7uf0ePmiK3jdTo2YCdXLqW7z7xoP6qhhBou6gBLe","s":"0","c":["NB"],"bt":"0","b":[],"n":"AIimVIHWyFmb609kEwh6tDuU_9c0FHR16stQb7hXUAvG"}-VAS-GAB0AAAAAAAAAAAAAAAAAAAAAABECDPHxFNfZ_rihCMUEy4hztjQInJlmIWK7TKOEfviFK1{"v":"KERI10JSON0000ed_","t":"iss","d":"EBK4vxXrJS0V42rbuX4Sgx2pYXV_WRKuH5dkqGepKPQ4","i":"EIEXitNCXQ_Y7HC6I7oiY7fPrRJyJzwvn_YIjvSHPzav","s":"0","ri":"EHfE7gojVcX5Ldu8zzBr9WZhVz2ZP7XoYDaVEtqcyDRP","dt":"2023-11-13T17:41:37.710691+00:00"}-VAS-GAB0AAAAAAAAAAAAAAAAAAAAAACEOqpGbTgwS7TGYsR9yATabvCNYL4R0oLi2TH8b9vg8OA{"v":"ACDC10JSON0005f2_","d":"EIEXitNCXQ_Y7HC6I7oiY7fPrRJyJzwvn_YIjvSHPzav","i":"ENro7uf0ePmiK3jdTo2YCdXLqW7z7xoP6qhhBou6gBLe","ri":"EHfE7gojVcX5Ldu8zzBr9WZhVz2ZP7XoYDaVEtqcyDRP","s":"EN6Oh5XSD5_q2Hgu-aqpdfbVepdpYpFlgz6zvJL5b_r5","a":{"d":"EJJjtYa6D4LWe_fqtm1p78wz-8jNAzNX6aPDkrQcz27Q","dt":"2023-11-13T17:41:37.710691+00:00","ids":["did:web:did-webs-service%3a7676:ENro7uf0ePmiK3jdTo2YCdXLqW7z7xoP6qhhBou6gBLe","did:webs:did-webs-service%3a7676:ENro7uf0ePmiK3jdTo2YCdXLqW7z7xoP6qhhBou6gBLe","did:web:example.com:ENro7uf0ePmiK3jdTo2YCdXLqW7z7xoP6qhhBou6gBLe","did:web:foo.com:ENro7uf0ePmiK3jdTo2YCdXLqW7z7xoP6qhhBou6gBLe","did:webs:foo.com:ENro7uf0ePmiK3jdTo2YCdXLqW7z7xoP6qhhBou6gBLe"]},"r":{"d":"EEVTx0jLLZDQq8a5bXrXgVP0JDP7j8iDym9Avfo8luLw","aliasDesignation":{"l":"The issuer of this ACDC designates the identifiers in the ids field as the only allowed namespaced aliases of the issuer's AID."},"usageDisclaimer":{"l":"This attestation only asserts designated aliases of the controller of the AID, that the AID controlled namespaced alias has been designated by the controller. It does not assert that the controller of this AID has control over the infrastructure or anything else related to the namespace other than the included AID."},"issuanceDisclaimer":{"l":"All information in a valid and non-revoked alias designation assertion is accurate as of the date specified."},"termsOfUse":{"l":"Designated aliases of the AID must only be used in a manner consistent with the expressed intent of the AID controller."}}}-VA0-FABENro7uf0ePmiK3jdTo2YCdXLqW7z7xoP6qhhBou6gBLe0AAAAAAAAAAAAAAAAAAAAAAAENro7uf0ePmiK3jdTo2YCdXLqW7z7xoP6qhhBou6gBLe-AABAACMKdtmTzNs5SVvJt67LJRqXyeQxiASbFFbDEH5_qXlytUf-fmLepqMktDYf0kHJGlHjoCkR0yzQ38Zq2VF4I4M
3 changes: 3 additions & 0 deletions volume/dkr/examples/tmp/simple_webs_resolve.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kli init --name controller --salt 0AAQmsjh-C7kAJZQEzdrzwB7 --nopasscode #--config-dir /usr/local/var/webs/volume/dkr/examples/my-scripts --config-file config-docker

kli incept --name controller --alias controller --file /usr/local/var/webs/volume/dkr/examples/my-scripts/incept.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"id": "did:web:did-webs-service%3a7676:ENro7uf0ePmiK3jdTo2YCdXLqW7z7xoP6qhhBou6gBLe", "verificationMethod": [{"id": "#DHr0-I-mMN7h6cLMOTRJkkfPuMd0vgQPrOk4Y3edaHjr", "type": "JsonWebKey", "controller": "did:web:did-webs-service%3a7676:ENro7uf0ePmiK3jdTo2YCdXLqW7z7xoP6qhhBou6gBLe", "publicKeyJwk": {"kid": "DHr0-I-mMN7h6cLMOTRJkkfPuMd0vgQPrOk4Y3edaHjr", "kty": "OKP", "crv": "Ed25519", "x": "evT4j6Yw3uHpwsw5NEmSR8-4x3S-BA-s6Thjd51oeOs"}}], "service": [], "alsoKnownAs": ["did:web:did-webs-service%3a7676:ENro7uf0ePmiK3jdTo2YCdXLqW7z7xoP6qhhBou6gBLe", "did:webs:did-webs-service%3a7676:ENro7uf0ePmiK3jdTo2YCdXLqW7z7xoP6qhhBou6gBLe", "did:web:example.com:ENro7uf0ePmiK3jdTo2YCdXLqW7z7xoP6qhhBou6gBLe", "did:web:foo.com:ENro7uf0ePmiK3jdTo2YCdXLqW7z7xoP6qhhBou6gBLe", "did:webs:foo.com:ENro7uf0ePmiK3jdTo2YCdXLqW7z7xoP6qhhBou6gBLe"]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"v":"KERI10JSON00012b_","t":"icp","d":"ENro7uf0ePmiK3jdTo2YCdXLqW7z7xoP6qhhBou6gBLe","i":"ENro7uf0ePmiK3jdTo2YCdXLqW7z7xoP6qhhBou6gBLe","s":"0","kt":"1","k":["DHr0-I-mMN7h6cLMOTRJkkfPuMd0vgQPrOk4Y3edaHjr"],"nt":"1","n":["ELa775aLyane1vdiJEuexP8zrueiIoG995pZPGJiBzGX"],"bt":"0","b":[],"c":[],"a":[]}-VAn-AABAADjfOjbPu9OWce59OQIc-y3Su4kvfC2BAd_e_NLHbXcOK8-3s6do5vBfrxQ1kDyvFGCPMcSl620dLMZ4QDYlvME-EAB0AAAAAAAAAAAAAAAAAAAAAAA1AAG2024-10-27T16c12c27d142807p00c00{"v":"KERI10JSON00013a_","t":"ixn","d":"ECDPHxFNfZ_rihCMUEy4hztjQInJlmIWK7TKOEfviFK1","i":"ENro7uf0ePmiK3jdTo2YCdXLqW7z7xoP6qhhBou6gBLe","s":"1","p":"ENro7uf0ePmiK3jdTo2YCdXLqW7z7xoP6qhhBou6gBLe","a":[{"i":"EHfE7gojVcX5Ldu8zzBr9WZhVz2ZP7XoYDaVEtqcyDRP","s":"0","d":"EHfE7gojVcX5Ldu8zzBr9WZhVz2ZP7XoYDaVEtqcyDRP"}]}-VAn-AABAABvGM3wTvM66FbVSf88AhFw5-X54C26f4VyQyMt6z7pcKJrqElPYSggukFAC32Sx0KcHhQKtOOlqHBoU8dzXPgJ-EAB0AAAAAAAAAAAAAAAAAAAAAAB1AAG2024-10-27T16c12c55d145260p00c00{"v":"KERI10JSON00013a_","t":"ixn","d":"EOqpGbTgwS7TGYsR9yATabvCNYL4R0oLi2TH8b9vg8OA","i":"ENro7uf0ePmiK3jdTo2YCdXLqW7z7xoP6qhhBou6gBLe","s":"2","p":"ECDPHxFNfZ_rihCMUEy4hztjQInJlmIWK7TKOEfviFK1","a":[{"i":"EIEXitNCXQ_Y7HC6I7oiY7fPrRJyJzwvn_YIjvSHPzav","s":"0","d":"EBK4vxXrJS0V42rbuX4Sgx2pYXV_WRKuH5dkqGepKPQ4"}]}-VAn-AABAABjOszRBBdz0iniBvntOC987pkQWdCa_Xd-8JGXbz71YYTl5X25-xo0FOS6MX4wp6ZceabT-q1Lzk-JczwHeqwA-EAB0AAAAAAAAAAAAAAAAAAAAAAC1AAG2024-10-27T16c12c57d877051p00c00{"v":"KERI10JSON000113_","t":"vcp","d":"EHfE7gojVcX5Ldu8zzBr9WZhVz2ZP7XoYDaVEtqcyDRP","i":"EHfE7gojVcX5Ldu8zzBr9WZhVz2ZP7XoYDaVEtqcyDRP","ii":"ENro7uf0ePmiK3jdTo2YCdXLqW7z7xoP6qhhBou6gBLe","s":"0","c":["NB"],"bt":"0","b":[],"n":"AIimVIHWyFmb609kEwh6tDuU_9c0FHR16stQb7hXUAvG"}-VAS-GAB0AAAAAAAAAAAAAAAAAAAAAABECDPHxFNfZ_rihCMUEy4hztjQInJlmIWK7TKOEfviFK1{"v":"KERI10JSON0000ed_","t":"iss","d":"EBK4vxXrJS0V42rbuX4Sgx2pYXV_WRKuH5dkqGepKPQ4","i":"EIEXitNCXQ_Y7HC6I7oiY7fPrRJyJzwvn_YIjvSHPzav","s":"0","ri":"EHfE7gojVcX5Ldu8zzBr9WZhVz2ZP7XoYDaVEtqcyDRP","dt":"2023-11-13T17:41:37.710691+00:00"}-VAS-GAB0AAAAAAAAAAAAAAAAAAAAAACEOqpGbTgwS7TGYsR9yATabvCNYL4R0oLi2TH8b9vg8OA{"v":"ACDC10JSON0005f2_","d":"EIEXitNCXQ_Y7HC6I7oiY7fPrRJyJzwvn_YIjvSHPzav","i":"ENro7uf0ePmiK3jdTo2YCdXLqW7z7xoP6qhhBou6gBLe","ri":"EHfE7gojVcX5Ldu8zzBr9WZhVz2ZP7XoYDaVEtqcyDRP","s":"EN6Oh5XSD5_q2Hgu-aqpdfbVepdpYpFlgz6zvJL5b_r5","a":{"d":"EJJjtYa6D4LWe_fqtm1p78wz-8jNAzNX6aPDkrQcz27Q","dt":"2023-11-13T17:41:37.710691+00:00","ids":["did:web:did-webs-service%3a7676:ENro7uf0ePmiK3jdTo2YCdXLqW7z7xoP6qhhBou6gBLe","did:webs:did-webs-service%3a7676:ENro7uf0ePmiK3jdTo2YCdXLqW7z7xoP6qhhBou6gBLe","did:web:example.com:ENro7uf0ePmiK3jdTo2YCdXLqW7z7xoP6qhhBou6gBLe","did:web:foo.com:ENro7uf0ePmiK3jdTo2YCdXLqW7z7xoP6qhhBou6gBLe","did:webs:foo.com:ENro7uf0ePmiK3jdTo2YCdXLqW7z7xoP6qhhBou6gBLe"]},"r":{"d":"EEVTx0jLLZDQq8a5bXrXgVP0JDP7j8iDym9Avfo8luLw","aliasDesignation":{"l":"The issuer of this ACDC designates the identifiers in the ids field as the only allowed namespaced aliases of the issuer's AID."},"usageDisclaimer":{"l":"This attestation only asserts designated aliases of the controller of the AID, that the AID controlled namespaced alias has been designated by the controller. It does not assert that the controller of this AID has control over the infrastructure or anything else related to the namespace other than the included AID."},"issuanceDisclaimer":{"l":"All information in a valid and non-revoked alias designation assertion is accurate as of the date specified."},"termsOfUse":{"l":"Designated aliases of the AID must only be used in a manner consistent with the expressed intent of the AID controller."}}}-VA0-FABENro7uf0ePmiK3jdTo2YCdXLqW7z7xoP6qhhBou6gBLe0AAAAAAAAAAAAAAAAAAAAAAAENro7uf0ePmiK3jdTo2YCdXLqW7z7xoP6qhhBou6gBLe-AABAACMKdtmTzNs5SVvJt67LJRqXyeQxiASbFFbDEH5_qXlytUf-fmLepqMktDYf0kHJGlHjoCkR0yzQ38Zq2VF4I4M

0 comments on commit e70f0c0

Please sign in to comment.