recurly 2.9.0 → 2.9.1

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: 484c28b3c176d82de1fb1f2f25df00602ce9701f
4
- data.tar.gz: b841ce1d8a13adc2345446df5661b4f8b5f0390e
3
+ metadata.gz: 382945e67697e9d83035980b470bb292d35ef6a6
4
+ data.tar.gz: 5cafbb61ed4b574ab2069c560d33abd5b3cf0e3f
5
5
  SHA512:
6
- metadata.gz: 6c7fbf56c05a64d0dc90285f56a75de6b086ffe09f9621b27d5248d9f0e2f36f5124e858a575ced4f6743bf1b5b7c7796347390b47266c53ea79c4cae563b7a5
7
- data.tar.gz: e561799eb31ca989e9c891132919cb348553a5935b07337a6aeb0664e390e5d98cced23ef150ffd87326c5e63d978edb59ebd917cdfef4d996b11e9caeb7abcb
6
+ metadata.gz: a8bac175a30affc998d5dcf2b9bf25a71992c15d6a0f6171259aa1051c3bca20fd0e0f33fe3942405da4dfd29f9ff6ab5c023869744c2d9d48f905fc8414fbe7
7
+ data.tar.gz: ad3ff89f7048cf55cd1590000de0015facd858350b07e705a968fc91c91e594ccf538103d49f3bb5e2c3eba9979799eb31b845f22d54fce53d993674d52af08c
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.9.0'
17
+ gem 'recurly', '~> 2.9.1'
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.5'
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]
@@ -336,9 +336,8 @@ module Recurly
336
336
  raise NotFound, "can't find a record with nil identifier"
337
337
  end
338
338
 
339
- uri = uuid =~ /^http/ ? uuid : member_path(uuid)
340
339
  begin
341
- from_response API.get(uri, {}, options)
340
+ from_response API.get(member_path(uuid), {}, options)
342
341
  rescue API::NotFound => e
343
342
  raise NotFound, e.description
344
343
  end
@@ -2,7 +2,7 @@ module Recurly
2
2
  module Version
3
3
  MAJOR = 2
4
4
  MINOR = 9
5
- PATCH = 0
5
+ PATCH = 1
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.9.0
4
+ version: 2.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Recurly
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-06 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
@@ -238,7 +238,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
238
238
  version: '0'
239
239
  requirements: []
240
240
  rubyforge_project:
241
- rubygems_version: 2.6.8
241
+ rubygems_version: 2.6.13
242
242
  signing_key:
243
243
  specification_version: 4
244
244
  summary: Recurly API Client