activitypub 0.5.2 → 0.5.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/examples/get_actor.rb +3 -0
- data/lib/activitypub/resolvers.rb +3 -1
- data/lib/activitypub/uri.rb +6 -6
- data/lib/activitypub/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 52a331dd7c66c7468b64dc33d41ea99a01eb1cd4b637fefd1aff67dae76ea659
|
4
|
+
data.tar.gz: 4e04114e92eb30ba376e2679cee67f8d15b60f9f73d7b8461166c49ee7b269d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1fe0b3d9f2784b16d62b1d5c7a459b846add2fe0353593a7ca2bad636e432d8a50611d83094916565ecc79d0cb18d2768da62787b1e37e5c00297029f24c06dc
|
7
|
+
data.tar.gz: 6cf20a531d8fe0b748b397b9e2127b018c25f35630bb5ccd886405bc26345ca5e5fbc0c4c6510f182ef9c35409abfa1110caa364b5946451edf4c3ab42aa84db
|
data/examples/get_actor.rb
CHANGED
@@ -36,6 +36,7 @@ puts "Enter to continue"
|
|
36
36
|
gets
|
37
37
|
|
38
38
|
puts "Trying to retrieve outbox"
|
39
|
+
p ob.outbox
|
39
40
|
ob = ob.outbox.get
|
40
41
|
PP.pp(ob)
|
41
42
|
puts
|
@@ -48,6 +49,8 @@ ob = ob.first.get
|
|
48
49
|
PP.pp(ob)
|
49
50
|
|
50
51
|
# For now, this will let you iterate through the collection.
|
52
|
+
|
53
|
+
|
51
54
|
# while ob && ob.orderedItems.length > 0
|
52
55
|
# PP.pp ob.id
|
53
56
|
# ob = ob.next&.get
|
@@ -2,6 +2,7 @@
|
|
2
2
|
require 'uri'
|
3
3
|
require 'faraday'
|
4
4
|
require 'socket'
|
5
|
+
require 'ipaddr'
|
5
6
|
|
6
7
|
# Classes to resolve URI's into objects.
|
7
8
|
|
@@ -12,7 +13,8 @@ module ActivityPub
|
|
12
13
|
def self.call(path)
|
13
14
|
|
14
15
|
uri = URI(path)
|
15
|
-
|
16
|
+
addr = IPAddr.new(IPSocket.getaddress(uri.host))
|
17
|
+
if addr.loopback? || addr.private? || addr.link_local?
|
16
18
|
raise "Local access denied"
|
17
19
|
end
|
18
20
|
|
data/lib/activitypub/uri.rb
CHANGED
@@ -3,18 +3,18 @@ require_relative 'resolvers'
|
|
3
3
|
|
4
4
|
module ActivityPub
|
5
5
|
class URI
|
6
|
-
|
6
|
+
attr_writer :_resolver
|
7
7
|
|
8
8
|
def initialize(href, resolver: nil)
|
9
9
|
@href = href
|
10
|
-
@_resolver = resolver
|
10
|
+
@_resolver = resolver
|
11
11
|
end
|
12
12
|
|
13
|
+
def _resolver = (@_resolver || WebResolver)
|
14
|
+
|
13
15
|
def to_s = @href
|
14
16
|
def to_json(...) = @href
|
15
|
-
|
16
|
-
def get
|
17
|
-
@_resolver&.call(self.to_s)
|
18
|
-
end
|
17
|
+
|
18
|
+
def get = _resolver.call(self.to_s)
|
19
19
|
end
|
20
20
|
end
|
data/lib/activitypub/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activitypub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vidar Hokstad
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-07-
|
11
|
+
date: 2024-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: webfinger
|