my_john_deere_api 2.5.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/lib/my_john_deere_api.rb +1 -1
  3. data/lib/my_john_deere_api/authorize.rb +36 -27
  4. data/lib/my_john_deere_api/client.rb +38 -29
  5. data/lib/my_john_deere_api/consumer.rb +46 -35
  6. data/lib/my_john_deere_api/helpers/case_conversion.rb +5 -2
  7. data/lib/my_john_deere_api/helpers/uri_helpers.rb +1 -1
  8. data/lib/my_john_deere_api/model/contribution_definition.rb +1 -1
  9. data/lib/my_john_deere_api/net_http_retry/decorator.rb +10 -11
  10. data/lib/my_john_deere_api/net_http_retry/invalid_response_error.rb +2 -2
  11. data/lib/my_john_deere_api/request/collection/asset_locations.rb +1 -1
  12. data/lib/my_john_deere_api/request/collection/assets.rb +1 -1
  13. data/lib/my_john_deere_api/request/collection/base.rb +2 -14
  14. data/lib/my_john_deere_api/request/collection/contribution_definitions.rb +1 -1
  15. data/lib/my_john_deere_api/request/collection/contribution_products.rb +1 -1
  16. data/lib/my_john_deere_api/request/collection/fields.rb +1 -1
  17. data/lib/my_john_deere_api/request/collection/flags.rb +1 -1
  18. data/lib/my_john_deere_api/request/collection/organizations.rb +1 -1
  19. data/lib/my_john_deere_api/request/create/asset.rb +8 -11
  20. data/lib/my_john_deere_api/request/create/asset_location.rb +24 -25
  21. data/lib/my_john_deere_api/request/create/base.rb +2 -20
  22. data/lib/my_john_deere_api/request/individual/asset.rb +2 -2
  23. data/lib/my_john_deere_api/request/individual/base.rb +6 -24
  24. data/lib/my_john_deere_api/request/individual/contribution_definition.rb +1 -1
  25. data/lib/my_john_deere_api/request/individual/contribution_product.rb +1 -1
  26. data/lib/my_john_deere_api/request/individual/field.rb +1 -1
  27. data/lib/my_john_deere_api/request/individual/organization.rb +1 -1
  28. data/lib/my_john_deere_api/request/update/asset.rb +2 -2
  29. data/lib/my_john_deere_api/request/update/base.rb +1 -19
  30. data/lib/my_john_deere_api/version.rb +1 -1
  31. data/test/lib/my_john_deere_api/authorize_test.rb +37 -25
  32. data/test/lib/my_john_deere_api/client_test.rb +22 -56
  33. data/test/lib/my_john_deere_api/consumer_test.rb +16 -28
  34. data/test/lib/my_john_deere_api/helpers/uri_helpers_test.rb +0 -10
  35. data/test/lib/my_john_deere_api/model/asset_location_test.rb +0 -4
  36. data/test/lib/my_john_deere_api/model/asset_test.rb +9 -8
  37. data/test/lib/my_john_deere_api/model/base_test.rb +4 -8
  38. data/test/lib/my_john_deere_api/model/contribution_definition_test.rb +3 -7
  39. data/test/lib/my_john_deere_api/model/contribution_product_test.rb +4 -7
  40. data/test/lib/my_john_deere_api/model/field_test.rb +4 -6
  41. data/test/lib/my_john_deere_api/model/flag_test.rb +6 -7
  42. data/test/lib/my_john_deere_api/model/organization_test.rb +3 -5
  43. data/test/lib/my_john_deere_api/net_http_retry/decorator_test.rb +14 -14
  44. data/test/lib/my_john_deere_api/net_http_retry/invalid_response_error_test.rb +22 -2
  45. data/test/lib/my_john_deere_api/request/collection/asset_locations_test.rb +2 -2
  46. data/test/lib/my_john_deere_api/request/collection/assets_test.rb +2 -2
  47. data/test/lib/my_john_deere_api/request/collection/contribution_definitions_test.rb +2 -2
  48. data/test/lib/my_john_deere_api/request/collection/contribution_products_test.rb +2 -2
  49. data/test/lib/my_john_deere_api/request/collection/fields_test.rb +2 -2
  50. data/test/lib/my_john_deere_api/request/collection/flags_test.rb +2 -2
  51. data/test/lib/my_john_deere_api/request/collection/organizations_test.rb +2 -2
  52. data/test/lib/my_john_deere_api/request/create/asset_location_test.rb +3 -2
  53. data/test/lib/my_john_deere_api/request/create/asset_test.rb +5 -4
  54. data/test/lib/my_john_deere_api/request/create/base_test.rb +0 -14
  55. data/test/lib/my_john_deere_api/request/individual/asset_test.rb +2 -3
  56. data/test/lib/my_john_deere_api/request/individual/base_test.rb +0 -1
  57. data/test/lib/my_john_deere_api/request/individual/contribution_definition_test.rb +2 -3
  58. data/test/lib/my_john_deere_api/request/individual/contribution_product_test.rb +2 -3
  59. data/test/lib/my_john_deere_api/request/individual/field_test.rb +2 -3
  60. data/test/lib/my_john_deere_api/request/individual/organization_test.rb +2 -3
  61. data/test/lib/my_john_deere_api/request/update/asset_test.rb +5 -17
  62. data/test/lib/my_john_deere_api/request/update/base_test.rb +0 -14
  63. data/test/support/helper.rb +14 -5
  64. data/test/support/link_helpers.rb +14 -0
  65. data/test/support/response_helpers.rb +18 -0
  66. data/test/support/vcr/catalog.yml +44 -37
  67. data/test/support/vcr/get_access_token.yml +90 -17
  68. data/test/support/vcr/get_refresh_token.yml +159 -0
  69. data/test/support/vcr/get_request_url.yml +51 -0
  70. data/test/support/vcr_setup.rb +80 -19
  71. metadata +11 -8
  72. data/test/support/vcr/get_request_token.yml +0 -83
@@ -10,7 +10,6 @@ describe 'MyJohnDeereApi::Request::Individual::ContributionProduct' do
10
10
  describe '#initialize(client, contribution_product_id)' do
11
11
  it 'accepts a client' do
12
12
  assert_equal client, object.client
13
- assert_equal accessor, object.accessor
14
13
  end
15
14
 
16
15
  it 'accepts contribution_product_id as id' do
@@ -19,8 +18,8 @@ describe 'MyJohnDeereApi::Request::Individual::ContributionProduct' do
19
18
  end
20
19
 
21
20
  describe '#resource' do
22
- it 'returns /contributionProducts/<product_id>' do
23
- assert_equal "/contributionProducts/#{contribution_product_id}", object.resource
21
+ it 'returns /platform/contributionProducts/<product_id>' do
22
+ assert_equal "/platform/contributionProducts/#{contribution_product_id}", object.resource
24
23
  end
25
24
  end
26
25
 
@@ -10,7 +10,6 @@ describe 'MyJohnDeereApi::Request::Individual::Field' do
10
10
  describe '#initialize(client, organization_id, field_id)' do
11
11
  it 'accepts a client' do
12
12
  assert_equal client, object.client
13
- assert_equal accessor, object.accessor
14
13
  end
15
14
 
16
15
  it 'accepts organization_id as organization_id' do
@@ -23,8 +22,8 @@ describe 'MyJohnDeereApi::Request::Individual::Field' do
23
22
  end
24
23
 
25
24
  describe '#resource' do
26
- it 'returns /organizations/<organization_id>/fields/<field_id>' do
27
- assert_equal "/organizations/#{organization_id}/fields/#{field_id}", object.resource
25
+ it 'returns /platform/organizations/<organization_id>/fields/<field_id>' do
26
+ assert_equal "/platform/organizations/#{organization_id}/fields/#{field_id}", object.resource
28
27
  end
29
28
  end
30
29
 
@@ -10,7 +10,6 @@ describe 'MyJohnDeereApi::Request::Individual::Organization' do
10
10
  describe '#initialize(client, asset_id)' do
11
11
  it 'accepts a client' do
12
12
  assert_equal client, object.client
13
- assert_equal accessor, object.accessor
14
13
  end
15
14
 
16
15
  it 'accepts organization_id as id' do
@@ -19,8 +18,8 @@ describe 'MyJohnDeereApi::Request::Individual::Organization' do
19
18
  end
20
19
 
21
20
  describe '#resource' do
22
- it 'returns /organizations/<organization_id>' do
23
- assert_equal "/organizations/#{organization_id}", object.resource
21
+ it 'returns /platform/organizations/<organization_id>' do
22
+ assert_equal "/platform/organizations/#{organization_id}", object.resource
24
23
  end
25
24
  end
26
25
 
@@ -1,6 +1,8 @@
1
1
  require 'support/helper'
2
2
 
3
3
  describe 'MyJohnDeereApi::Request::Update::Asset' do
4
+ include JD::ResponseHelpers
5
+
4
6
  let(:klass) { JD::Request::Update::Asset }
5
7
  let(:object) { klass.new(client, item, attributes) }
6
8
  let(:item) { JD::Model::Asset.new(client, record) }
@@ -29,7 +31,6 @@ describe 'MyJohnDeereApi::Request::Update::Asset' do
29
31
  describe '#initialize(client, item, attributes)' do
30
32
  it 'accepts a client, item and attributes' do
31
33
  assert_equal client, object.client
32
- assert_equal accessor, object.accessor
33
34
  assert_equal item, object.item
34
35
  assert_equal item.attributes.merge(attributes), object.attributes
35
36
  end
@@ -42,21 +43,8 @@ describe 'MyJohnDeereApi::Request::Update::Asset' do
42
43
  end
43
44
 
44
45
  describe '#resource' do
45
- it 'is /assets/<asset_id>' do
46
- assert_equal "/assets/#{asset_id}", object.send(:resource)
47
- end
48
- end
49
-
50
- describe '#headers' do
51
- it 'sets the accept and content-type headers' do
52
- object = klass.new(client, item, attributes)
53
- headers = object.send(:headers)
54
-
55
- expected = 'application/vnd.deere.axiom.v3+json'
56
-
57
- assert_kind_of Hash, headers
58
- assert_equal expected, headers['Accept']
59
- assert_equal expected, headers['Content-Type']
46
+ it 'is /platform/assets/<asset_id>' do
47
+ assert_equal "/platform/assets/#{asset_id}", object.send(:resource)
60
48
  end
61
49
  end
62
50
 
@@ -93,7 +81,7 @@ describe 'MyJohnDeereApi::Request::Update::Asset' do
93
81
  it 'makes the request' do
94
82
  VCR.use_cassette('put_asset') { object.request }
95
83
 
96
- assert_kind_of Net::HTTPNoContent, object.response
84
+ assert_no_content object.response
97
85
  end
98
86
  end
99
87
  end
@@ -22,7 +22,6 @@ describe 'MyJohnDeereApi::Request::Update::Base' do
22
22
  describe '#initialize(client, item, attributes)' do
23
23
  it 'accepts a client, item and attributes' do
24
24
  assert_equal client, object.client
25
- assert_equal accessor, object.accessor
26
25
  assert_equal item, object.item
27
26
  end
28
27
 
@@ -44,17 +43,4 @@ describe 'MyJohnDeereApi::Request::Update::Base' do
44
43
  end
45
44
  end
46
45
  end
47
-
48
- describe '#headers' do
49
- it 'sets the accept and content-type headers' do
50
- object = klass.new(client, item, attributes)
51
- headers = object.send(:headers)
52
-
53
- expected = 'application/vnd.deere.axiom.v3+json'
54
-
55
- assert_kind_of Hash, headers
56
- assert_equal expected, headers['Accept']
57
- assert_equal expected, headers['Content-Type']
58
- end
59
- end
60
46
  end
@@ -7,14 +7,15 @@ require 'my_john_deere_api'
7
7
  require 'mocha/minitest'
8
8
 
9
9
  require 'support/vcr_setup'
10
+ require 'support/response_helpers'
11
+ require 'support/link_helpers'
10
12
 
11
13
  Minitest::Reporters.use! [Minitest::Reporters::DefaultReporter.new(:color => true)]
12
14
 
13
15
  # shortcut for long module name
14
16
  JD = MyJohnDeereApi
15
17
 
16
- TOKEN_PATTERN = /^[0-9a-z\-]+$/
17
- SECRET_PATTERN = /^[0-9A-Za-z\-+=\/]+$/
18
+ TOKEN_PATTERN = /^[0-9a-zA-Z\-_\.]+$/
18
19
 
19
20
  CONFIG = VcrSetup.new
20
21
 
@@ -42,12 +43,16 @@ class Minitest::Spec
42
43
  @_client ||= CONFIG.client
43
44
  end
44
45
 
46
+ def token_hash
47
+ @_token_hash ||= CONFIG.token_hash
48
+ end
49
+
45
50
  def accessor
46
51
  @_accessor ||= VCR.use_cassette('catalog') { client.accessor }
47
52
  end
48
53
 
49
54
  def base_url
50
- @base_url ||= accessor.consumer.site
55
+ @base_url ||= accessor.client.site
51
56
  end
52
57
 
53
58
  def api_key
@@ -62,8 +67,12 @@ class Minitest::Spec
62
67
  CONFIG.access_token
63
68
  end
64
69
 
65
- def access_secret
66
- CONFIG.access_secret
70
+ def new_access_token
71
+ CONFIG.new_access_token
72
+ end
73
+
74
+ def refresh_token
75
+ CONFIG.refresh_token
67
76
  end
68
77
 
69
78
  def contribution_product_id
@@ -0,0 +1,14 @@
1
+ module MyJohnDeereApi
2
+ module LinkHelpers
3
+ def link_for(label)
4
+ record['links'].detect{|link| link['rel'] == label}['uri'].gsub('https://sandboxapi.deere.com', '')
5
+ end
6
+
7
+ def assert_link_for(object, attribute)
8
+ attribute_underscore = attribute.to_s
9
+ attribute_camelcase = attribute_underscore.gsub(%r{_(.)}){$1.upcase}
10
+
11
+ assert_equal link_for(attribute_camelcase), object.links[attribute_underscore]
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,18 @@
1
+ module MyJohnDeereApi
2
+ module ResponseHelpers
3
+ def assert_created(response)
4
+ assert_response(response, 201, 'Created')
5
+ end
6
+
7
+ def assert_no_content(response)
8
+ assert_response(response, 204, 'No Content')
9
+ end
10
+
11
+ def assert_response(response, code, message)
12
+ faraday_response = response.response
13
+
14
+ assert_equal code, faraday_response.status
15
+ assert_equal message, faraday_response.reason_phrase
16
+ end
17
+ end
18
+ end
@@ -2,88 +2,95 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://sandboxapi.deere.com/platform/
5
+ uri: https://sandboxapi.deere.com/platform
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
9
9
  headers:
10
+ User-Agent:
11
+ - Faraday v1.3.0
10
12
  Accept:
11
13
  - application/vnd.deere.axiom.v3+json
14
+ Authorization:
15
+ - Bearer AccessToken0123456789abcdefghijklmnopqrstuvwxyz
12
16
  Accept-Encoding:
13
17
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
- User-Agent:
15
- - OAuth gem v0.5.4
16
- Authorization:
17
- - OAuth oauth_consumer_key="johndeere-0000000000000000000000000000000000000000",
18
- oauth_nonce="000000000000000000000000000000000000000000", oauth_signature="0000000000000000000000000000",
19
- oauth_signature_method="HMAC-SHA1", oauth_timestamp="1581334172", oauth_version="1.0"
20
18
  response:
21
19
  status:
22
20
  code: 200
23
21
  message: OK
24
22
  headers:
25
23
  Date:
26
- - Mon, 10 Feb 2020 17:28:57 GMT
24
+ - Wed, 17 Mar 2021 21:38:22 GMT
27
25
  Content-Type:
28
26
  - application/vnd.deere.axiom.v3+json;charset=UTF-8
29
- X-Deere-Handling-Server:
30
- - ip-10-214-45-104
31
27
  X-Frame-Options:
32
- - SAMEORIGIN
33
- X-Deere-Elapsed-Ms:
34
- - '9'
28
+ - DENY
35
29
  Cache-Control:
36
30
  - no-store
31
+ Strict-Transport-Security:
32
+ - max-age=31536000 ; includeSubDomains
33
+ X-Xss-Protection:
34
+ - 1; mode=block
35
+ X-Content-Type-Options:
36
+ - nosniff
37
37
  Content-Language:
38
- - en-US
38
+ - en
39
39
  Transfer-Encoding:
40
40
  - chunked
41
41
  body:
42
42
  encoding: ASCII-8BIT
43
- string: '{"@type":"ApiCatalog","links":[{"@type":"Link","rel":"oauthRequestToken","uri":"https://sandboxapi.deere.com/platform/oauth/request_token"},{"@type":"Link","rel":"oauthAuthorizeRequestToken","uri":"https://my.deere.com/consentToUseOfData?oauth_token={token}"},{"@type":"Link","rel":"oauthAccessToken","uri":"https://sandboxapi.deere.com/platform/oauth/access_token"},{"@type":"Link","rel":"agencies","uri":"https://sandboxapi.deere.com/platform/agencies"}]}'
43
+ string: '{"@type":"ApiCatalog","links":[{"@type":"Link","rel":"oauthRequestToken","uri":"https://sandboxapi.deere.com/platform/oauth/request_token"},{"@type":"Link","rel":"oauthAuthorizeRequestToken","uri":"https://operationscenter.deere.com/consentToUseOfData?oauth_token={token}"},{"@type":"Link","rel":"oauthAccessToken","uri":"https://sandboxapi.deere.com/platform/oauth/access_token"},{"@type":"Link","rel":"currentUser","uri":"https://sandboxapi.deere.com/platform/users/@currentUser"},{"@type":"Link","rel":"organizations","uri":"https://sandboxapi.deere.com/platform/organizations"},{"@type":"Link","rel":"currentToken","uri":"https://sandboxapi.deere.com/platform/oauthTokens/@currentToken"},{"@type":"Link","rel":"contributionProducts","uri":"https://sandboxapi.deere.com/platform/contributionProducts"},{"@type":"Link","rel":"contributionDefinitions","uri":"https://sandboxapi.deere.com/platform/contributionDefinitions"},{"@type":"Link","rel":"assetCatalog","uri":"https://sandboxapi.deere.com/platform/assetCatalog"},{"@type":"Link","rel":"agencies","uri":"https://sandboxapi.deere.com/platform/agencies"}]}'
44
44
  http_version:
45
- recorded_at: Mon, 10 Feb 2020 17:28:57 GMT
45
+ recorded_at: Wed, 17 Mar 2021 21:38:22 GMT
46
46
  - request:
47
47
  method: get
48
- uri: https://sandboxapi.deere.com/platform/
48
+ uri: https://signin.johndeere.com/oauth2/aus78tnlaysMraFhC1t7/.well-known/oauth-authorization-server
49
49
  body:
50
50
  encoding: US-ASCII
51
51
  string: ''
52
52
  headers:
53
+ User-Agent:
54
+ - Faraday v1.3.0
53
55
  Accept:
54
56
  - application/vnd.deere.axiom.v3+json
57
+ Authorization:
58
+ - Bearer AccessToken0123456789abcdefghijklmnopqrstuvwxyz
55
59
  Accept-Encoding:
56
60
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
57
- User-Agent:
58
- - OAuth gem v0.5.4
59
- Authorization:
60
- - OAuth oauth_consumer_key="johndeere-0000000000000000000000000000000000000000",
61
- oauth_nonce="000000000000000000000000000000000000000000", oauth_signature="0000000000000000000000000000",
62
- oauth_signature_method="HMAC-SHA1", oauth_timestamp="1581334172", oauth_version="1.0"
63
61
  response:
64
62
  status:
65
63
  code: 200
66
64
  message: OK
67
65
  headers:
68
66
  Date:
69
- - Mon, 10 Feb 2020 17:28:57 GMT
67
+ - Wed, 17 Mar 2021 21:38:22 GMT
68
+ Server:
69
+ - nginx
70
70
  Content-Type:
71
- - application/vnd.deere.axiom.v3+json;charset=UTF-8
72
- X-Deere-Handling-Server:
73
- - ip-10-214-44-36
74
- X-Frame-Options:
75
- - SAMEORIGIN
76
- X-Deere-Elapsed-Ms:
77
- - '16'
71
+ - application/json
72
+ X-Xss-Protection:
73
+ - '0'
74
+ P3p:
75
+ - CP="HONK"
76
+ Expect-Ct:
77
+ - report-uri="https://oktaexpectct.report-uri.com/r/t/ct/reportOnly", max-age=0
78
78
  Cache-Control:
79
- - no-store
80
- Content-Language:
81
- - en-US
79
+ - max-age=86400, must-revalidate
80
+ Expires:
81
+ - Thu, 18 Mar 2021 21:37:54 GMT
82
+ X-Content-Type-Options:
83
+ - nosniff
84
+ Strict-Transport-Security:
85
+ - max-age=315360000; includeSubDomains
86
+ X-Okta-Request-Id:
87
+ - YFJ2zq-5EtNqLxyo29u@LgAABaM
82
88
  Transfer-Encoding:
83
89
  - chunked
84
90
  body:
85
- encoding: ASCII-8BIT
86
- string: '{"@type":"ApiCatalog","links":[{"@type":"Link","rel":"oauthRequestToken","uri":"https://sandboxapi.deere.com/platform/oauth/request_token"},{"@type":"Link","rel":"oauthAuthorizeRequestToken","uri":"https://my.deere.com/consentToUseOfData?oauth_token={token}"},{"@type":"Link","rel":"oauthAccessToken","uri":"https://sandboxapi.deere.com/platform/oauth/access_token"},{"@type":"Link","rel":"agencies","uri":"https://sandboxapi.deere.com/platform/agencies"}]}'
91
+ encoding: UTF-8
92
+ string: '{"issuer":"https://signin.johndeere.com/oauth2/aus78tnlaysMraFhC1t7","authorization_endpoint":"https://signin.johndeere.com/oauth2/aus78tnlaysMraFhC1t7/v1/authorize","token_endpoint":"https://signin.johndeere.com/oauth2/aus78tnlaysMraFhC1t7/v1/token","registration_endpoint":"https://signin.johndeere.com/oauth2/v1/clients","jwks_uri":"https://signin.johndeere.com/oauth2/aus78tnlaysMraFhC1t7/v1/keys","response_types_supported":["code","token","id_token","code
93
+ id_token","code token","id_token token","code id_token token"],"response_modes_supported":["query","fragment","form_post","okta_post_message"],"grant_types_supported":["authorization_code","implicit","refresh_token","password","client_credentials"],"subject_types_supported":["public"],"scopes_supported":["ag1","ag2","ag3","eq1","eq2","files","jobs","org1","org2","openid","profile","email","address","phone","offline_access"],"token_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"claims_supported":["ver","jti","iss","aud","iat","exp","cid","uid","scp","sub"],"code_challenge_methods_supported":["S256"],"introspection_endpoint":"https://signin.johndeere.com/oauth2/aus78tnlaysMraFhC1t7/v1/introspect","introspection_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"revocation_endpoint":"https://signin.johndeere.com/oauth2/aus78tnlaysMraFhC1t7/v1/revoke","revocation_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"end_session_endpoint":"https://signin.johndeere.com/oauth2/aus78tnlaysMraFhC1t7/v1/logout","request_parameter_supported":true,"request_object_signing_alg_values_supported":["HS256","HS384","HS512","RS256","RS384","RS512","ES256","ES384","ES512"]}'
87
94
  http_version:
88
- recorded_at: Mon, 10 Feb 2020 17:28:57 GMT
95
+ recorded_at: Wed, 17 Mar 2021 21:38:22 GMT
89
96
  recorded_with: VCR 5.0.0
@@ -2,40 +2,113 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://sandboxapi.deere.com/platform/oauth/access_token
5
+ uri: https://signin.johndeere.com/oauth2/aus78tnlaysMraFhC1t7/.well-known/oauth-authorization-server
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
9
9
  headers:
10
+ User-Agent:
11
+ - Faraday v1.3.0
12
+ Accept:
13
+ - application/vnd.deere.axiom.v3+json
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Date:
22
+ - Wed, 17 Mar 2021 22:09:06 GMT
23
+ Server:
24
+ - nginx
25
+ Content-Type:
26
+ - application/json
27
+ X-Xss-Protection:
28
+ - '0'
29
+ P3p:
30
+ - CP="HONK"
31
+ Expect-Ct:
32
+ - report-uri="https://oktaexpectct.report-uri.com/r/t/ct/reportOnly", max-age=0
33
+ Cache-Control:
34
+ - max-age=86400, must-revalidate
35
+ Expires:
36
+ - Thu, 18 Mar 2021 22:08:22 GMT
37
+ X-Content-Type-Options:
38
+ - nosniff
39
+ Strict-Transport-Security:
40
+ - max-age=315360000; includeSubDomains
41
+ X-Okta-Request-Id:
42
+ - YFJ@AmsIRy8KxUkhAvDVHwAABL8
43
+ Transfer-Encoding:
44
+ - chunked
45
+ body:
46
+ encoding: UTF-8
47
+ string: '{"issuer":"https://signin.johndeere.com/oauth2/aus78tnlaysMraFhC1t7","authorization_endpoint":"https://signin.johndeere.com/oauth2/aus78tnlaysMraFhC1t7/v1/authorize","token_endpoint":"https://signin.johndeere.com/oauth2/aus78tnlaysMraFhC1t7/v1/token","registration_endpoint":"https://signin.johndeere.com/oauth2/v1/clients","jwks_uri":"https://signin.johndeere.com/oauth2/aus78tnlaysMraFhC1t7/v1/keys","response_types_supported":["code","token","id_token","code
48
+ id_token","code token","id_token token","code id_token token"],"response_modes_supported":["query","fragment","form_post","okta_post_message"],"grant_types_supported":["authorization_code","implicit","refresh_token","password","client_credentials"],"subject_types_supported":["public"],"scopes_supported":["ag1","ag2","ag3","eq1","eq2","files","jobs","org1","org2","openid","profile","email","address","phone","offline_access"],"token_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"claims_supported":["ver","jti","iss","aud","iat","exp","cid","uid","scp","sub"],"code_challenge_methods_supported":["S256"],"introspection_endpoint":"https://signin.johndeere.com/oauth2/aus78tnlaysMraFhC1t7/v1/introspect","introspection_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"revocation_endpoint":"https://signin.johndeere.com/oauth2/aus78tnlaysMraFhC1t7/v1/revoke","revocation_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"end_session_endpoint":"https://signin.johndeere.com/oauth2/aus78tnlaysMraFhC1t7/v1/logout","request_parameter_supported":true,"request_object_signing_alg_values_supported":["HS256","HS384","HS512","RS256","RS384","RS512","ES256","ES384","ES512"]}'
49
+ http_version:
50
+ recorded_at: Wed, 17 Mar 2021 22:09:06 GMT
51
+ - request:
52
+ method: post
53
+ uri: https://signin.johndeere.com/oauth2/aus78tnlaysMraFhC1t7/v1/token
54
+ body:
55
+ encoding: UTF-8
56
+ string: client_id=johndeere-0000000000000000000000000000000000000000&client_secret=0000000000000000000000000000000000000000000000000000000000000000&code=VERIFY&grant_type=authorization_code&redirect_uri=http%3A%2F%2Flocalhost
57
+ headers:
58
+ User-Agent:
59
+ - Faraday v1.3.0
60
+ Content-Type:
61
+ - application/x-www-form-urlencoded
10
62
  Accept-Encoding:
11
63
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
64
  Accept:
13
65
  - "*/*"
14
- User-Agent:
15
- - OAuth gem v0.5.4
16
- Authorization:
17
- - OAuth oauth_consumer_key="johndeere-0000000000000000000000000000000000000000",
18
- oauth_nonce="000000000000000000000000000000000000000000", oauth_signature="0000000000000000000000000000",
19
- oauth_signature_method="HMAC-SHA1", oauth_timestamp="1581334172", oauth_token="00000000-0000-0000-0000-000000000000",
20
- oauth_verifier="VERIFY", oauth_version="1.0"
21
66
  response:
22
67
  status:
23
68
  code: 200
24
69
  message: OK
25
70
  headers:
26
71
  Date:
27
- - Mon, 10 Feb 2020 17:29:12 GMT
72
+ - Wed, 17 Mar 2021 22:09:23 GMT
73
+ Server:
74
+ - nginx
28
75
  Content-Type:
29
- - text/plain;charset=UTF-8
30
- X-Deere-Handling-Server:
31
- - ip-10-214-44-36
32
- Vary:
33
- - Accept-Encoding
76
+ - application/json
77
+ X-Okta-Request-Id:
78
+ - YFJ@E@UPsOFGB0k2w031WQAABe4
79
+ X-Xss-Protection:
80
+ - '0'
81
+ P3p:
82
+ - CP="HONK"
83
+ X-Rate-Limit-Limit:
84
+ - '2000'
85
+ X-Rate-Limit-Remaining:
86
+ - '1679'
87
+ X-Rate-Limit-Reset:
88
+ - '1581334172'
89
+ Cache-Control:
90
+ - no-cache, no-store
91
+ Pragma:
92
+ - no-cache
93
+ Expires:
94
+ - '0'
95
+ Expect-Ct:
96
+ - report-uri="https://oktaexpectct.report-uri.com/r/t/ct/reportOnly", max-age=0
97
+ X-Content-Type-Options:
98
+ - nosniff
99
+ Strict-Transport-Security:
100
+ - max-age=315360000; includeSubDomains
101
+ X-Robots-Tag:
102
+ - none
103
+ Set-Cookie:
104
+ - JSESSIONID=4252AEA3F9DE9BA07D2163E73E6DA175; Path=/; Secure; HttpOnly
105
+ - sid=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/
34
106
  Transfer-Encoding:
35
107
  - chunked
36
108
  body:
37
- encoding: ASCII-8BIT
38
- string: oauth_token=00000000-0000-0000-0000-000000000000&oauth_token_secret=000000000000000000000000000000000000000000
109
+ encoding: UTF-8
110
+ string: '{"token_type":"Bearer","expires_in":43200,"access_token":"AccessToken0123456789abcdefghijklmnopqrstuvwxyz","scope":"ag2
111
+ ag1 offline_access ag3","refresh_token":"RefreshToken0123456789abcdefghijklmnopqrstuvwxyz"}'
39
112
  http_version:
40
- recorded_at: Mon, 10 Feb 2020 17:29:12 GMT
113
+ recorded_at: Wed, 17 Mar 2021 22:09:23 GMT
41
114
  recorded_with: VCR 5.0.0