bridgy-fed
bridgy-fed copied to clipboard
Refactor code for normalizing IDs
...ie converting them to the canonical representation for their protocol. http://user.com/
=> user.com
for web, http://instance/@user
=> http://instance/users/user
for fediverse, https://bsky.app/profile/user
=> did:plc:abc
for ATProto, etc.
We currently do this in ids.translate_*
and ids.normalize_user_id
, and a bit ad hoc elsewhere too, and we use it in Object.normalize_ids
, but it's not very clean, it causes circular imports in ids, and it's not easily reusable enough elsewhere, eg for #1172.
Made a lot of progress on this in a stash, but there's still a lot of work left to do.