recurly 2.4.9 → 2.4.10

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: 943c4e504f2072cb4a6c55ca21595dec92c1dc41
4
- data.tar.gz: fd52ef67b6eb268843d2e39e4f51ae61d64c099b
3
+ metadata.gz: bb529391ad4876854615dc3323e90221dd8ca9bb
4
+ data.tar.gz: 4c8d6af70a2568e688b2a6925b340a8b11b341cf
5
5
  SHA512:
6
- metadata.gz: 0d5f59a05dc2d8de819345e8273fea982a5e477776efdc72142579e5b7505f11a80c55214669e7ed82009781e745d7b4df2c237ffae1e1272be35c5fdff86116
7
- data.tar.gz: 9c980c2b23526ccf4863ec5a4e212ed798021345ec90253e624b6dc629cc16e2d63a4cbac866c61ca1f09c598504564476efb85fcb2878e5b1362b6be9febd1d
6
+ metadata.gz: '08e01ffed40fa664c97fbbcd3f00e6757a81ead2a7c80665b935a62ace79206496319c1a35b0caeb4254b8b71f0d4ef79f47f5e68f917c926443851248cb6d3c'
7
+ data.tar.gz: a133a7f86ff28f1a605ac5214d0b4dc988d774d5d65d4d02b7d11802c08d7018fc3168083956db66868822bab6e3011f398ca1e3d6c2a45a14509a5a7a71c230
data/README.md CHANGED
@@ -12,7 +12,7 @@ Recurly is packaged as a Ruby gem. We recommend you install it with
12
12
  [Bundler](http://gembundler.com/) by adding the following line to your Gemfile:
13
13
 
14
14
  ``` ruby
15
- gem 'recurly', '~> 2.4.9'
15
+ gem 'recurly', '~> 2.4.10'
16
16
  ```
17
17
 
18
18
  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.1'
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]
@@ -322,9 +322,8 @@ module Recurly
322
322
  raise NotFound, "can't find a record with nil identifier"
323
323
  end
324
324
 
325
- uri = uuid =~ /^http/ ? uuid : member_path(uuid)
326
325
  begin
327
- from_response API.get(uri, {}, options)
326
+ from_response API.get(member_path(uuid), {}, options)
328
327
  rescue API::NotFound => e
329
328
  raise NotFound, e.description
330
329
  end
@@ -2,7 +2,7 @@ module Recurly
2
2
  module Version
3
3
  MAJOR = 2
4
4
  MINOR = 4
5
- PATCH = 9
5
+ PATCH = 10
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.4.9
4
+ version: 2.4.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Recurly
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-18 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: rake
@@ -143,9 +143,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
143
143
  version: '0'
144
144
  requirements: []
145
145
  rubyforge_project:
146
- rubygems_version: 2.2.5
146
+ rubygems_version: 2.6.13
147
147
  signing_key:
148
148
  specification_version: 4
149
149
  summary: Recurly API Client
150
150
  test_files: []
151
- has_rdoc: true