mirror of https://git.sr.ht/~tsileo/microblog.pub
Compare commits
2 Commits
3fc567861b
...
ce6f9238f3
Author | SHA1 | Date |
---|---|---|
Thomas Sileo | ce6f9238f3 | |
Thomas Sileo | 3f129855d1 |
|
@ -23,6 +23,13 @@ requests_loader = pyld.documentloader.requests.requests_document_loader()
|
||||||
def _loader(url, options={}):
|
def _loader(url, options={}):
|
||||||
# See https://github.com/digitalbazaar/pyld/issues/133
|
# See https://github.com/digitalbazaar/pyld/issues/133
|
||||||
options["headers"]["Accept"] = "application/ld+json"
|
options["headers"]["Accept"] = "application/ld+json"
|
||||||
|
|
||||||
|
# XXX: temp fix/hack is it seems to be down for now
|
||||||
|
if url == "https://w3id.org/identity/v1":
|
||||||
|
url = (
|
||||||
|
"https://raw.githubusercontent.com/web-payments/web-payments.org"
|
||||||
|
"/master/contexts/identity-v1.jsonld"
|
||||||
|
)
|
||||||
return requests_loader(url, options)
|
return requests_loader(url, options)
|
||||||
|
|
||||||
|
|
||||||
|
@ -34,7 +41,7 @@ def _options_hash(doc: ap.RawObject) -> str:
|
||||||
for k in ["type", "id", "signatureValue"]:
|
for k in ["type", "id", "signatureValue"]:
|
||||||
if k in doc:
|
if k in doc:
|
||||||
del doc[k]
|
del doc[k]
|
||||||
doc["@context"] = "https://w3id.org/identity/v1"
|
doc["@context"] = "https://w3id.org/security/v1"
|
||||||
normalized = jsonld.normalize(
|
normalized = jsonld.normalize(
|
||||||
doc, {"algorithm": "URDNA2015", "format": "application/nquads"}
|
doc, {"algorithm": "URDNA2015", "format": "application/nquads"}
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue