Skip to content

Commit 5e4c905

Browse files
committed
Final merge of development into main before removing development
Signed-off-by: pfeairheller <[email protected]>
2 parents a914224 + 1d41e23 commit 5e4c905

File tree

4 files changed

+13
-16
lines changed

4 files changed

+13
-16
lines changed

src/signify/app/challenging.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,10 @@ def respond(self, name, recp, words):
4141

4242
return res
4343

44-
def verify(self, name, source, words):
44+
def verify(self, source, words):
4545
""" Ask Agent to verify a given sender signed the provided words
4646
4747
Parameters:
48-
name (str): human readable name of AID environment
4948
source(str): qb64 AID of source of challenge response to check for
5049
words(list): list of challenge words to check for
5150
"""
@@ -54,14 +53,13 @@ def verify(self, name, source, words):
5453
words=words
5554
)
5655

57-
res = self.client.post(f"/challenges/{name}/verify/{source}", json=json)
56+
res = self.client.post(f"/challenges_verify/{source}", json=json)
5857
return res.json()
5958

60-
def responded(self, name, source, said):
59+
def responded(self, source, said):
6160
""" Mark challenge response as signed and accepted
6261
6362
Parameters:
64-
name (str): human readable name of AID environment
6563
source (str): qb64 AID of signer
6664
said (str): qb64 AID of exn message representing the signed response
6765
@@ -73,5 +71,5 @@ def responded(self, name, source, said):
7371
said=said
7472
)
7573

76-
self.client.put(f"/challenges/{name}/verify/{source}", json=json)
74+
self.client.put(f"/challenges_verify/{source}", json=json)
7775
return True

src/signify/app/credentialing.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def create(self, hab, registryName, noBackers=True, estOnly=False, baks=None, to
4141

4242
cnfg = []
4343
if noBackers:
44-
cnfg.append(TraitDex.NoBackers)
44+
cnfg.append(TraitDex.NoRegistrarBackers)
4545
if estOnly:
4646
cnfg.append(TraitDex.EstOnly)
4747

@@ -150,19 +150,18 @@ def list(self, filtr=None, sort=None, skip=None, limit=None):
150150
res = self.client.post(f"/credentials/query", json=json)
151151
return res.json()
152152

153-
def export(self, name, said):
153+
def export(self, said):
154154
"""
155155
156156
Parameters:
157-
name (str): Name associated with the AID
158157
said (str): SAID of credential to export
159158
Returns:
160159
credential (bytes): exported credential
161160
162161
"""
163162
headers = dict(accept="application/json+cesr")
164163

165-
res = self.client.get(f"/identifiers/{name}/credentials/{said}", headers=headers)
164+
res = self.client.get(f"/credentials/{said}", headers=headers)
166165
return res.content
167166

168167
def create(self, hab, registry, data, schema, recipient=None, edges=None, rules=None, private=False,

tests/app/test_challenging.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ def test_challenge_verify():
4242
words = ["word", "one", "two", "three"]
4343
from requests import Response
4444
mock_response = mock({}, spec=Response, strict=True)
45-
expect(mock_client, times=1).post(f'/challenges/{name}/verify/{source}',
45+
expect(mock_client, times=1).post(f'/challenges_verify/{source}',
4646
json=dict(words=words)).thenReturn(mock_response)
4747
expect(mock_response, times=1).json().thenReturn(
4848
{"done": False}
4949
)
5050

51-
out = chas.verify(name, source, words)
51+
out = chas.verify(source, words)
5252
assert out["done"] is False
5353

5454
verifyNoUnwantedInteractions()
@@ -67,10 +67,10 @@ def test_challenge_responded():
6767
said = "E456"
6868
from requests import Response
6969
mock_response = mock({}, spec=Response, strict=True)
70-
expect(mock_client, times=1).put(f'/challenges/{name}/verify/{source}',
70+
expect(mock_client, times=1).put(f'/challenges_verify/{source}',
7171
json=dict(said=said)).thenReturn(mock_response)
7272

73-
out = chas.responded(name, source, said)
73+
out = chas.responded(source, said)
7474
assert out is True
7575

7676
verifyNoUnwantedInteractions()

tests/app/test_credentialing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ def test_credentials_export():
9494

9595
from requests import Response
9696
mock_response = mock({'content': 'things I found'}, spec=Response, strict=True)
97-
expect(mock_client, times=1).get('/identifiers/aid1/credentials/a_said',
97+
expect(mock_client, times=1).get('/credentials/a_said',
9898
headers={'accept': 'application/json+cesr'}).thenReturn(mock_response)
9999

100100
from signify.app.credentialing import Credentials
101-
out = Credentials(client=mock_client).export('aid1', 'a_said') # type: ignore
101+
out = Credentials(client=mock_client).export('a_said') # type: ignore
102102

103103
assert out == 'things I found'
104104

0 commit comments

Comments
 (0)