noop: move canonicalizing AT URIs TODO from ATProto to Object

pull/642/head
Ryan Barrett 2023-09-14 16:52:22 -07:00
rodzic b8f55ec352
commit b45635b125
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 6BE31FDF4776E9D4
3 zmienionych plików z 5 dodań i 3 usunięć

Wyświetl plik

@ -341,8 +341,6 @@ def poll_notifications():
logger.info(f'Got {notif["reason"]} from {notif["author"]["handle"]} {notif["uri"]} {notif["cid"]}')
# TODO: verify sig
# TODO: if notif.uri has handle, resolve and replace with DID
# ...but that's probably unlikely, at least coming from AppView?
obj = Object.get_or_create(id=notif['uri'], bsky=notif['record'],
source_protocol=ATProto.ABBREV)
if not obj.status:

Wyświetl plik

@ -502,6 +502,11 @@ class Object(StringIdModel):
if self.key.id().startswith('at://'):
repo, _, _ = arroba.util.parse_at_uri(self.key.id())
if not repo.startswith('did:'):
# TODO: if we hit this, that means the AppView gave us an AT URI
# with a handle repo/authority instead of DID. that's surprising!
# ...if so, and if we need to handle it, add a new
# arroba.did.canonicalize_at_uri() function, then use it here,
# or before.
raise ValueError(
f'at:// URI ids must have DID repos; got {self.key.id()}')

Wyświetl plik

@ -398,7 +398,6 @@ class ATProtoTest(TestCase):
requests_response({
'cursor': '...',
'notifications': [{
# TODO
'uri': 'at://did:plc:d/app.bsky.feed.like/123',
'cid': '...',
'author': eve,