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:
		@@ -27,11 +27,11 @@ class BlockService < BaseService
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def build_json(block)
 | 
			
		||||
    ActiveModelSerializers::SerializableResource.new(
 | 
			
		||||
    Oj.dump(ActivityPub::LinkedDataSignature.new(ActiveModelSerializers::SerializableResource.new(
 | 
			
		||||
      block,
 | 
			
		||||
      serializer: ActivityPub::BlockSerializer,
 | 
			
		||||
      adapter: ActivityPub::Adapter
 | 
			
		||||
    ).to_json
 | 
			
		||||
    ).as_json).sign!(block.account))
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def build_xml(block)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user