distributed-press-api-client 0.3.0rc3 → 0.3.0rc4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 154095013e8b830f778bba2811430c9fc63fb7cdbc110950baaf64bd6770dab0
4
- data.tar.gz: 26af64c2f3d72d265df12108290023c937068f6d60a559ea55b6e52cf890b72d
3
+ metadata.gz: 38b096c332f629aa84304173aadd7683573c1d7f2d6fecbb35aa7c75e42185bd
4
+ data.tar.gz: f8248f49a1453ed82a1384e9847fe66cb5cf33c265f21f780c192d3b1527ec2b
5
5
  SHA512:
6
- metadata.gz: 0dd08e4d69ff262009a65c52c9891516a113d3ff3f865659d96a1cc5bebe6b20a47b909daab826e6900bd71013cd523970462dbe699cd3944cd56f9922131f34
7
- data.tar.gz: 23064d8e44ae4e66d62ad5169db37ad59ec4e9f1ae9fbfe0f3db534e9aacda3ae08bd15830e67eaafb028e5eceb294ed0352e3ceeb435f2469546fba6dd2c28f
6
+ metadata.gz: 5d5e98110c0e40c433e2a76690eda3e910116f7e9fdd51234038d93dd3e72abd56048b958c17552af3cbb9b14c077f079aca0549096eaf7e74bd360c4323e5fb
7
+ data.tar.gz: 0017a9f71b6bb9914e0d677ea0fa0ecc87f4253441e2826595e29dae0e6b5530cc7badd1cd64513f25873236f9c720fbabd3f82741057c79bb701da99d35811c
@@ -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
@@ -3,5 +3,5 @@
3
3
  # API client
4
4
  class DistributedPress
5
5
  # Version
6
- VERSION = '0.3.0rc3'
6
+ VERSION = '0.3.0rc4'
7
7
  end
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.0rc3
4
+ version: 0.3.0rc4
5
5
  platform: ruby
6
6
  authors:
7
7
  - f
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-01 00:00:00.000000000 Z
11
+ date: 2023-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable