openpix-ruby_sdk 1.0.0 → 1.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: acb4367e543636c06a58f9b1e54a7461f050f655ee7a1049d658ba49e45307a3
4
- data.tar.gz: 2030d59afb88e01194765d2d2ad4283e46d8bbc7a80bb9ce6c3351b2cb11906f
3
+ metadata.gz: 4f2da0e8d196d0f8de84bbb882297bf72d8db63851d8f77af14870af9751b71e
4
+ data.tar.gz: 651770374930d1e49a2c49ef0b05ac83a6a8c138f071c5cd20a1966d86e77de2
5
5
  SHA512:
6
- metadata.gz: aeda3c9f14a2fe7261ea5e10cf9d69ab519a422176d4d0b45694fedd3760bbaae4769386f2ee2278a1091aac6a4f491fb0cc141dbbc9f1039e5447fb00b1bf1e
7
- data.tar.gz: 7db2b6adb11cf5b3cf00c0f652751b2b6dbaf91b57f027b75e91a76c477430519a5c04078407d1308e2f9098242fd608950c33d0b7976cbc113627e797fbb8bb
6
+ metadata.gz: 4df6938509465c2701d86954f42b5270c6b0dcff8a40a80ee7ecd21fb8a1201d6a22630991416b4bd02396ad82094ecce1870bc2b7ee6af2ec99679c042b7d97
7
+ data.tar.gz: c84ca77a7e65899cc0c3d7a1343eedafee16e64a06867d8ec7f5d58610284abd5de25f8d23f5da11df79fdcf89d30dd4f059009ad036d51b56fe53c7824eca9f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [1.1.0](https://github.com/Open-Pix/ruby-sdk/compare/v1.0.0...v1.1.0) (2023-06-25)
4
+
5
+
6
+ ### Features
7
+
8
+ * add utility method for webhook payload verify ([#19](https://github.com/Open-Pix/ruby-sdk/issues/19)) ([1aaf042](https://github.com/Open-Pix/ruby-sdk/commit/1aaf042144951df2a0f9f84c79942c17670f7bef))
9
+
3
10
  ## 1.0.0 (2023-06-13)
4
11
 
5
12
 
data/README.md CHANGED
@@ -13,14 +13,14 @@ gem 'openpix-ruby_sdk', '~> 0.1.0'
13
13
 
14
14
  To manually install `openpix-ruby_sdk` via Rubygems simply:
15
15
  ```shell
16
- gem install openpix-ruby_sdk -v 0.1.0
16
+ gem install openpix-ruby_sdk -v 1.0.0
17
17
  ```
18
18
 
19
19
  ## Usage
20
- Main class `openpix/rubysdk/client` is your entrypoint to the endpoints.
20
+ Main class `openpix/ruby_sdk/client` is your entrypoint to the endpoints.
21
21
  ### Authenticating client
22
22
  ```ruby
23
- require 'openpix/rubysdk'
23
+ require 'openpix/ruby_sdk'
24
24
 
25
25
  # Your AppID from https://app.woovi.com/home/applications/tab/list
26
26
  app_id = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'base64'
4
+ require 'openssl'
5
+
6
+ module Openpix
7
+ module RubySdk
8
+ # Entrypoint class to access utility methods to facilitate interaction with our APIs
9
+ class Utils
10
+ BASE64_PUB_KEY = 'LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlHZk1BMEdDU3FHU0liM0RRRUJBUVVBQTRHTkFEQ0JpUUtCZ1FDLytOdElranpldnZxRCtJM01NdjNiTFhEdApwdnhCalk0QnNSclNkY2EzcnRBd01jUllZdnhTbmQ3amFnVkxwY3RNaU94UU84aWVVQ0tMU1dIcHNNQWpPL3paCldNS2Jxb0c4TU5waS91M2ZwNnp6MG1jSENPU3FZc1BVVUcxOWJ1VzhiaXM1WloySVpnQk9iV1NwVHZKMGNuajYKSEtCQUE4MkpsbitsR3dTMU13SURBUUFCCi0tLS0tRU5EIFBVQkxJQyBLRVktLS0tLQo='
11
+ PUB_KEY_INSTANCE = OpenSSL::PKey::RSA.new(Base64.decode64(BASE64_PUB_KEY))
12
+
13
+ class << self
14
+ def verify_signature(base64_signature, payload)
15
+ PUB_KEY_INSTANCE.verify(
16
+ OpenSSL::Digest.new('SHA256'),
17
+ Base64.decode64(base64_signature),
18
+ payload
19
+ )
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Openpix
4
4
  module RubySdk
5
- VERSION = '1.0.0'
5
+ VERSION = '1.1.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openpix-ruby_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erick Takeshi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-13 00:00:00.000000000 Z
11
+ date: 2023-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -186,6 +186,7 @@ files:
186
186
  - lib/openpix/ruby_sdk/resources/resource.rb
187
187
  - lib/openpix/ruby_sdk/resources/subscription.rb
188
188
  - lib/openpix/ruby_sdk/resources/webhook.rb
189
+ - lib/openpix/ruby_sdk/utils.rb
189
190
  - lib/openpix/ruby_sdk/version.rb
190
191
  homepage: https://github.com/Open-Pix/ruby-sdk
191
192
  licenses: []