mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-11-09 16:35:48 +00:00
8cf7006d4e
* Move ActivityPub::FetchRemoteAccountService to ActivityPub::FetchRemoteActorService ActivityPub::FetchRemoteAccountService is kept as a wrapper for when the actor is specifically required to be an Account * Refactor SignatureVerification to allow non-Account actors * fixup! Move ActivityPub::FetchRemoteAccountService to ActivityPub::FetchRemoteActorService * Refactor ActivityPub::FetchRemoteKeyService to potentially return non-Account actors * Refactor inbound ActivityPub payload processing to accept non-Account actors * Refactor inbound ActivityPub processing to accept activities relayed through non-Account * Refactor how Account key URIs are built * Refactor Request and drop unused key_id_format parameter * Rename ActivityPub::Dereferencer `signature_account` to `signature_actor`
13 lines
567 B
Ruby
13 lines
567 B
Ruby
# frozen_string_literal: true
|
|
|
|
class ActivityPub::FetchRemoteAccountService < ActivityPub::FetchRemoteActorService
|
|
# Does a WebFinger roundtrip on each call, unless `only_key` is true
|
|
def call(uri, id: true, prefetched_body: nil, break_on_redirect: false, only_key: false, suppress_errors: true)
|
|
actor = super
|
|
return actor if actor.nil? || actor.is_a?(Account)
|
|
|
|
Rails.logger.debug "Fetching account #{uri} failed: Expected Account, got #{actor.class.name}"
|
|
raise Error, "Expected Account, got #{actor.class.name}" unless suppress_errors
|
|
end
|
|
end
|