Change code to use first usable keypairs record for local user for signing, if it exists (#39662)

This commit is contained in:
Claire authored and GitHub committed 2026-07-01 12:49:42 +00:00
1 parent 68627adff4
commit 7fc19f81aa
14 files changed
+115 -33

No files matched your search

+5 -1
View File
@@ -48,7 +48,7 @@ class ActivityPub::DeliveryWorker
def build_request(http_client)
Request.new(:post, @inbox_url, body: @json, http_client: http_client).tap do |request|
request.on_behalf_of(@source_account, sign_with: @options[:sign_with])
request.on_behalf_of(@source_account, sign_with: sign_with)
request.add_headers(HEADERS)
request.add_headers({ 'Collection-Synchronization' => synchronization_header }) if ENV['DISABLE_FOLLOWERS_SYNCHRONIZATION'] != 'true' && @options[:synchronize_followers]
end
@@ -93,4 +93,8 @@ class ActivityPub::DeliveryWorker
def request_pool
RequestPool.current
end
def sign_with
@options[:sign_with].presence && Keypair.from_worker_arg(@source_account, @options[:sign_with])
end
end
@@ -23,6 +23,10 @@ class ActivityPub::UpdateDistributionWorker < ActivityPub::RawDistributionWorker
end
def payload
@payload ||= serialize_payload(@account, ActivityPub::UpdateActorSerializer, signer: @account, sign_with: @options[:sign_with]).to_json
@payload ||= serialize_payload(@account, ActivityPub::UpdateActorSerializer, signer: @account, sign_with: sign_with).to_json
end
def sign_with
@options[:sign_with].presence && Keypair.from_worker_arg(@account, @options[:sign_with])
end
end