mirror of https://github.com/Siphonay/mastodon
Fix unneeded requests to blocked domains when receiving relayed signed activities from them (#31161)
This commit is contained in:
parent
f397550311
commit
754b03d8cb
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
class ActivityPub::ProcessCollectionService < BaseService
|
class ActivityPub::ProcessCollectionService < BaseService
|
||||||
include JsonLdHelper
|
include JsonLdHelper
|
||||||
|
include DomainControlHelper
|
||||||
|
|
||||||
def call(body, actor, **options)
|
def call(body, actor, **options)
|
||||||
@account = actor
|
@account = actor
|
||||||
|
@ -69,6 +70,9 @@ class ActivityPub::ProcessCollectionService < BaseService
|
||||||
end
|
end
|
||||||
|
|
||||||
def verify_account!
|
def verify_account!
|
||||||
|
return unless @json['signature'].is_a?(Hash)
|
||||||
|
return if domain_not_allowed?(@json['signature']['creator'])
|
||||||
|
|
||||||
@options[:relayed_through_actor] = @account
|
@options[:relayed_through_actor] = @account
|
||||||
@account = ActivityPub::LinkedDataSignature.new(@json).verify_actor!
|
@account = ActivityPub::LinkedDataSignature.new(@json).verify_actor!
|
||||||
@account = nil unless @account.is_a?(Account)
|
@account = nil unless @account.is_a?(Account)
|
||||||
|
|
Loading…
Reference in New Issue