diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5b48406..bbedc45 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -17,14 +17,14 @@ 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 - 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: | diff --git a/setup.py b/setup.py index d30fd11..5a51474 100644 --- a/setup.py +++ b/setup.py @@ -63,9 +63,9 @@ keywords=[ # eg: 'keyword1', 'keyword2', 'keyword3', ], - python_requires='>=3.10.4', + 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/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..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) @@ -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'