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:
parent
1cebfed23e
commit
00840f4f2e
25 changed files with 369 additions and 30 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue