mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02: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
|