recurly 2.8.0 → 2.8.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: 0c26a4ee0410a6a2dccbb5ee6841c45ee6bb21fb
4
- data.tar.gz: 9c67f455ce8b93cbaca306a2e379d6d666280f06
3
+ metadata.gz: bda4d35d87900de4ee2353984043bb17a820e507
4
+ data.tar.gz: 7a7b7268fdd116d01c392b6c31ea5e7cf1911f93
5
5
  SHA512:
6
- metadata.gz: 6c5a5cd87e4110aa3d860392a2d01421ca60d6e72c2c9ffedb7daf9583046bb3bda54131b4d73a78fb5fd392811244c5ce4de247e759d0ae025cd3e2689b5969
7
- data.tar.gz: f2525658444ab89c9d74d74bcc09bb19ca98f66773b8f1e1f64136224ea5252b017541041412d117da9a6c969559aecb5d0cb3e38e3a0c2adcd77f0fb417fdbe
6
+ metadata.gz: ca3ad99fe2627f3056f8b10350fc1a3ea5fe622bd9b54aa3ae0c26272fa1074b059c6a8754575e60d251e2ef99afea74a3046116c769bd7912db6a5dcdd489ca
7
+ data.tar.gz: 2f91d57d1aefa3f3976482defd961b003e3a5fa6efec57050c9f050e0e3635a7e8485f8febcca8ea9a9f0b4b3be34e4cf66bccf4a00748505011de426717481f
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.8.0'
17
+ gem 'recurly', '~> 2.8.1'
18
18
  ```
19
19
 
20
20
  Recurly will automatically use [Nokogiri](http://nokogiri.org/) (for a nice
@@ -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 = 8
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.8.0
4
+ version: 2.8.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-03-22 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.5.1
241
+ rubygems_version: 2.6.13
242
242
  signing_key:
243
243
  specification_version: 4
244
244
  summary: Recurly API Client