Make verify_ld_signature more robust. Make Tombstone objects signable.

ap-processing-improvements
Alain St-Denis 2023-07-24 08:32:32 -04:00
rodzic 091b156703
commit 54a8404c3d
2 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -99,6 +99,6 @@ class NormalizedDoubles(jsonld.JsonLdProcessor):
item['@value'] = math.floor(value)
obj = super()._object_to_rdf(item, issuer, triples, rdfDirection)
# This is to address https://github.com/digitalbazaar/pyld/issues/175
if obj.get('datatype') == jsonld.XSD_DOUBLE:
if obj and obj.get('datatype') == jsonld.XSD_DOUBLE:
obj['value'] = re.sub(r'(\d)0*E\+?(-)?0*(\d)', r'\1E\2\3', obj['value'])
return obj

Wyświetl plik

@ -1205,6 +1205,7 @@ class Retraction(Announce, base.Retraction):
class Tombstone(Object, base.Retraction):
target_id = fields.Id()
signable = True
def to_as2(self):
if not isinstance(self.activity, type): return None