mirror of https://gitlab.com/bashrc2/epicyon
More descriptive jsonld failures
parent
e6b9382a0a
commit
5c5e6c7d1a
11
inbox.py
11
inbox.py
|
@ -2743,6 +2743,7 @@ def runInboxQueue(recentPostsCache: {}, maxRecentPosts: int,
|
||||||
|
|
||||||
# check if a json signature exists on this post
|
# check if a json signature exists on this post
|
||||||
hasJsonSignature = False
|
hasJsonSignature = False
|
||||||
|
jwebsigType = None
|
||||||
originalJson = queueJson['original']
|
originalJson = queueJson['original']
|
||||||
if originalJson.get('@context') and \
|
if originalJson.get('@context') and \
|
||||||
originalJson.get('signature'):
|
originalJson.get('signature'):
|
||||||
|
@ -2751,7 +2752,8 @@ def runInboxQueue(recentPostsCache: {}, maxRecentPosts: int,
|
||||||
jwebsig = originalJson['signature']
|
jwebsig = originalJson['signature']
|
||||||
# signature exists and is of the expected type
|
# signature exists and is of the expected type
|
||||||
if jwebsig.get('type') and jwebsig.get('signatureValue'):
|
if jwebsig.get('type') and jwebsig.get('signatureValue'):
|
||||||
if jwebsig['type'] == 'RsaSignature2017':
|
jwebsigType = jwebsig['type']
|
||||||
|
if jwebsigType == 'RsaSignature2017':
|
||||||
if hasValidContext(originalJson):
|
if hasValidContext(originalJson):
|
||||||
hasJsonSignature = True
|
hasJsonSignature = True
|
||||||
else:
|
else:
|
||||||
|
@ -2761,8 +2763,13 @@ def runInboxQueue(recentPostsCache: {}, maxRecentPosts: int,
|
||||||
# strict enforcement of json signatures
|
# strict enforcement of json signatures
|
||||||
if not hasJsonSignature:
|
if not hasJsonSignature:
|
||||||
if httpSignatureFailed:
|
if httpSignatureFailed:
|
||||||
|
if jwebsigType:
|
||||||
|
print('Queue: Header signature check failed and does ' +
|
||||||
|
'not have a recognised jsonld signature type ' +
|
||||||
|
jwebsigType)
|
||||||
|
else:
|
||||||
print('Queue: Header signature check failed and ' +
|
print('Queue: Header signature check failed and ' +
|
||||||
'unable to check json signature')
|
'does not have jsonld signature')
|
||||||
|
|
||||||
if verifyAllSignatures:
|
if verifyAllSignatures:
|
||||||
print('Queue: inbox post does not have a jsonld signature ' +
|
print('Queue: inbox post does not have a jsonld signature ' +
|
||||||
|
|
Loading…
Reference in New Issue