forked from indymedia/epicyon
Only jsonld sign if a previous signature does not exist
parent
bbb767ae45
commit
3766f6e9c1
26
posts.py
26
posts.py
|
@ -1419,12 +1419,13 @@ def sendPost(projectVersion: str,
|
||||||
return 7
|
return 7
|
||||||
postPath = inboxUrl.split(toDomain, 1)[1]
|
postPath = inboxUrl.split(toDomain, 1)[1]
|
||||||
|
|
||||||
try:
|
if not postJsonObject.get('signature'):
|
||||||
signedPostJsonObject = jsonldSign(postJsonObject, privateKeyPem)
|
try:
|
||||||
postJsonObject = signedPostJsonObject
|
signedPostJsonObject = jsonldSign(postJsonObject, privateKeyPem)
|
||||||
except BaseException:
|
postJsonObject = signedPostJsonObject
|
||||||
print('WARN: failed to JSON-LD sign post')
|
except BaseException:
|
||||||
pass
|
print('WARN: failed to JSON-LD sign post')
|
||||||
|
pass
|
||||||
|
|
||||||
# convert json to string so that there are no
|
# convert json to string so that there are no
|
||||||
# subsequent conversions after creating message body digest
|
# subsequent conversions after creating message body digest
|
||||||
|
@ -1749,12 +1750,13 @@ def sendSignedJson(postJsonObject: {}, session, baseDir: str,
|
||||||
|
|
||||||
addFollowersToPublicPost(postJsonObject)
|
addFollowersToPublicPost(postJsonObject)
|
||||||
|
|
||||||
try:
|
if not postJsonObject.get('signature'):
|
||||||
signedPostJsonObject = jsonldSign(postJsonObject, privateKeyPem)
|
try:
|
||||||
postJsonObject = signedPostJsonObject
|
signedPostJsonObject = jsonldSign(postJsonObject, privateKeyPem)
|
||||||
except BaseException:
|
postJsonObject = signedPostJsonObject
|
||||||
print('WARN: failed to JSON-LD sign post')
|
except BaseException:
|
||||||
pass
|
print('WARN: failed to JSON-LD sign post')
|
||||||
|
pass
|
||||||
|
|
||||||
# convert json to string so that there are no
|
# convert json to string so that there are no
|
||||||
# subsequent conversions after creating message body digest
|
# subsequent conversions after creating message body digest
|
||||||
|
|
Loading…
Reference in New Issue