recurly 2.0.11 → 2.0.12

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a62eae4775c67dbc8656926de970406a767756b2
4
+ data.tar.gz: 3d649056863adea4798517c03689df7303ce5865
5
+ SHA512:
6
+ metadata.gz: 9a942089e762eeff8a947feed849dee403a4b2931ad97fc1440b9d528cb79ef4df3004e156db37a7788db880853f69bc7787a83c220f4ec71b8a130285153941
7
+ data.tar.gz: e46e3e18ad76f7aa6c961089f9298e144ef9e1d697b313792481a8fade13aa019e93d1c8b0d16f0f885bd37a201485b6f69fb45af1063d00128f9cd6cb0bcb2b
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
  class << self
20
21
  # @return [String]
@@ -55,6 +56,13 @@ module Recurly
55
56
  URI.parse @@base_uri
56
57
  end
57
58
 
59
+ def validate_uri!(uri)
60
+ domain = @@valid_domains.detect { |d| uri.host.end_with?(d) }
61
+ unless domain
62
+ raise ArgumentError, "URI #{uri} is invalid. You may only make requests to a Recurly domain."
63
+ end
64
+ end
65
+
58
66
  # @return [String]
59
67
  def user_agent
60
68
  "Recurly/#{Version}; #{RUBY_DESCRIPTION}"
@@ -39,6 +39,7 @@ module Recurly
39
39
  if options[:params] && !options[:params].empty?
40
40
  uri += "?#{options[:params].map { |k, v| "#{k}=#{v}" }.join '&' }"
41
41
  end
42
+ self.validate_uri!(uri)
42
43
  request = METHODS[method].new uri.request_uri, head
43
44
  request.basic_auth Recurly.api_key, nil
44
45
  if options[:body]
@@ -1,4 +1,5 @@
1
1
  require 'date'
2
+ require 'erb'
2
3
 
3
4
  module Recurly
4
5
  # The base class for all Recurly resources (e.g. {Account}, {Subscription},
@@ -183,6 +184,7 @@ module Recurly
183
184
  # Recurly::Account.member_path "code" # => "accounts/code"
184
185
  # Recurly::Account.member_path nil # => "accounts"
185
186
  def member_path uuid
187
+ uuid = ERB::Util.url_encode(uuid) if uuid
186
188
  [collection_path, uuid].compact.join '/'
187
189
  end
188
190
 
@@ -319,9 +321,8 @@ module Recurly
319
321
  request_options[:head] = { 'If-None-Match' => etag }
320
322
  end
321
323
 
322
- uri = uuid =~ /^http/ ? uuid : member_path(uuid)
323
324
  begin
324
- from_response API.get(uri, {}, request_options)
325
+ from_response API.get(member_path(uuid), {}, options)
325
326
  rescue API::NotFound => e
326
327
  raise NotFound, e.description
327
328
  end
@@ -2,7 +2,7 @@ module Recurly
2
2
  module Version
3
3
  MAJOR = 2
4
4
  MINOR = 0
5
- PATCH = 11
5
+ PATCH = 12
6
6
  PRE = nil
7
7
 
8
8
  VERSION = [MAJOR, MINOR, PATCH, PRE].compact.join('.').freeze
metadata CHANGED
@@ -1,155 +1,77 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: recurly
3
- version: !ruby/object:Gem::Version
4
- hash: 25
5
- prerelease:
6
- segments:
7
- - 2
8
- - 0
9
- - 11
10
- version: 2.0.11
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.0.12
11
5
  platform: ruby
12
- authors:
6
+ authors:
13
7
  - Recurly
14
8
  autorequire:
15
9
  bindir: bin
16
10
  cert_chain: []
17
-
18
- date: 2012-01-17 00:00:00 -08:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
11
+ date: 2017-11-08 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
22
14
  name: rake
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ~>
28
- - !ruby/object:Gem::Version
29
- hash: 63
30
- segments:
31
- - 0
32
- - 9
33
- - 2
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
34
19
  version: 0.9.2
35
20
  type: :development
36
- version_requirements: *id001
37
- - !ruby/object:Gem::Dependency
38
- name: bundler
39
21
  prerelease: false
40
- requirement: &id002 !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ~>
44
- - !ruby/object:Gem::Version
45
- hash: 1923831893
46
- segments:
47
- - 1
48
- - 1
49
- - pre
50
- - 10
51
- version: 1.1.pre.10
52
- type: :development
53
- version_requirements: *id002
54
- - !ruby/object:Gem::Dependency
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.9.2
27
+ - !ruby/object:Gem::Dependency
55
28
  name: minitest
56
- prerelease: false
57
- requirement: &id003 !ruby/object:Gem::Requirement
58
- none: false
59
- requirements:
60
- - - ~>
61
- - !ruby/object:Gem::Version
62
- hash: 21
63
- segments:
64
- - 2
65
- - 6
66
- - 1
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
67
33
  version: 2.6.1
68
34
  type: :development
69
- version_requirements: *id003
70
- - !ruby/object:Gem::Dependency
71
- name: webmock
72
35
  prerelease: false
73
- requirement: &id004 !ruby/object:Gem::Requirement
74
- none: false
75
- requirements:
76
- - - ~>
77
- - !ruby/object:Gem::Version
78
- hash: 7
79
- segments:
80
- - 1
81
- - 7
82
- - 6
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 2.6.1
41
+ - !ruby/object:Gem::Dependency
42
+ name: webmock
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
83
47
  version: 1.7.6
84
48
  type: :development
85
- version_requirements: *id004
86
- - !ruby/object:Gem::Dependency
87
- name: guard-minitest
88
49
  prerelease: false
89
- requirement: &id005 !ruby/object:Gem::Requirement
90
- none: false
91
- requirements:
92
- - - ~>
93
- - !ruby/object:Gem::Version
94
- hash: 15
95
- segments:
96
- - 0
97
- - 4
98
- - 0
99
- version: 0.4.0
100
- type: :development
101
- version_requirements: *id005
102
- - !ruby/object:Gem::Dependency
103
- name: rb-fsevent
104
- prerelease: false
105
- requirement: &id006 !ruby/object:Gem::Requirement
106
- none: false
107
- requirements:
108
- - - ~>
109
- - !ruby/object:Gem::Version
110
- hash: 97
111
- segments:
112
- - 0
113
- - 4
114
- - 3
115
- - 1
116
- version: 0.4.3.1
117
- type: :development
118
- version_requirements: *id006
119
- - !ruby/object:Gem::Dependency
120
- name: growl_notify
121
- prerelease: false
122
- requirement: &id007 !ruby/object:Gem::Requirement
123
- none: false
124
- requirements:
125
- - - ~>
126
- - !ruby/object:Gem::Version
127
- hash: 29
128
- segments:
129
- - 0
130
- - 0
131
- - 1
132
- version: 0.0.1
133
- type: :development
134
- version_requirements: *id007
135
- description: "An API client library for Recurly: http://recurly.com"
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 1.7.6
55
+ description: 'An API client library for Recurly: http://recurly.com'
136
56
  email: support@recurly.com
137
- executables:
57
+ executables:
138
58
  - recurly
139
59
  extensions: []
140
-
141
- extra_rdoc_files:
60
+ extra_rdoc_files:
61
+ - README.markdown
62
+ files:
142
63
  - README.markdown
143
- files:
64
+ - bin/recurly
144
65
  - lib/rails/generators/recurly/config_generator.rb
145
66
  - lib/rails/recurly.rb
67
+ - lib/recurly.rb
146
68
  - lib/recurly/account.rb
147
69
  - lib/recurly/add_on.rb
148
70
  - lib/recurly/adjustment.rb
149
71
  - lib/recurly/all.rb
72
+ - lib/recurly/api.rb
150
73
  - lib/recurly/api/errors.rb
151
74
  - lib/recurly/api/net_http_adapter.rb
152
- - lib/recurly/api.rb
153
75
  - lib/recurly/billing_info.rb
154
76
  - lib/recurly/coupon.rb
155
77
  - lib/recurly/helper.rb
@@ -158,53 +80,40 @@ files:
158
80
  - lib/recurly/money.rb
159
81
  - lib/recurly/plan.rb
160
82
  - lib/recurly/redemption.rb
161
- - lib/recurly/resource/pager.rb
162
83
  - lib/recurly/resource.rb
163
- - lib/recurly/subscription/add_ons.rb
84
+ - lib/recurly/resource/pager.rb
164
85
  - lib/recurly/subscription.rb
165
- - lib/recurly/transaction/errors.rb
86
+ - lib/recurly/subscription/add_ons.rb
166
87
  - lib/recurly/transaction.rb
88
+ - lib/recurly/transaction/errors.rb
167
89
  - lib/recurly/version.rb
90
+ - lib/recurly/xml.rb
168
91
  - lib/recurly/xml/nokogiri.rb
169
92
  - lib/recurly/xml/rexml.rb
170
- - lib/recurly/xml.rb
171
- - lib/recurly.rb
172
- - README.markdown
173
- - bin/recurly
174
- has_rdoc: true
175
93
  homepage: http://github.com/recurly/recurly-client-ruby
176
- licenses:
94
+ licenses:
177
95
  - MIT
96
+ metadata: {}
178
97
  post_install_message:
179
- rdoc_options:
180
- - --main
98
+ rdoc_options:
99
+ - "--main"
181
100
  - README.markdown
182
- require_paths:
101
+ require_paths:
183
102
  - lib
184
- required_ruby_version: !ruby/object:Gem::Requirement
185
- none: false
186
- requirements:
103
+ required_ruby_version: !ruby/object:Gem::Requirement
104
+ requirements:
187
105
  - - ">="
188
- - !ruby/object:Gem::Version
189
- hash: 3
190
- segments:
191
- - 0
192
- version: "0"
193
- required_rubygems_version: !ruby/object:Gem::Requirement
194
- none: false
195
- requirements:
106
+ - !ruby/object:Gem::Version
107
+ version: '0'
108
+ required_rubygems_version: !ruby/object:Gem::Requirement
109
+ requirements:
196
110
  - - ">="
197
- - !ruby/object:Gem::Version
198
- hash: 3
199
- segments:
200
- - 0
201
- version: "0"
111
+ - !ruby/object:Gem::Version
112
+ version: '0'
202
113
  requirements: []
203
-
204
114
  rubyforge_project:
205
- rubygems_version: 1.6.2
115
+ rubygems_version: 2.6.13
206
116
  signing_key:
207
- specification_version: 3
117
+ specification_version: 4
208
118
  summary: Recurly API Client
209
119
  test_files: []
210
-