jekyll-activity-pub 0.1.0rc14 → 0.1.0rc15
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85320eb7b8fa252e8e66bb733d4ab51478b379f4ebd6211c0fbc6387f425cffc
|
4
|
+
data.tar.gz: 122b5349c06408910f743f255112df2acc3318cc0ede289ea5811a030fda3b65
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2111ddfe7cf26d72088b000014c6ac690a731235c392e9d2cb86a7831913a53d1e27a6a6920c599a52218f275eaf29f473dc37b03b561bbc8abe64d0ddafb6c
|
7
|
+
data.tar.gz: 5ec690882fbc64d533a1f02741252215e71b9a156d7697228afa5b71bbd927d4bda149d3724f88ca598bd9e58530c21f350ae5c59694e1e1a9cb0256c505be32
|
@@ -116,10 +116,10 @@ module Jekyll
|
|
116
116
|
|
117
117
|
unless response.ok?
|
118
118
|
raise NotificationError,
|
119
|
-
"Could't fetch public key (#{response.code}: #{response.message})"
|
119
|
+
"Could't fetch public key (#{response.code}: #{response.message}). It needs to be available at #{public_key_url} before notifications can work, because it's used for signature verification."
|
120
120
|
end
|
121
121
|
|
122
|
-
unless client.private_key.compare? OpenSSL::PKey::RSA.new(response.
|
122
|
+
unless client.private_key.compare? OpenSSL::PKey::RSA.new(response.parsed_response.dig('publicKey', 'publicKeyPem'))
|
123
123
|
raise NotificationError, "Public key at #{public_key_url} differs from local version"
|
124
124
|
end
|
125
125
|
|
@@ -27,14 +27,14 @@ module Jekyll
|
|
27
27
|
|
28
28
|
actor.data['publicKey'] = self
|
29
29
|
|
30
|
-
Notifier.public_key_url =
|
30
|
+
Notifier.public_key_url = data['id']
|
31
31
|
|
32
32
|
trigger_hooks :post_init
|
33
33
|
end
|
34
34
|
|
35
35
|
def read_yaml(*)
|
36
36
|
self.data = {
|
37
|
-
'id' => absolute_url(url),
|
37
|
+
'id' => "#{absolute_url(@actor.url)}#main-key",
|
38
38
|
'owner' => absolute_url(@actor.url),
|
39
39
|
'publicKeyPem' => @public_key.public_to_pem
|
40
40
|
}
|
@@ -0,0 +1,61 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'jekyll/page'
|
4
|
+
require_relative 'helper'
|
5
|
+
|
6
|
+
module Jekyll
|
7
|
+
module ActivityPub
|
8
|
+
# Represents a removed activity
|
9
|
+
class Tombstone < Jekyll::Page
|
10
|
+
include Helper
|
11
|
+
|
12
|
+
# @param :object_id [String]
|
13
|
+
attr_reader :object_id
|
14
|
+
|
15
|
+
# Initialize with default data
|
16
|
+
#
|
17
|
+
# @param :site [Jekyll::Site]
|
18
|
+
# @param :object_id [String]
|
19
|
+
def initialize(site, object_id, )
|
20
|
+
@context = StubContext.new(registers: { site: site })
|
21
|
+
@object_id = object_id
|
22
|
+
|
23
|
+
dest = Pathname.new(object.destination(site.dest)).relative_path_from(site.dest)
|
24
|
+
name = 'tombstone.jsonld'
|
25
|
+
dir = File.join(
|
26
|
+
File.dirname(dest),
|
27
|
+
File.basename(dest, '.jsonld')
|
28
|
+
)
|
29
|
+
|
30
|
+
super(site, '', dir, name)
|
31
|
+
|
32
|
+
trigger_hooks :post_init
|
33
|
+
end
|
34
|
+
|
35
|
+
def read_yaml(*)
|
36
|
+
@data = {
|
37
|
+
'@context' => 'https://www.w3.org/ns/activitystreams',
|
38
|
+
'type' => 'Tomsbtone',
|
39
|
+
'id' => absolute_url(object_id),
|
40
|
+
'published' => object.data[DATE_ATTRIBUTE],
|
41
|
+
'to' => object.data['to'],
|
42
|
+
'cc' => object.data['cc'],
|
43
|
+
'object' => object.data,
|
44
|
+
'inReplyTo' => object.data['in_reply_to']
|
45
|
+
}
|
46
|
+
end
|
47
|
+
|
48
|
+
# @return [Time]
|
49
|
+
def date
|
50
|
+
@date ||= Time.parse(object.data[DATE_ATTRIBUTE])
|
51
|
+
end
|
52
|
+
|
53
|
+
private
|
54
|
+
|
55
|
+
def type
|
56
|
+
@type ||= self.class.name.split('::').last
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-activity-pub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.0rc15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sutty
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: distributed-press-api-client
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.3.
|
19
|
+
version: 0.3.0rc4
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.3.
|
26
|
+
version: 0.3.0rc4
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: jekyll
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -143,6 +143,7 @@ files:
|
|
143
143
|
- lib/jekyll/activity_pub.rb
|
144
144
|
- lib/jekyll/activity_pub/activity.rb
|
145
145
|
- lib/jekyll/activity_pub/actor.rb
|
146
|
+
- lib/jekyll/activity_pub/cache.rb~
|
146
147
|
- lib/jekyll/activity_pub/commands.rb
|
147
148
|
- lib/jekyll/activity_pub/create.rb
|
148
149
|
- lib/jekyll/activity_pub/delete.rb
|
@@ -157,6 +158,7 @@ files:
|
|
157
158
|
- lib/jekyll/activity_pub/outbox.rb
|
158
159
|
- lib/jekyll/activity_pub/property_value.rb
|
159
160
|
- lib/jekyll/activity_pub/public_key.rb
|
161
|
+
- lib/jekyll/activity_pub/tomsbtone.rb~
|
160
162
|
- lib/jekyll/activity_pub/update.rb
|
161
163
|
- lib/jekyll/activity_pub/webfinger.rb
|
162
164
|
- lib/jekyll/command_extension.rb
|