Skip to content

Commit

Permalink
Merge pull request #92 from petridishdev/feature/out-of-band
Browse files Browse the repository at this point in the history
feat: use oob with didexchange 1.0 to connect to aries-vcr agent
  • Loading branch information
esune authored Jun 14, 2024
2 parents 4ef9298 + bdd6607 commit d496595
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 16 deletions.
3 changes: 0 additions & 3 deletions issuer_controller/src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,6 @@ def agent_callback(topic):
else:
response = jsonify({})

elif topic == issuer.TOPIC_CONNECTIONS_ACTIVITY:
response = jsonify({})

elif topic == issuer.TOPIC_CREDENTIALS:
if "state" in message:
method = method + "." + message["state"]
Expand Down
14 changes: 10 additions & 4 deletions issuer_controller/src/issuer.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,16 +324,23 @@ def run(self):
"agent_admin_url"
]
response = requests.post(
tob_agent_admin_url + "/connections/create-invitation",
tob_agent_admin_url + "/out-of-band/create-invitation"
+ "?auto_accept=true&use_existing_connection=true",
json.dumps({
"handshake_protocols": [
"https://didcomm.org/didexchange/1.0"
]
}),
headers=TOB_REQUEST_HEADERS,
)
response.raise_for_status()
invitation = response.json()

response = requests.post(
agent_admin_url
+ "/connections/receive-invitation?alias="
+ tob_connection_params["alias"],
+ "/out-of-band/receive-invitation?alias="
+ tob_connection_params["alias"]
+ "&auto_accept=true&use_existing_connection=true",
json.dumps(invitation["invitation"]),
headers=ADMIN_REQUEST_HEADERS,
)
Expand Down Expand Up @@ -657,7 +664,6 @@ def get_credential_response(cred_exch_id):


TOPIC_CONNECTIONS = "connections"
TOPIC_CONNECTIONS_ACTIVITY = "connections_actvity"
TOPIC_CREDENTIALS = "issue_credential"
TOPIC_CREDENTIALS_V20 = "issue_credential_v2_0"
TOPIC_CREDENTIALS_V20_INDY = "issue_credential_v2_0_indy"
Expand Down
9 changes: 0 additions & 9 deletions issuer_controller/test/agent_callback_resource_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,7 @@ def test_agent_callback_TOPIC_CONNECTIONS_empty(test_client):
get_data = json.loads(get_resp.data.decode())
assert get_data == {}

def test_agent_callback_TOPIC_CONNECTIONS_ACTIVITY_empty(test_client):
data = {
"test":"value"
}
get_resp = test_client.post(f'/api/agentcb/topic/'+issuer.TOPIC_CONNECTIONS_ACTIVITY+'/', json=data)
assert get_resp.status_code == 200
get_data = json.loads(get_resp.data.decode())
assert get_data == {}


def test_agent_callback_TOPIC_CREDENTIALS_empty(test_client):
data = {
"test":"value"
Expand Down

0 comments on commit d496595

Please sign in to comment.