From fb18b5b0638e3d2d1b2072686b00aabac11b8f70 Mon Sep 17 00:00:00 2001 From: Philip Feairheller Date: Thu, 1 Feb 2024 07:22:14 -0800 Subject: [PATCH 1/4] Update challenge and credential endpoints to remove unneeded path parameters (#105) Signed-off-by: pfeairheller --- src/signify/app/challenging.py | 10 ++++------ src/signify/app/credentialing.py | 5 ++--- tests/app/test_challenging.py | 8 ++++---- tests/app/test_credentialing.py | 4 ++-- 4 files changed, 12 insertions(+), 15 deletions(-) diff --git a/src/signify/app/challenging.py b/src/signify/app/challenging.py index 972b22c..658e542 100644 --- a/src/signify/app/challenging.py +++ b/src/signify/app/challenging.py @@ -41,11 +41,10 @@ def respond(self, name, recp, words): return res - def verify(self, name, source, words): + def verify(self, source, words): """ Ask Agent to verify a given sender signed the provided words Parameters: - name (str): human readable name of AID environment source(str): qb64 AID of source of challenge response to check for words(list): list of challenge words to check for """ @@ -54,14 +53,13 @@ def verify(self, name, source, words): words=words ) - res = self.client.post(f"/challenges/{name}/verify/{source}", json=json) + res = self.client.post(f"/challenges_verify/{source}", json=json) return res.json() - def responded(self, name, source, said): + def responded(self, source, said): """ Mark challenge response as signed and accepted Parameters: - name (str): human readable name of AID environment source (str): qb64 AID of signer said (str): qb64 AID of exn message representing the signed response @@ -73,5 +71,5 @@ def responded(self, name, source, said): said=said ) - self.client.put(f"/challenges/{name}/verify/{source}", json=json) + self.client.put(f"/challenges_verify/{source}", json=json) return True diff --git a/src/signify/app/credentialing.py b/src/signify/app/credentialing.py index 480b8c7..7ecf609 100644 --- a/src/signify/app/credentialing.py +++ b/src/signify/app/credentialing.py @@ -144,11 +144,10 @@ def list(self, filtr=None, sort=None, skip=None, limit=None): res = self.client.post(f"/credentials/query", json=json) return res.json() - def export(self, name, said): + def export(self, said): """ Parameters: - name (str): Name associated with the AID said (str): SAID of credential to export Returns: credential (bytes): exported credential @@ -156,7 +155,7 @@ def export(self, name, said): """ headers = dict(accept="application/json+cesr") - res = self.client.get(f"/identifiers/{name}/credentials/{said}", headers=headers) + res = self.client.get(f"/credentials/{said}", headers=headers) return res.content def create(self, hab, registry, data, schema, recipient=None, edges=None, rules=None, private=False, diff --git a/tests/app/test_challenging.py b/tests/app/test_challenging.py index 0820fe5..2aa65f2 100644 --- a/tests/app/test_challenging.py +++ b/tests/app/test_challenging.py @@ -42,13 +42,13 @@ def test_challenge_verify(): words = ["word", "one", "two", "three"] from requests import Response mock_response = mock({}, spec=Response, strict=True) - expect(mock_client, times=1).post(f'/challenges/{name}/verify/{source}', + expect(mock_client, times=1).post(f'/challenges_verify/{source}', json=dict(words=words)).thenReturn(mock_response) expect(mock_response, times=1).json().thenReturn( {"done": False} ) - out = chas.verify(name, source, words) + out = chas.verify(source, words) assert out["done"] is False verifyNoUnwantedInteractions() @@ -67,10 +67,10 @@ def test_challenge_responded(): said = "E456" from requests import Response mock_response = mock({}, spec=Response, strict=True) - expect(mock_client, times=1).put(f'/challenges/{name}/verify/{source}', + expect(mock_client, times=1).put(f'/challenges_verify/{source}', json=dict(said=said)).thenReturn(mock_response) - out = chas.responded(name, source, said) + out = chas.responded(source, said) assert out is True verifyNoUnwantedInteractions() diff --git a/tests/app/test_credentialing.py b/tests/app/test_credentialing.py index 1c0218e..c71eded 100644 --- a/tests/app/test_credentialing.py +++ b/tests/app/test_credentialing.py @@ -90,11 +90,11 @@ def test_credentials_export(): from requests import Response mock_response = mock({'content': 'things I found'}, spec=Response, strict=True) - expect(mock_client, times=1).get('/identifiers/aid1/credentials/a_said', + expect(mock_client, times=1).get('/credentials/a_said', headers={'accept': 'application/json+cesr'}).thenReturn(mock_response) from signify.app.credentialing import Credentials - out = Credentials(client=mock_client).export('aid1', 'a_said') # type: ignore + out = Credentials(client=mock_client).export('a_said') # type: ignore assert out == 'things I found' From ac03c6ee4ee4fd95f12483078bb05f71c2ea3ec3 Mon Sep 17 00:00:00 2001 From: Philip Feairheller Date: Sun, 18 Feb 2024 17:03:12 -0800 Subject: [PATCH 2/4] Upgrade development branch to python 3.12 (#106) Signed-off-by: pfeairheller --- .github/workflows/test.yaml | 4 ++-- setup.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5b48406..adef79f 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -17,10 +17,10 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Set up Python 3.10.4 + - name: Set up Python 3.12.1 uses: actions/setup-python@v2 with: - python-version: 3.10.4 + python-version: 3.12.1 - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/setup.py b/setup.py index d30fd11..924e4bd 100644 --- a/setup.py +++ b/setup.py @@ -63,7 +63,7 @@ keywords=[ # eg: 'keyword1', 'keyword2', 'keyword3', ], - python_requires='>=3.10.4', + python_requires='>=3.12.1', install_requires=[ 'keri>=1.1.0', 'multicommand>=1.0.0', From 1d41e23197072b19fecb6d9b24ac4904a70c7be1 Mon Sep 17 00:00:00 2001 From: Kevin Griffin Date: Fri, 23 Feb 2024 09:23:54 -0500 Subject: [PATCH 3/4] fixes rename in keripy (#107) * fixes rename in keripy Signed-off-by: Kevin Griffin * uses development KERI Signed-off-by: Kevin Griffin --------- Signed-off-by: Kevin Griffin --- setup.py | 2 +- src/signify/app/credentialing.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 924e4bd..5a51474 100644 --- a/setup.py +++ b/setup.py @@ -65,7 +65,7 @@ ], python_requires='>=3.12.1', install_requires=[ - 'keri>=1.1.0', + 'keri @ git+https://git@github.com/weboftrust/keripy.git@development', 'multicommand>=1.0.0', 'requests>=2.28', 'http_sfv>=0.9.8', diff --git a/src/signify/app/credentialing.py b/src/signify/app/credentialing.py index 7ecf609..238fe42 100644 --- a/src/signify/app/credentialing.py +++ b/src/signify/app/credentialing.py @@ -41,7 +41,7 @@ def create(self, hab, registryName, noBackers=True, estOnly=False, baks=None, to cnfg = [] if noBackers: - cnfg.append(TraitDex.NoBackers) + cnfg.append(TraitDex.NoRegistrarBackers) if estOnly: cnfg.append(TraitDex.EstOnly) From a178b8f1da1443414d3b5d4546e29800d7eb38d1 Mon Sep 17 00:00:00 2001 From: Rodolfo Date: Sat, 30 Mar 2024 13:24:09 -0300 Subject: [PATCH 4/4] Fix mokito version --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index adef79f..bbedc45 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -24,7 +24,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install pytest mockito pytest-cov codecov + pip install pytest mockito==1.4.0 pytest-cov codecov pip install -r requirements.txt - name: Run tests run: |