amazon-drs 0.0.0 → 0.0.1

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: d01e06ec1d27306afaa20906dfc49fe080029577
4
- data.tar.gz: 657c7ac0322d6ad8a1e227ff22d9e4008ee1e754
3
+ metadata.gz: fd05c5984943ffa279e99ad7505294c457a08d40
4
+ data.tar.gz: 9956785a162a929d1762c5ce944fe4a54e3c6281
5
5
  SHA512:
6
- metadata.gz: 0c0dfff466e209595dd8d457bd934b10b7e3c804a0727850e55dc8359b85cdb0845dc3cda50b69ca8fcca479b61a05a8b58d36f8290fdc1ac95c7bd48c21dd00
7
- data.tar.gz: 57ea3f5340b3f651b43d6860778c65199adcc693ae42269cc1ac258c0c4d7b6f528a677632e34d71845b7599ac9add4078e51749071b455c2c2696861adbabe6
6
+ metadata.gz: e33ea67ba8b0d9f1798870e02839eb764d9f95fbdd5bf4ef5242073884561b0ddca501ca8470a1edde1ec6eaa9a46c28a4501cb77901fd1f4ed125dd063c08b0
7
+ data.tar.gz: cd8c1a39f3f9ffabe438bad67c047291c1aa2c5dffde97d377d1d3998cca813c9273b983d6d6e56bd5560a92fed95bc29179ce41a58e98a428a97635cb2a3cd2
@@ -4,7 +4,6 @@ require 'json'
4
4
  require 'yaml'
5
5
  require 'time'
6
6
  require 'date'
7
- require 'amazon-drs/config'
8
7
 
9
8
  class Net::HTTPResponse
10
9
  attr_accessor :json
@@ -12,7 +11,7 @@ end
12
11
 
13
12
  module AmazonDrs
14
13
  class Client
15
- attr_accessor :device_model, :serial, :authorization_code, :redirect_uri, :access_token, :refresh_token
14
+ attr_accessor :device_model, :serial, :authorization_code, :redirect_uri, :access_token, :refresh_token, :client_id, :client_secret
16
15
  attr_accessor :on_new_token
17
16
  attr_writer :user_agent
18
17
 
@@ -26,6 +25,8 @@ module AmazonDrs
26
25
  @access_token = nil
27
26
  @refresh_token = nil
28
27
  @on_new_token = nil
28
+ @client_id = nil
29
+ @client_secret = nil
29
30
  yield(self) if block_given?
30
31
  end
31
32
 
@@ -151,8 +152,8 @@ module AmazonDrs
151
152
  params = {
152
153
  grant_type: 'refresh_token',
153
154
  refresh_token: @refresh_token,
154
- client_id: Adash::Config.client_id,
155
- client_secret: Adash::Config.client_secret
155
+ client_id: @client_id,
156
+ client_secret: @client_secret
156
157
  }
157
158
  @access_token = nil
158
159
  request(:post, "https://#{@amazon_host}/auth/o2/token", params: params)
@@ -162,9 +163,9 @@ module AmazonDrs
162
163
  params = {
163
164
  grant_type: 'authorization_code',
164
165
  code: @authorization_code,
165
- client_id: Adash::Config.client_id,
166
- client_secret: Adash::Config.client_secret,
167
- redirect_uri: "http://localhost:#{Adash::Config.redirect_port}/"
166
+ client_id: @client_id,
167
+ client_secret: @client_secret,
168
+ redirect_uri: @redirect_uri
168
169
  }
169
170
  request(:post, "https://#{@amazon_host}/auth/o2/token", params: params)
170
171
  end
@@ -1,3 +1,3 @@
1
1
  module AmazonDrs
2
- VERSION = '0.0.0'
2
+ VERSION = '0.0.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amazon-drs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code Ass