fix some things
This commit is contained in:
parent
01bc21d1a4
commit
1453ddf451
|
@ -64,7 +64,7 @@ class Command(BaseCommand):
|
||||||
|
|
||||||
def create_defaults_dids(self):
|
def create_defaults_dids(self):
|
||||||
for u in User.objects.all():
|
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.set_did()
|
||||||
did.save()
|
did.save()
|
||||||
|
|
||||||
|
|
|
@ -29,14 +29,14 @@ def webdid_from_controller_key(key):
|
||||||
keydid = keydid_from_controller_key(key) # "did:key:<...>"
|
keydid = keydid_from_controller_key(key) # "did:key:<...>"
|
||||||
pubkeyid = keydid.rsplit(":")[-1] # <...>
|
pubkeyid = keydid.rsplit(":")[-1] # <...>
|
||||||
document = json.loads(asyncio.run(resolve_keydid(keydid))) # Documento DID en terminos "key"
|
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"
|
webdid_url_owner = webdid_url + "#owner"
|
||||||
# Reemplazamos los campos del documento DID necesarios:
|
# Reemplazamos los campos del documento DID necesarios:
|
||||||
document["id"] = webdid_url
|
document["id"] = webdid_url
|
||||||
document["verificationMethod"]["id"] = webdid_url_owner
|
document["verificationMethod"][0]["id"] = webdid_url_owner
|
||||||
document["verificationMethod"]["controller"] = webdid_url
|
document["verificationMethod"][0]["controller"] = webdid_url
|
||||||
document["authentication"] = webdid_url_owner
|
document["authentication"][0] = webdid_url_owner
|
||||||
document["assertionMethod"] = webdid_url_owner
|
document["assertionMethod"][0] = webdid_url_owner
|
||||||
document_fixed_serialized = json.dumps(document)
|
document_fixed_serialized = json.dumps(document)
|
||||||
return webdid_url, document_fixed_serialized
|
return webdid_url, document_fixed_serialized
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue