mirror of
https://github.com/mastodon/mastodon.git
synced 2025-10-05 16:42:47 +00:00
Fix QuoteAuthorization id not being properly serialized when federating revocation (#36083)
This commit is contained in:
parent
8a0d0025ff
commit
b60ee191ac
|
@ -8,7 +8,7 @@ class ActivityPub::QuoteAuthorizationSerializer < ActivityPub::Serializer
|
||||||
attributes :id, :type, :attributed_to, :interacting_object, :interaction_target
|
attributes :id, :type, :attributed_to, :interacting_object, :interaction_target
|
||||||
|
|
||||||
def id
|
def id
|
||||||
ActivityPub::TagManager.instance.approval_uri_for(object)
|
ActivityPub::TagManager.instance.approval_uri_for(object, check_approval: !instance_options[:force_approval_id])
|
||||||
end
|
end
|
||||||
|
|
||||||
def type
|
def type
|
||||||
|
|
|
@ -34,6 +34,6 @@ class RevokeQuoteService < BaseService
|
||||||
end
|
end
|
||||||
|
|
||||||
def signed_activity_json
|
def signed_activity_json
|
||||||
@signed_activity_json ||= Oj.dump(serialize_payload(@quote, ActivityPub::DeleteQuoteAuthorizationSerializer, signer: @account, always_sign: true))
|
@signed_activity_json ||= Oj.dump(serialize_payload(@quote, ActivityPub::DeleteQuoteAuthorizationSerializer, signer: @account, always_sign: true, force_approval_id: true))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -20,7 +20,22 @@ RSpec.describe RevokeQuoteService do
|
||||||
it 'revokes the quote and sends a Delete activity' do
|
it 'revokes the quote and sends a Delete activity' do
|
||||||
expect { described_class.new.call(quote) }
|
expect { described_class.new.call(quote) }
|
||||||
.to change { quote.reload.state }.from('accepted').to('revoked')
|
.to change { quote.reload.state }.from('accepted').to('revoked')
|
||||||
.and enqueue_sidekiq_job(ActivityPub::DeliveryWorker).with(/Delete/, alice.id, hank.inbox_url)
|
.and enqueue_sidekiq_job(ActivityPub::DeliveryWorker).with(
|
||||||
|
match_json_values(
|
||||||
|
type: 'Delete',
|
||||||
|
id: %r{https://.*},
|
||||||
|
object: include(
|
||||||
|
type: 'QuoteAuthorization',
|
||||||
|
id: %r{https://.*},
|
||||||
|
attributedTo: ActivityPub::TagManager.instance.uri_for(alice),
|
||||||
|
interactionTarget: ActivityPub::TagManager.instance.uri_for(status),
|
||||||
|
interactingObject: ActivityPub::TagManager.instance.uri_for(quote.status)
|
||||||
|
),
|
||||||
|
actor: ActivityPub::TagManager.instance.uri_for(alice)
|
||||||
|
),
|
||||||
|
alice.id,
|
||||||
|
hank.inbox_url
|
||||||
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user