-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/python wrapper with multiple ledger support #87
Feature/python wrapper with multiple ledger support #87
Conversation
Signed-off-by: Dominic Wörner <dom.woe@gmail.com>
Signed-off-by: Dominic Wörner <dom.woe@gmail.com>
Signed-off-by: Dominic Wörner <dom.woe@gmail.com>
Signed-off-by: Dominic Wörner <dom.woe@gmail.com>
Signed-off-by: Dominic Wörner <dom.woe@gmail.com>
Signed-off-by: Dominic Wörner <dom.woe@gmail.com>
wrappers/python/indy_vdr/resolver.py
Outdated
# Handle legacy case, where diddocContent is not present and we want to check for | ||
# associated ATTRIB endpoints. We can't handle in this in libindy_vdr directly. | ||
if not diddoc_content: | ||
unqualified_did = reply_data["dest"] | ||
req = build_get_attrib_request(None, unqualified_did, "endpoint", None, None) | ||
res = await pool.submit_request(req) | ||
data = res.get("data", None) | ||
if data: | ||
data = json.loads(data) | ||
endpoints = data.get("endpoint", None) | ||
|
||
if endpoints: | ||
services = [] | ||
for (service_type, service_endpoint) in endpoints.items(): | ||
if service_type == "endpoint": | ||
|
||
services.append({ | ||
"id": f"did:indy:{namespace}:{unqualified_did}#did-communication", | ||
"type": "did-communication", | ||
"recipientKeys": [f"did:indy:{namespace}:{unqualified_did}#verkey"] , | ||
"routingKeys": [], | ||
"priority": 0 | ||
}) | ||
|
||
else: | ||
|
||
services.append({ | ||
"id": f"did:indy:{namespace}:{unqualified_did}#{service_type}", | ||
"type": service_type, | ||
"serviceEndpoint": service_endpoint | ||
|
||
}) | ||
result["didDocument"]["services"] = services; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After countless hours trying to handle fetching the legacy endpoint (ATTRIB tx) on the rust side before crossing the ffi bridge I resigned.
I don't like it but I have added this code to the python wrapper to fetch the ATTRIB data and attach it to the did document.
If the PoolResolver
is used from Rust projects (e.g. the proxy server) then this custom code is not necessary, but handled internally.
Signed-off-by: Dominic Wörner <dom.woe@gmail.com>
Signed-off-by: Dominic Wörner <dom.woe@gmail.com>
d518c99
to
9906f32
Compare
Signed-off-by: Dominic Wörner <dom.woe@gmail.com>
…rate_did dependeny Signed-off-by: Dominic Wörner <dom.woe@gmail.com>
Signed-off-by: Dominic Woerner <dom.woe@gmail.com>
Signed-off-by: Dominic Woerner <dom.woe@gmail.com>
Signed-off-by: Dominic Woerner <dom.woe@gmail.com>
Signed-off-by: Dominic Wörner <dom.woe@gmail.com>
Signed-off-by: Dominic Wörner <dom.woe@gmail.com>
Get attrib with optional seq_no and timestamp and self-cert version tests
Signed-off-by: Dominic Wörner <dom.woe@gmail.com>
Added python wrapper for multi-ledger did resolution
Exposes three simple ways to set up a resolver: