shopify_api 11.0.0 → 11.0.1
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/CHANGELOG.md +6 -0
- data/Gemfile.lock +1 -1
- data/lib/shopify_api/utils/hmac_validator.rb +16 -6
- data/lib/shopify_api/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: 480de35765a695c4111ca43f241270a12a7eb4a22c83844fa5820a27ac829125
|
4
|
+
data.tar.gz: 5d20da61c0cad987a0b6048cf6a10460af29e80df2d7c89617e24e12fc5f1049
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68662d27963ec681ca2b1604e11991f33ae19b3833711828743ac17905c5ed62ed37d2ca425b2042ea2093608ece1cc14d2bc2052f0f6b71c42d21b667e7ef71
|
7
|
+
data.tar.gz: febcfc8ca74c8bf13529d71d91ef6083075c011edb4aeda539b3e5a7d003471a2536a94180ba182b8bbf335ac7f7d9f4752e49ddfac08d1897e02880b24bbff8
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,12 @@ Note: For changes to the API, see https://shopify.dev/changelog?filter=api
|
|
4
4
|
|
5
5
|
## Unreleased
|
6
6
|
|
7
|
+
N/A
|
8
|
+
|
9
|
+
## Version 11.0.1
|
10
|
+
|
11
|
+
- [#990](https://github.com/Shopify/shopify-api-ruby/pull/991) Validate `hmac` signature of OAuth callback using both old and new API secrets
|
12
|
+
|
7
13
|
## Version 11.0.0
|
8
14
|
|
9
15
|
- [#987](https://github.com/Shopify/shopify_api/pull/987) ⚠️ [Breaking] Add REST resources for July 2022 API version, remove support and REST resources for July 2021 (`2021-07`) API version
|
data/Gemfile.lock
CHANGED
@@ -13,18 +13,28 @@ module ShopifyAPI
|
|
13
13
|
def validate(verifiable_query)
|
14
14
|
return false unless verifiable_query.hmac
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
result = validate_signature(verifiable_query, Context.api_secret_key)
|
17
|
+
if result || Context.old_api_secret_key.blank?
|
18
|
+
result
|
19
|
+
else
|
20
|
+
validate_signature(verifiable_query, T.must(Context.old_api_secret_key))
|
21
|
+
end
|
19
22
|
end
|
20
23
|
|
21
24
|
private
|
22
25
|
|
23
|
-
sig { params(
|
24
|
-
def
|
26
|
+
sig { params(verifiable_query: VerifiableQuery, secret: String).returns(T::Boolean) }
|
27
|
+
def validate_signature(verifiable_query, secret)
|
28
|
+
received_signature = verifiable_query.hmac
|
29
|
+
computed_signature = compute_signature(verifiable_query.to_signable_string, secret)
|
30
|
+
OpenSSL.secure_compare(computed_signature, received_signature)
|
31
|
+
end
|
32
|
+
|
33
|
+
sig { params(signable_string: String, secret: String).returns(String) }
|
34
|
+
def compute_signature(signable_string, secret)
|
25
35
|
OpenSSL::HMAC.hexdigest(
|
26
36
|
OpenSSL::Digest.new("sha256"),
|
27
|
-
|
37
|
+
secret,
|
28
38
|
signable_string,
|
29
39
|
)
|
30
40
|
end
|
data/lib/shopify_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shopify_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 11.0.
|
4
|
+
version: 11.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-07-
|
11
|
+
date: 2022-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|