adk2 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e8177e10265e335e9316fc295e5449b07025cd21
4
- data.tar.gz: ae752dc9e11a830fca930d378dbedafc6595ef6c
3
+ metadata.gz: 0854db438895282df9c7c74ad112a3ebe0171e9f
4
+ data.tar.gz: ab23088c60dd1f8a5efce2c0cd1b4cad8ebe88da
5
5
  SHA512:
6
- metadata.gz: 17ebeef0cf4d12a5a8973559020fbcb998455f5649506d31fc2caaa3ce3aed9368f8ce1492f38fa5db92bc000f7ded9874e43ec450d005075367045cafef0f32
7
- data.tar.gz: ef1a564504290456010201737cb0d47ec19afedc66271b53bc1bdf9835bcd5310c29ee79381b318a2438bbdd0c01135a35beb9ade8c4a28a33393de1e259b342
6
+ metadata.gz: f26927937eaad5a713743edb6fee0498af9d62867d0f3c6590be667fbdc80275cc1d88f5d090452abc29519b7e5f17a6f5f3b61d5c29598ba00d2cf7f36108d1
7
+ data.tar.gz: dc099c67a885563adde2b1d28861a344ce0318e8f1d4bf5f49fb7bbf736d6b8b5c2507ccf802e90c0fdd6171f6a7afbc34bbd0c19f77215fc83a8114fe591a25
@@ -0,0 +1,53 @@
1
+ -----BEGIN CERTIFICATE-----
2
+ MIIE3jCCA8agAwIBAgICAwEwDQYJKoZIhvcNAQEFBQAwYzELMAkGA1UEBhMCVVMx
3
+ ITAfBgNVBAoTGFRoZSBHbyBEYWRkeSBHcm91cCwgSW5jLjExMC8GA1UECxMoR28g
4
+ RGFkZHkgQ2xhc3MgMiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjExMTYw
5
+ MTU0MzdaFw0yNjExMTYwMTU0MzdaMIHKMQswCQYDVQQGEwJVUzEQMA4GA1UECBMH
6
+ QXJpem9uYTETMBEGA1UEBxMKU2NvdHRzZGFsZTEaMBgGA1UEChMRR29EYWRkeS5j
7
+ b20sIEluYy4xMzA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r18SPaAIBQi2XKVlOARFmR6jYGB0xUGlcmIbYsUfb18aQr4CUWWoriMY
41
+ avx4A6lNf4DD+qta/KFApMoZFv6yyO9ecw3ud72a9nmYvLEHZ6IVDd2gWMZEewo+
42
+ YihfukEHU1jPEX44dMX4/7VpkI+EdOqXG68CAQOjgcAwgb0wHQYDVR0OBBYEFNLE
43
+ sNKR1EwRcbNhyz2h/t2oatTjMIGNBgNVHSMEgYUwgYKAFNLEsNKR1EwRcbNhyz2h
44
+ /t2oatTjoWekZTBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYVGhlIEdvIERhZGR5
45
+ IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRpZmlj
46
+ YXRpb24gQXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQAD
47
+ ggEBADJL87LKPpH8EsahB4yOd6AzBhRckB4Y9wimPQoZ+YeAEW5p5JYXMP80kWNy
48
+ OO7MHAGjHZQopDH2esRU1/blMVgDoszOYtuURXO1v0XJJLXVggKtI3lpjbi2Tc7P
49
+ TMozI+gciKqdi0FuFskg5YmezTvacPd+mSYgFFQlq25zheabIZ0KbIIOqPjCDPoQ
50
+ HmyW74cNxA9hi63ugyuV+I6ShHI56yDqg+2DzZduCLzrTia2cyvk0/ZM/iZx4mER
51
+ dEr/VxqHD3VILs9RaRegAhJhldXRQLIQTO7ErBBDpqWeCtWVYpoNz4iCxTIM5Cuf
52
+ ReYNnyicsbkqWletNw+vHX/bvZ8=
53
+ -----END CERTIFICATE-----
@@ -29,17 +29,15 @@ module Adk2
29
29
 
30
30
  def get_api_token
31
31
  return @api_token = nil if username.nil? || password.nil?
32
- response = RestClient.post(
33
- api_base_url + '/auth',
32
+ response = resource('auth').post(
34
33
  {
35
34
  'email' => username,
36
35
  'password' => password
37
36
  }.to_json
38
37
  )
39
38
 
40
- @api_token = RestClient.post(
41
- api_base_url + '/intro/profile/apikey',
42
- {},
39
+ @api_token = resource('intro/profile/apikey').post(
40
+ '',
43
41
  cookies: response.cookies
44
42
  )
45
43
  end
@@ -51,14 +49,24 @@ module Adk2
51
49
  def http_get(path, params = {})
52
50
  get_api_token if api_token.nil?
53
51
 
54
- Retryable.retryable(tries: 2, on: RestClient::Forbidden) do |_, exception|
55
- get_api_token if exception
52
+ Retryable.retryable(
53
+ tries: 5,
54
+ sleep: -> n { 4**n },
55
+ on: [RestClient::Forbidden, RestClient::ServiceUnavailable]
56
+ ) do |_, exception|
57
+ get_api_token if exception.is_a?(RestClient::Forbidden)
56
58
 
57
- RestClient.get(
58
- "#{api_base_url}/denver/#{path}",
59
+ resource("denver/#{path}").get(
59
60
  params: { fmt: 'json', auth: api_token }.merge(params)
60
61
  )
61
62
  end
62
63
  end
64
+
65
+ def resource(path)
66
+ RestClient::Resource.new(
67
+ "#{api_base_url}/#{path}",
68
+ ssl_ca_file: File.expand_path('../../../adk2.crt', __FILE__)
69
+ )
70
+ end
63
71
  end
64
72
  end
@@ -1,3 +1,3 @@
1
1
  module Adk2
2
- VERSION = '0.0.6'
2
+ VERSION = '0.0.7'
3
3
  end
@@ -21,13 +21,6 @@ RSpec.configure do |config|
21
21
  mocks.verify_partial_doubles = true
22
22
  end
23
23
 
24
- config.before(:example) do
25
- # The cert is invalid on my machine. So, not verifying it for now. - @tsujigiri
26
- allow(RestClient::Request).to receive(:new).and_wrap_original do |method, opts|
27
- method.call(opts.merge(verify_ssl: false))
28
- end
29
- end
30
-
31
24
  config.order = :random
32
25
  config.warnings = true
33
26
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adk2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - ad2games GmbH
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-04 00:00:00.000000000 Z
11
+ date: 2015-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -150,6 +150,7 @@ files:
150
150
  - LICENSE.txt
151
151
  - README.md
152
152
  - Rakefile
153
+ - adk2.crt
153
154
  - adk2.gemspec
154
155
  - lib/adk2.rb
155
156
  - lib/adk2/client.rb