From 857b788ae1c25d65dff4cd81c2428453dd3532b9 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 4 May 2021 14:06:27 +0100 Subject: [PATCH] Record any unknown json sigtaure types --- inbox.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/inbox.py b/inbox.py index 0ea654c66..b35498529 100644 --- a/inbox.py +++ b/inbox.py @@ -2991,6 +2991,24 @@ def runInboxQueue(recentPostsCache: {}, maxRecentPosts: int, if unknownFile: unknownFile.write(unknownContext + '\n') unknownFile.close() + else: + print('Unrecognized jsonld signature type: ' + + jwebsigType) + + unknownSignaturesFile = \ + baseDir + '/accounts/unknownJsonSignatures.txt' + + alreadyUnknown = False + if os.path.isfile(unknownSignaturesFile): + if jwebsigType in \ + open(unknownSignaturesFile).read(): + alreadyUnknown = True + + if not alreadyUnknown: + unknownFile = open(unknownSignaturesFile, "a+") + if unknownFile: + unknownFile.write(jwebsigType + '\n') + unknownFile.close() # strict enforcement of json signatures if not hasJsonSignature: