skylab_studio 1.0.7 → 1.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 549e0ebc3cedf74a848a299346f93ce8b77c6d8813383f7993c82e755fbf4d88
4
- data.tar.gz: 32825398b0428f26bf8548b40a4eae238d24b97709ce408b021c343901a99835
3
+ metadata.gz: 8dcea80a2765d6d89b736dbdaf420595a284c66b1c2319bdb537e6dce55d6c29
4
+ data.tar.gz: 26870d180ef19254df91ce67ffeb150564c6a144ccbc8965414c48938f687486
5
5
  SHA512:
6
- metadata.gz: af7021375c6030fcf977ff50fd85f1a55947ff7d6a0f4c122b0d8dd55ed4265dc5cccfcb020f04636cda76310910fd09fc1dbcda2b0477937b761185d36f7e63
7
- data.tar.gz: c5cac2e61a900dd0460e477c6c8ecf5a83d2ae3e69fb0503b780e71550f3c79f25e67e83cc49fdfd6dd7663ac4e558da0521eea7e2bd9d9b17f52aa8f92baf5f
6
+ metadata.gz: b01781324fb9c33b8720b54d218ed0c60f346069b04ac646e720b641c85316ef140d96821d69f1054c73a997445a0c1cc4adbf56be3c2f3a765e42c7354ea6d4
7
+ data.tar.gz: e78732d764037a41fad813879db50e04defe51ac4eb2eadd1c437693f5e8e58489c5795d135f0c4e81a3d3a4c2d17b024d2897e6733603ec5d81d8a8f41cfef6
@@ -229,6 +229,17 @@ module SkylabStudio
229
229
  end
230
230
  end
231
231
 
232
+ def validate_hmac_headers(secret_key, job_json_string, request_timestamp, signature)
233
+ message = "#{request_timestamp}:#{job_json_string}".encode('utf-8')
234
+
235
+ # Create the HMAC signature using SHA-256
236
+ hmac_digest = OpenSSL::HMAC.digest('sha256', secret_key.encode('utf-8'), message)
237
+ generated_sig = Base64.strict_encode64(hmac_digest).force_encoding('utf-8')
238
+
239
+ # Compare the provided signature with the generated signature
240
+ signature == generated_sig
241
+ end
242
+
232
243
  private
233
244
 
234
245
  def get_upload_url(options = { use_cache_upload: false })
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SkylabStudio
4
- VERSION = '1.0.7'
4
+ VERSION = '1.0.8'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: skylab_studio
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Lam
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-27 00:00:00.000000000 Z
11
+ date: 2024-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec