-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresolve_did.py
35 lines (29 loc) · 1.06 KB
/
resolve_did.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import click
from connect import connect_agents
import requests
from config import client_url
import urllib
def resolve_did(base_url, connection_id):
url = urllib.parse.urljoin(base_url,
f"connections/{connection_id}/resolve-did")
content = {
"@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/did_resolution/0.1/resolve",
"@id": "xhqMoTXfqhvAgtYxUSfaxbSiqWke9t",
"did": "did:sov:WRfXPg8dantKVubE3HX8pw",
"input_options": {
"result_type": "did-document",
"no_cache": False
},
"content": ""
}
requests.post(url, json=content)
@click.command()
@click.option('--invitation-path', default=None,
help='path of the invitation file.')
@click.option('--invitation', default=None, help='base64-encoded invitation.')
def main(invitation_path, invitation):
connection_id = connect_agents(invitation_path=invitation_path,
invitation=invitation)
resolve_did(client_url, connection_id)
if __name__ == '__main__':
main()