recurly 2.11.1 → 2.11.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of recurly might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 13d803928d0746a337f596cca55ead434369eb79
4
- data.tar.gz: 1fb49881dff6317fd6c35c34530dc64d2e5a6f8d
3
+ metadata.gz: ffb320df6929520f201436ff189be27b2ad5e125
4
+ data.tar.gz: 6b11ae2cfa60a6ed68af8eccc0249a43bd0293cf
5
5
  SHA512:
6
- metadata.gz: 2eeb2057e356769a48fce9a7b8a23bbfc275d30cb8230ed772ca49d26a2c11a8b306efa360186eec964343db52c603209b2a3a410a2191ae0241920fcc1c8ac7
7
- data.tar.gz: 56ab2c738a2f594d9be46b136af49f48fe9c1361aee4c5daa0c2c363573e497077d7457cf1382cec279227631b1cdde1ae2fb8d9ff4eadda450b98251658a6da
6
+ metadata.gz: 9fe37e553370efbb51f1bc6c148d5f7c0ed7457908e09ff39433aca5b6557837fafc2b72b5d5a6ea17e7c640a91a12e7251fa3eec40277a200b5815ae0bdd4e1
7
+ data.tar.gz: 62731a6f158035af2eb90e5c23cd09b2e65daf7e05743192f486ff05d6287b76dd2f9ab96bbb481e5ab56f5b490d290f43e1480c99b63db55aac04ae8c208761
data/README.md CHANGED
@@ -14,7 +14,7 @@ Recurly is packaged as a Ruby gem. We recommend you install it with
14
14
  [Bundler](http://gembundler.com/) by adding the following line to your Gemfile:
15
15
 
16
16
  ``` ruby
17
- gem 'recurly', '~> 2.10.2'
17
+ gem 'recurly', '~> 2.11.2'
18
18
  ```
19
19
 
20
20
  Recurly will automatically use [Nokogiri](http://nokogiri.org/) (for a nice
data/lib/recurly/api.rb CHANGED
@@ -15,6 +15,7 @@ module Recurly
15
15
  require 'recurly/api/errors'
16
16
 
17
17
  @@base_uri = "https://api.recurly.com/v2/"
18
+ @@valid_domains = [".recurly.com"]
18
19
 
19
20
  RECURLY_API_VERSION = '2.8'
20
21
 
@@ -75,6 +76,13 @@ module Recurly
75
76
  URI.parse @@base_uri.sub('api', Recurly.subdomain)
76
77
  end
77
78
 
79
+ def validate_uri!(uri)
80
+ domain = @@valid_domains.detect { |d| uri.host.end_with?(d) }
81
+ unless domain
82
+ raise ArgumentError, "URI #{uri} is invalid. You may only make requests to a Recurly domain."
83
+ end
84
+ end
85
+
78
86
  # @return [String]
79
87
  def user_agent
80
88
  "Recurly/#{Version}; #{RUBY_DESCRIPTION}"
@@ -43,6 +43,7 @@ module Recurly
43
43
  }
44
44
  uri += "?#{pairs.join '&'}"
45
45
  end
46
+ self.validate_uri!(uri)
46
47
  request = METHODS[method].new uri.request_uri, head
47
48
  request.basic_auth(*[Recurly.api_key, nil].flatten[0, 2])
48
49
  if options[:body]
@@ -335,9 +335,8 @@ module Recurly
335
335
  raise NotFound, "can't find a record with nil identifier"
336
336
  end
337
337
 
338
- uri = uuid =~ /^http/ ? uuid : member_path(uuid)
339
338
  begin
340
- from_response API.get(uri, {}, options)
339
+ from_response API.get(member_path(uuid), {}, options)
341
340
  rescue API::NotFound => e
342
341
  raise NotFound, e.description
343
342
  end
@@ -2,7 +2,7 @@ module Recurly
2
2
  module Version
3
3
  MAJOR = 2
4
4
  MINOR = 11
5
- PATCH = 1
5
+ PATCH = 2
6
6
  PRE = nil
7
7
 
8
8
  VERSION = [MAJOR, MINOR, PATCH, PRE].compact.join('.').freeze
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: recurly
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.11.1
4
+ version: 2.11.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Recurly
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-20 00:00:00.000000000 Z
11
+ date: 2017-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri