authz: expand LD Sigs check to any signature field, regardless of creator

for #566
pull/1094/head
Ryan Barrett 2024-05-28 15:15:23 -07:00
rodzic e26a845592
commit fc14298f0d
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 6BE31FDF4776E9D4
1 zmienionych plików z 2 dodań i 5 usunięć

Wyświetl plik

@ -762,11 +762,8 @@ class Protocol:
elif actor != authed_as:
if ld_sig := obj.as1.get('signature'):
creator = ld_sig.get('creator', '')
suffix = creator.removeprefix(actor)
if suffix != creator and (suffix.startswith('#')
or suffix.startswith('/')):
logger.info(f'Auth_: ignoring activity with LD Signature from {creator}')
return "Ignoring, sorry, we don't yet verify LD Signatures", 204
logger.info(f'Auth_: ignoring activity with LD Signature from {creator}')
return "Ignoring, sorry, we don't yet verify LD Signatures", 204
logger.warning(f"Auth: actor {actor} isn't authed user {authed_as}")
else:
logger.warning(f"Auth: missing authed_as!")