svix 0.62.1 → 0.64.0

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: ee523c0adc337d673127a04bf1fb92ea0c4a6a794506e99c57fdf2950e74d7e5
4
- data.tar.gz: b9dffab553ceb10a5a9f84c0f40301d766d3c5149ddc3730fa557956ee658825
3
+ metadata.gz: bdd8b8a684e7dba8c2565037728cae3b023244cd741df289e222c7191be3d23f
4
+ data.tar.gz: bd04508ca0fd09443a92bc71f5b9bf11487977fefad03a56dbb1c45b8efec666
5
5
  SHA512:
6
- metadata.gz: 9566f93ab438af260d8bfe1d0764af6a5ae4b2d0f10ba8ba34a7a69cf4a83a9249ee860bd1add0c29647313f004e6b72126a1f67c1a6e38b1d719a6d1bedf16d
7
- data.tar.gz: 5c6ab63a7b409176d0a55efea2a95ff02fa20366e0b44f0e9f96d2b801aa6dc5441281ec628903933753830090473db59abae4d2dfb3245d27da244400644795
6
+ metadata.gz: e2d9b915ecba49ff062f91f83d1039e8fd3787bafa0aaf1ff6e78d25e7a07bb852dd9f18894c4a25169c65ad278cd8c861005b20486be5ada1cfb58546646576
7
+ data.tar.gz: 83d1a499818993f62d5c856fe1b820943fa23e2ddd6fae991a728ebe1f1f194d1457dae2c1f7c7e6de89f74626b7a47338f1fb9de09477290dbf1ce5c248dbd6
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- svix (0.62.1)
4
+ svix (0.64.0)
5
5
  typhoeus (~> 1.0, >= 1.0.1)
6
6
 
7
7
  GEM
data/lib/svix/svix.rb CHANGED
@@ -21,7 +21,18 @@ module Svix
21
21
  attr_accessor :message_attempt
22
22
 
23
23
  def initialize(auth_token, options = SvixOptions.new)
24
- uri = URI(options.server_url)
24
+
25
+ regional_url = nil
26
+ region = auth_token.split(".").last
27
+ if region == "us"
28
+ regional_url = "https://api.us.svix.com"
29
+ elsif region == "eu"
30
+ regional_url = "https://api.eu.svix.com"
31
+ elsif region == "in"
32
+ regional_url = "https://api.in.svix.com"
33
+ end
34
+
35
+ uri = URI(options.server_url || regional_url)
25
36
 
26
37
  configuration = Configuration.new
27
38
  configuration.debugging = options.debug
data/lib/svix/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Svix
4
- VERSION = "0.62.1"
4
+ VERSION = "0.64.0"
5
5
  end
data/lib/svix/webhook.rb CHANGED
@@ -3,6 +3,10 @@
3
3
  module Svix
4
4
  class Webhook
5
5
 
6
+ def self.new_using_raw_bytes(secret)
7
+ self.new(secret.pack("C*").force_encoding("UTF-8"))
8
+ end
9
+
6
10
  def initialize(secret)
7
11
  if secret.start_with?(SECRET_PREFIX)
8
12
  secret = secret[SECRET_PREFIX.length..-1]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: svix
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.62.1
4
+ version: 0.64.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Svix
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-07-06 00:00:00.000000000 Z
11
+ date: 2022-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus