distributed-press-api-client 0.3.0rc3 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/distributed_press/v1/social/client.rb +19 -0
- data/lib/distributed_press/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6731553fbdfb80318a3ffedd78b9805594fc9817a8554516c8ac3c8982df3345
|
4
|
+
data.tar.gz: 3e5fb1bf9ac4526acec284834505c19a0811bc5c51fccc177a712073794e4ab8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2dc6826aaa09cccc207933c3fd9c60de6e5fed15f2c2e7617090079ee74f666ba3ae95c3a51d7543279dae1bc0be64564855ca883abe251b7df6fc1eb01d9f65
|
7
|
+
data.tar.gz: 31835fadab543760c181269ab9284e0c52c91784f0c46f7f9e1ca7389926e0108bea25bf053ff2c3657acb5724ddc51bfff0249e74b2f3b97f21b2a4537fc72e
|
@@ -26,6 +26,8 @@ class DistributedPress
|
|
26
26
|
REQUEST_TARGET = '(request-target)'
|
27
27
|
# Headers included in the signature
|
28
28
|
SIGNABLE_HEADERS = [REQUEST_TARGET, 'Host', 'Date', 'Digest']
|
29
|
+
# Content types
|
30
|
+
CONTENT_TYPES = %w[application/ld+json application/activity+json]
|
29
31
|
|
30
32
|
# API URL
|
31
33
|
# @return [String]
|
@@ -54,6 +56,23 @@ class DistributedPress
|
|
54
56
|
@public_key_url = public_key_url
|
55
57
|
@key_size = key_size
|
56
58
|
@private_key_pem = private_key_pem
|
59
|
+
|
60
|
+
CONTENT_TYPES.each do |content_type|
|
61
|
+
HTTParty::Parser::SupportedFormats[content_type] = :json
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
# GET request
|
66
|
+
#
|
67
|
+
# @param endpoint [String]
|
68
|
+
# @return [Hash]
|
69
|
+
def get(endpoint:)
|
70
|
+
headers = default_headers
|
71
|
+
|
72
|
+
add_request_specific_headers! headers, 'get', endpoint
|
73
|
+
sign_headers! headers
|
74
|
+
|
75
|
+
self.class.get(endpoint, headers: headers)
|
57
76
|
end
|
58
77
|
|
59
78
|
# POST request
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: distributed-press-api-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- f
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -309,9 +309,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
309
309
|
version: '2.7'
|
310
310
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
311
311
|
requirements:
|
312
|
-
- - "
|
312
|
+
- - ">="
|
313
313
|
- !ruby/object:Gem::Version
|
314
|
-
version:
|
314
|
+
version: '0'
|
315
315
|
requirements: []
|
316
316
|
rubygems_version: 3.3.26
|
317
317
|
signing_key:
|