lhc 12.1.0 → 12.1.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
  SHA256:
3
- metadata.gz: 20beb1550ea6286010ac46dd969bcdd8cdcc4dbb968d5ebbfdf3b591eb118fb1
4
- data.tar.gz: c219d6d5bfb4b7a00e7c2d2273162d2cf3b1d106742dc803e9abfaa0987c0fae
3
+ metadata.gz: a8c1cf6d1d9237c3cad231ae1fca7cadfcaaf6283eb429544945715235172b61
4
+ data.tar.gz: 9945fabdbdd44fbef2fd472f0e4f7a37f347393b92fda1918abda13d6b65d195
5
5
  SHA512:
6
- metadata.gz: 609167a963677ba5191a5579a43b9740c08b16be259041da52cb5459e5e5c0eb481361a4115323b6bfa1c444b068669760dc530a5cbaea35af747f63650cea62
7
- data.tar.gz: 47e4cbc20c4ab60befb908c719b0c7625a982325b7b756c48ceedec11f649c082c0715a26b0e8f76ce6124b1ef5dd2b0df475e1c13cfef568147b989a317dbe7
6
+ metadata.gz: d208eca04aac94eb7f93b3053590df5c0626165cddf479ca3b1ea94907a71ee530df9de76f86f6b6492f14936a77d06f3ae296c9a854c8f1262866fdc4bad3bf
7
+ data.tar.gz: eaa8166c752a295b34a2b6e0c3406bee09f771a77f2f17ba39b509396fa264ce9387ea5f2dc507fa50f51c2287c0d4fe57bc9849dfdada0a7fc2572aaf5527bf
@@ -80,7 +80,7 @@ class LHC::Auth < LHC::Interceptor
80
80
  end
81
81
 
82
82
  def auth_options
83
- @auth_options ||= request.options[:auth].dup || {}
83
+ request.options[:auth] || {}
84
84
  end
85
85
 
86
86
  def configuration_correct?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LHC
4
- VERSION ||= '12.1.0'
4
+ VERSION ||= '12.1.1'
5
5
  end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'rails_helper'
4
+
5
+ describe LHC::Auth do
6
+ before(:each) do
7
+ class AuthPrepInterceptor < LHC::Interceptor
8
+
9
+ def before_request
10
+ request.options[:auth] = { bearer: 'sometoken' }
11
+ end
12
+ end
13
+
14
+ LHC.config.interceptors = [AuthPrepInterceptor, LHC::Auth]
15
+ end
16
+
17
+ after do
18
+ LHC.config.reset
19
+ end
20
+
21
+ it 'does not use instance variables internally so that other interceptors can still change auth options' do
22
+ stub_request(:get, "http://local.ch/")
23
+ .with(headers: { 'Authorization' => 'Bearer sometoken' })
24
+ .to_return(status: 200)
25
+ LHC.get('http://local.ch')
26
+ end
27
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lhc
3
3
  version: !ruby/object:Gem::Version
4
- version: 12.1.0
4
+ version: 12.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - https://github.com/local-ch/lhc/contributors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-27 00:00:00.000000000 Z
11
+ date: 2020-07-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -327,6 +327,7 @@ files:
327
327
  - spec/interceptors/auth/bearer_spec.rb
328
328
  - spec/interceptors/auth/body_spec.rb
329
329
  - spec/interceptors/auth/long_basic_auth_credentials_spec.rb
330
+ - spec/interceptors/auth/no_instance_var_for_options_spec.rb
330
331
  - spec/interceptors/auth/reauthentication_configuration_spec.rb
331
332
  - spec/interceptors/auth/reauthentication_spec.rb
332
333
  - spec/interceptors/before_request_spec.rb
@@ -479,6 +480,7 @@ test_files:
479
480
  - spec/interceptors/auth/bearer_spec.rb
480
481
  - spec/interceptors/auth/body_spec.rb
481
482
  - spec/interceptors/auth/long_basic_auth_credentials_spec.rb
483
+ - spec/interceptors/auth/no_instance_var_for_options_spec.rb
482
484
  - spec/interceptors/auth/reauthentication_configuration_spec.rb
483
485
  - spec/interceptors/auth/reauthentication_spec.rb
484
486
  - spec/interceptors/before_request_spec.rb