diff options
author | Claire <claire.github-309c@sitedethib.com> | 2022-10-03 09:03:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-03 09:03:11 +0200 |
commit | 2aafdd0efb3fa0bf067e0b08a627a462793f296b (patch) | |
tree | d559e2dec7ceb4c446db973b5c040a708d1c5756 /app/services/activitypub/process_collection_service.rb | |
parent | 9d7c323abdda66423751f3a25faf960674af8a49 (diff) | |
parent | 6ee768b7b285382fce3270ad4cf06c71838182d8 (diff) |
Merge pull request #1848 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/services/activitypub/process_collection_service.rb')
-rw-r--r-- | app/services/activitypub/process_collection_service.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/app/services/activitypub/process_collection_service.rb b/app/services/activitypub/process_collection_service.rb index eb008c40a..fffe30195 100644 --- a/app/services/activitypub/process_collection_service.rb +++ b/app/services/activitypub/process_collection_service.rb @@ -3,8 +3,8 @@ class ActivityPub::ProcessCollectionService < BaseService include JsonLdHelper - def call(body, account, **options) - @account = account + def call(body, actor, **options) + @account = actor @json = original_json = Oj.load(body, mode: :strict) @options = options @@ -16,6 +16,7 @@ class ActivityPub::ProcessCollectionService < BaseService end return if !supported_context? || (different_actor? && verify_account!.nil?) || suspended_actor? || @account.local? + return unless @account.is_a?(Account) if @json['signature'].present? # We have verified the signature, but in the compaction step above, might @@ -66,8 +67,10 @@ class ActivityPub::ProcessCollectionService < BaseService end def verify_account! - @options[:relayed_through_account] = @account - @account = ActivityPub::LinkedDataSignature.new(@json).verify_account! + @options[:relayed_through_actor] = @account + @account = ActivityPub::LinkedDataSignature.new(@json).verify_actor! + @account = nil unless @account.is_a?(Account) + @account rescue JSON::LD::JsonLdError => e Rails.logger.debug "Could not verify LD-Signature for #{value_or_id(@json['actor'])}: #{e.message}" nil |