summaryrefslogtreecommitdiff
path: root/helpers.rb
diff options
context:
space:
mode:
authorpdp8 <pdp8@pdp8.info>2023-09-14 20:20:26 +0200
committerpdp8 <pdp8@pdp8.info>2023-09-14 20:20:26 +0200
commit44967ae9f605ca37b6d88e4e8b11a9cf1fdc2b57 (patch)
tree0060d8c1f44a202dc145c211ea7b2230f686acbf /helpers.rb
parent49de4bbdf6d68fef2133f1399131286decae3039 (diff)
note objects fixed, verify reactivated
Diffstat (limited to 'helpers.rb')
-rw-r--r--helpers.rb14
1 files changed, 3 insertions, 11 deletions
diff --git a/helpers.rb b/helpers.rb
index 89ce7d4..536a7c6 100644
--- a/helpers.rb
+++ b/helpers.rb
@@ -17,8 +17,6 @@ helpers do
'to' => to,
'object' => object
}
- activity_path = File.join(OUTBOX[:dir], rel_path)
- save_item activity, activity_path
unless activity['object'].is_a? String
object_rel_path = File.join('object', object['type'].downcase, "#{date}.json")
@@ -51,6 +49,8 @@ helpers do
end
end
end
+ activity_path = File.join(OUTBOX[:dir], rel_path)
+ save_item activity, activity_path
send_activity activity, activity_path
end
@@ -80,6 +80,7 @@ helpers do
signature = Base64.strict_encode64(keypair.sign(OpenSSL::Digest.new('SHA256'), string))
signed_header = "keyId=\"#{ACTOR}#main-key\",algorithm=\"rsa-sha256\",headers=\"(request-target) host date digest content-type\",signature=\"#{signature}\""
+ p inbox
# Net::HTTP fails with OpenSSL error
curl(
"-X POST -H 'Host: #{uri.host}' -H 'Date: #{httpdate}' -H 'Digest: #{digest}' -H 'Signature: #{signed_header}' --data-binary '@#{activity_path}'", inbox
@@ -207,13 +208,4 @@ helpers do
JSON.load_file(f)['id'] == id
end
end
-
- # def find_id(id, return_filename = true)
- # Dir[File.join('**', '*.json')].find do |f|
- # content = JSON.load_file(f)
- # if content['id'] == id
- # return_filename ? f : content
- # end
- # end
- # end
end