smoothcode 0.0.2 → 0.0.3

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/smoothcode/auth.rb +4 -2
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ff4a0cff790cc8b04fbed289e2de6390bd2d2267632ea746b9c1ce6cd2b4cd5b
4
- data.tar.gz: b8278888957fa47f498550a2405ca4c43a5d61dda48b222086ca04bd260e536a
3
+ metadata.gz: 969f89d7113502314207c31135340ebf1d176fabc250091e0387077b80cd2cab
4
+ data.tar.gz: 00c8fd602c6495d0bfe6655e9f60b539523622d4950461b66a19daa51de96113
5
5
  SHA512:
6
- metadata.gz: 406f2b2d3086bf52f42e12ff18a91e6dda5a29b303ba853b870f4af5e78c49a30accd9e0d2b7fe37ceabe233b8259895effbe85ef0e8891f9970474ff651e372
7
- data.tar.gz: 1f6efec678605a23ed554bc435237cceb302ff6dc0a6e40a1ea7119d56ca37f00cf893b618a118a4ae4d0b991c4a76a4475207f2cc0e0647d1af5de31194aa7d
6
+ metadata.gz: a01046dc0f78d162d3f665d59a7a518387253a9a3e405dcc1811975ec6a6fceb1c9d5cd04aacfb4b8451d66ebe75a2f0ed99f2af94b8eb5c1b42a65d7876e311
7
+ data.tar.gz: f27446ff540604c2c8acf6b55d6cf814ff194c3903e2544c4bc08151b0c3f188992e9d775a72a595bf580c9844b4cef91ca181eed55f070c3b8e9a0dfcc3dc68
@@ -1,5 +1,4 @@
1
1
  require_relative 'utils'
2
- require 'json'
3
2
 
4
3
  class SmoothCodeAuth
5
4
  def initialize(request_hmac, client_secret)
@@ -12,6 +11,9 @@ class SmoothCodeAuth
12
11
  end
13
12
 
14
13
  def webhook_request?(webhook_data)
15
- generate_hmac(@client_secret, webhook_data.to_json) == @request_hmac
14
+ webhook_data = webhook_data.transform_keys(&:to_sym)
15
+ webhook_id = webhook_data[:id]
16
+
17
+ generate_hmac(@client_secret, webhook_id.to_s) == @request_hmac
16
18
  end
17
19
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smoothcode
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - SmoothCode
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-24 00:00:00.000000000 Z
11
+ date: 2022-01-26 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Ruby client to interact with SmoothCode
14
14
  email: hello@smoothcode.io