bootic_client 0.0.28 → 0.0.31

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
  SHA256:
3
- metadata.gz: c48f813ec5b06db70c2dc8c41e926d73ea22dc26f044727c14c0e1888832dab6
4
- data.tar.gz: 6962084f2c798f2895ca3123ad8815ea722671564d09039dbf32bc85200063dd
3
+ metadata.gz: d8906bbfeddb298199ecb675eea93c3780da4a370633bd73cb633bc10f893ae5
4
+ data.tar.gz: d0de74be08f4fffb7f68e02354dead206c67ee1db0662506668fe18ee0ebc4d3
5
5
  SHA512:
6
- metadata.gz: d17691f68ff12731130e000ed699012a8daf5fb9e92868769d2e9a62fd244329257105881ee60b5d5143a42e6a3b2ca6d139e74d0bec8f313744f4d28e35cc74
7
- data.tar.gz: f73e247244aca1c9f88543dfb7a3ace4c61425fa60629221ecf183bdd07dfa927b540cbec64a75f2c0e9d915b4a1f999200e34dff5598c995b78ed7445b063e4
6
+ metadata.gz: caa8411fdb9ab778b1e30c0c9c2e39ee0847a7d8a652658314d058d273b52c653ca85fc444aed5894d4406455965a32202c52365ac7a32ba085d54280360e4df
7
+ data.tar.gz: 1f4989cf0177a73128c9861cedc41a047a986c1ec70394311168b354e312da768d2f2530364c63748e0ed431e9f9b3642321c73e34266c3150500cdf5ae8c53a
@@ -17,13 +17,13 @@ Gem::Specification.new do |spec|
17
17
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
18
  spec.require_paths = ["lib"]
19
19
 
20
- spec.add_dependency "faraday", '~> 0.15'
20
+ spec.add_dependency "faraday", '~> 2.2'
21
+ spec.add_dependency 'faraday-net_http_persistent', '~> 2.0'
21
22
  spec.add_dependency "uri_template", '~> 0.7'
22
23
  spec.add_dependency "faraday-http-cache", '~> 2'
23
- spec.add_dependency "net-http-persistent", '~> 3.0'
24
+ spec.add_dependency "net-http-persistent", '~> 4'
24
25
  spec.add_dependency "oauth2", "~> 1.4"
25
26
 
26
- spec.add_development_dependency "bundler", "~> 1.3"
27
27
  spec.add_development_dependency "rake"
28
28
  spec.add_development_dependency "rspec", "3.5.0"
29
29
  spec.add_development_dependency "jwt", "~> 1.5"
@@ -1,8 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'base64'
2
4
  require 'faraday'
3
5
  require 'faraday-http-cache'
4
6
  require "bootic_client/errors"
5
- require 'faraday/adapter/net_http_persistent'
7
+ require 'faraday/net_http_persistent'
6
8
 
7
9
  module BooticClient
8
10
 
@@ -84,7 +86,7 @@ module BooticClient
84
86
  cache_options = {serializer: SafeCacheSerializer, shared_cache: false, store: options[:cache_store]}
85
87
  cache_options[:logger] = options[:logger] if options[:logging]
86
88
 
87
- f.use :http_cache, cache_options
89
+ f.use :http_cache, **cache_options
88
90
  f.response :logger, options[:logger] if options[:logging]
89
91
  yield f if block_given?
90
92
  f.adapter *Array(options[:faraday_adapter])
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bootic_client/response_handlers'
2
4
 
3
5
  module BooticClient
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "bootic_client/relation"
2
4
 
3
5
  module BooticClient
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module BooticClient
2
4
  class TransportError < StandardError; end
3
5
  class ServerError < TransportError; end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "bootic_client/whiny_uri"
2
4
  require "bootic_client/entity"
3
5
  require 'ostruct'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'json'
2
4
 
3
5
  module BooticClient
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bootic_client/strategies/oauth2_strategy'
2
4
 
3
5
  module BooticClient
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bootic_client/strategies/strategy'
2
4
 
3
5
  module BooticClient
@@ -17,7 +19,7 @@ module BooticClient
17
19
 
18
20
  def client
19
21
  @client ||= Client.new(options) do |c|
20
- c.request :basic_auth, options[:username], options[:password]
22
+ c.request :authorization, :basic, options[:username], options[:password]
21
23
  end
22
24
  end
23
25
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bootic_client/strategies/strategy'
2
4
 
3
5
  module BooticClient
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bootic_client/strategies/oauth2_strategy'
2
4
 
3
5
  module BooticClient
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'oauth2'
2
4
  require 'bootic_client/strategies/strategy'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module BooticClient
2
4
  module Strategies
3
5
  class Strategy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module BooticClient
2
- VERSION = "0.0.28".freeze
4
+ VERSION = "0.0.31".freeze
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'uri_template'
2
4
 
3
5
  module BooticClient
@@ -35,7 +37,7 @@ module BooticClient
35
37
  def path_variables
36
38
  @path_variables ||= (
37
39
  variables.find_all{ |v|
38
- Regexp.new("(\/\{#{v}\})|(\{\/#{v}\})") =~ href
40
+ !!(href["{#{v}}"]) || !!(href["{/#{v}}"])
39
41
  }
40
42
  )
41
43
  end
@@ -23,7 +23,7 @@ describe 'BooticClient::Strategies::Authorized' do
23
23
  to_return(status: status, :headers => response_headers, :body => JSON.dump(body))
24
24
  end
25
25
 
26
- def stub_auth(expired_token, status, body, client_id: '', client_secret: '', scope: '')
26
+ def stub_auth(expired_token, status, body = {})
27
27
  now = Time.now
28
28
  allow(Time).to receive(:now).and_return now
29
29
 
@@ -31,10 +31,10 @@ describe 'BooticClient::Strategies::Authorized' do
31
31
  with(body: {
32
32
  "assertion" => jwt_assertion(expired_token, now),
33
33
  "assertion_type" => "urn:ietf:params:oauth:grant-type:jwt-bearer",
34
- "client_id" => client_id,
35
- "client_secret" => client_secret,
34
+ "client_id" => '', # JWT assertion flow does not need client_id or secret, but library sends them empty
35
+ "client_secret" => '',
36
36
  "grant_type" => "assertion",
37
- "scope"=>scope
37
+ "scope" => ''
38
38
  },
39
39
  headers: {
40
40
  'Content-Type'=>'application/x-www-form-urlencoded'
@@ -114,6 +114,7 @@ describe 'BooticClient::Strategies::Authorized' do
114
114
  root = client.root
115
115
  expect(@failed_root_request).to have_been_requested
116
116
  expect(@auth_request).to have_been_requested
117
+ expect(@successful_root_request).to have_been_requested
117
118
  expect(root.message).to eql('Hello!')
118
119
  end
119
120
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootic_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.28
4
+ version: 0.0.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ismael Celis
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-07 00:00:00.000000000 Z
11
+ date: 2022-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -16,84 +16,84 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.15'
19
+ version: '2.2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.15'
26
+ version: '2.2'
27
27
  - !ruby/object:Gem::Dependency
28
- name: uri_template
28
+ name: faraday-net_http_persistent
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.7'
33
+ version: '2.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0.7'
40
+ version: '2.0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: faraday-http-cache
42
+ name: uri_template
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '2'
47
+ version: '0.7'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '2'
54
+ version: '0.7'
55
55
  - !ruby/object:Gem::Dependency
56
- name: net-http-persistent
56
+ name: faraday-http-cache
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '3.0'
61
+ version: '2'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '3.0'
68
+ version: '2'
69
69
  - !ruby/object:Gem::Dependency
70
- name: oauth2
70
+ name: net-http-persistent
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '1.4'
75
+ version: '4'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '1.4'
82
+ version: '4'
83
83
  - !ruby/object:Gem::Dependency
84
- name: bundler
84
+ name: oauth2
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '1.3'
90
- type: :development
89
+ version: '1.4'
90
+ type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '1.3'
96
+ version: '1.4'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rake
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -203,7 +203,7 @@ homepage: https://developers.bootic.net
203
203
  licenses:
204
204
  - MIT
205
205
  metadata: {}
206
- post_install_message:
206
+ post_install_message:
207
207
  rdoc_options: []
208
208
  require_paths:
209
209
  - lib
@@ -218,9 +218,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
218
218
  - !ruby/object:Gem::Version
219
219
  version: '0'
220
220
  requirements: []
221
- rubyforge_project:
222
- rubygems_version: 2.7.3
223
- signing_key:
221
+ rubygems_version: 3.2.32
222
+ signing_key:
224
223
  specification_version: 4
225
224
  summary: Official Ruby client for the Bootic API
226
225
  test_files: