From 1453ddf4519a3f8047e25192d57d66bdf9e46c31 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Tue, 16 Jan 2024 14:01:15 +0100 Subject: [PATCH] fix some things --- idhub/management/commands/initial_datas.py | 2 +- utils/idhub_ssikit/__init__.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/idhub/management/commands/initial_datas.py b/idhub/management/commands/initial_datas.py index 034bc68..641b085 100644 --- a/idhub/management/commands/initial_datas.py +++ b/idhub/management/commands/initial_datas.py @@ -64,7 +64,7 @@ class Command(BaseCommand): def create_defaults_dids(self): for u in User.objects.all(): - did = DID(label="Default", user=u) + did = DID(label="Default", user=u, type=DID.Types.KEY) did.set_did() did.save() diff --git a/utils/idhub_ssikit/__init__.py b/utils/idhub_ssikit/__init__.py index 84b27fd..3521eba 100644 --- a/utils/idhub_ssikit/__init__.py +++ b/utils/idhub_ssikit/__init__.py @@ -29,14 +29,14 @@ def webdid_from_controller_key(key): keydid = keydid_from_controller_key(key) # "did:key:<...>" pubkeyid = keydid.rsplit(":")[-1] # <...> document = json.loads(asyncio.run(resolve_keydid(keydid))) # Documento DID en terminos "key" - webdid_url = f"did:web:{settings.DOMAIN}:{pubkeyid}" # nueva URL: "did:web:idhub.pangea.org:<...>" + webdid_url = f"did:web:{settings.DOMAIN}:did-registry:{pubkeyid}" # nueva URL: "did:web:idhub.pangea.org:<...>" webdid_url_owner = webdid_url + "#owner" # Reemplazamos los campos del documento DID necesarios: document["id"] = webdid_url - document["verificationMethod"]["id"] = webdid_url_owner - document["verificationMethod"]["controller"] = webdid_url - document["authentication"] = webdid_url_owner - document["assertionMethod"] = webdid_url_owner + document["verificationMethod"][0]["id"] = webdid_url_owner + document["verificationMethod"][0]["controller"] = webdid_url + document["authentication"][0] = webdid_url_owner + document["assertionMethod"][0] = webdid_url_owner document_fixed_serialized = json.dumps(document) return webdid_url, document_fixed_serialized