recurly 2.3.8 → 2.3.9

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: 39b70aa8c737d69a73627a29746d60d2770f83d9
4
- data.tar.gz: 2da0f0fcdeb0bb1756c16a686ce3cb896f5c6f81
3
+ metadata.gz: 7c3f760be1460b7992dfd4e160ee13fa9a08c147
4
+ data.tar.gz: e5ff35cb57c309d43b92e55286c5e3388396b36c
5
5
  SHA512:
6
- metadata.gz: 35b177588a7af6046a5f7ac9675f9755535a579dedf1242c43524f8cb7f8c8684f591cd34159bc15d24faa395d510478920f6bbbaa870a375d2e3c799de45f68
7
- data.tar.gz: 89abb082f08d510de59ba11801f357175847b876e75a281d030fd78130de6c9ec5986b643d80208b708315ba57752b1328d827754253de6d2bef573d764ba136
6
+ metadata.gz: ab1d12ecb1aad622e9537c18c9ce2c90ded4a49f2a9ceb259d64ebbf038182330d2fec0108093aeca1a7ffef44685cf024c5dd4933140c84b425b7671ef427e8
7
+ data.tar.gz: 1d3fcdc850fd0f065dc8d2f953ef8fca53c3116d87c06462d44222879998c82d9ce533f72423b66a2e10d994e2ed466002f1e4e9e7d740bf77e6a8b2e1962d14
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.3.8'
15
+ gem 'recurly', '~> 2.3.9'
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
  FORMATS = Helper.hash_with_indifferent_read_access(
20
21
  'pdf' => 'application/pdf',
@@ -73,6 +74,13 @@ module Recurly
73
74
  URI.parse @@base_uri.sub('api', Recurly.subdomain)
74
75
  end
75
76
 
77
+ def validate_uri!(uri)
78
+ domain = @@valid_domains.detect { |d| uri.host.end_with?(d) }
79
+ unless domain
80
+ raise ArgumentError, "URI #{uri} is invalid. You may only make requests to a Recurly domain."
81
+ end
82
+ end
83
+
76
84
  # @return [String]
77
85
  def user_agent
78
86
  "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]
@@ -321,9 +321,8 @@ module Recurly
321
321
  raise NotFound, "can't find a record with nil identifier"
322
322
  end
323
323
 
324
- uri = uuid =~ /^http/ ? uuid : member_path(uuid)
325
324
  begin
326
- from_response API.get(uri, {}, options)
325
+ from_response API.get(member_path(uuid), {}, options)
327
326
  rescue API::NotFound => e
328
327
  raise NotFound, e.description
329
328
  end
@@ -2,7 +2,7 @@ module Recurly
2
2
  module Version
3
3
  MAJOR = 2
4
4
  MINOR = 3
5
- PATCH = 8
5
+ PATCH = 9
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.3.8
4
+ version: 2.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Recurly
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-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: rake
@@ -117,9 +117,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
117
117
  version: '0'
118
118
  requirements: []
119
119
  rubyforge_project:
120
- rubygems_version: 2.2.2
120
+ rubygems_version: 2.6.13
121
121
  signing_key:
122
122
  specification_version: 4
123
123
  summary: Recurly API Client
124
124
  test_files: []
125
- has_rdoc: true