Add handling of Linked Data Signatures in payloads (#4687)
* Add handling of Linked Data Signatures in payloads * Add a way to sign JSON, fix canonicalization of signature options * Fix signatureValue encoding, send out signed JSON when distributing * Add missing security context
This commit is contained in:
		@@ -23,11 +23,11 @@ class UnfollowService < BaseService
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def build_json(follow)
 | 
			
		||||
    ActiveModelSerializers::SerializableResource.new(
 | 
			
		||||
    Oj.dump(ActivityPub::LinkedDataSignature.new(ActiveModelSerializers::SerializableResource.new(
 | 
			
		||||
      follow,
 | 
			
		||||
      serializer: ActivityPub::UndoFollowSerializer,
 | 
			
		||||
      adapter: ActivityPub::Adapter
 | 
			
		||||
    ).to_json
 | 
			
		||||
    ).as_json).sign!(follow.account))
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def build_xml(follow)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user