lhc 12.0.2 → 12.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6eb0a56bdedb5ee97b2ab47ea911fe69419679add3702442659dd29722676495
4
- data.tar.gz: e8d95c1c772a91592ada2f0062e1b9fe463c5b1bffe600e745e799ed8e1db068
3
+ metadata.gz: ad768b826ac53e7175609b97943ffbb746f514c1f99bdfb7174d48307052df4c
4
+ data.tar.gz: 7bcbcf0c7d08b7be73eb7ece1b688fb8be003d68d269b4ef70d5994fab9cc07a
5
5
  SHA512:
6
- metadata.gz: 612db75bd05d1b172cb8282ecc2129e752b1d35b7c5514827fc984ea5da449bc52796d4e2f455fa14bbf752bf72f65c50673668259aba85547e84d5843d12df9
7
- data.tar.gz: 4eceeabc7780e0fa1b2a9039515a9e8f6fdbae86b7b50e09e82afec1fefa7a4c2309175ba52ef195ce182dc6caf63d8edf0721fe5b23d5f96b65516291956493
6
+ metadata.gz: c181e5bc874086374c453e6056d31c948eaa2d4a869dfa002819e3236d486c6b98e7d3c058e5cca2dbc423d58a0777b3208471426dc8e47c085cc92cedef6afb
7
+ data.tar.gz: 3203b6a2ae1c3180271b7d7f16b5dbf1b499cad6c623145139d74a5e65bd59d7376267702417e483f6c82b0942d89e72b0b24fe7e978b349de75a9a1cffd6e55
@@ -27,7 +27,7 @@ class LHC::Auth < LHC::Interceptor
27
27
  def basic_authentication!
28
28
  auth = auth_options[:basic]
29
29
  credentials = "#{auth[:username]}:#{auth[:password]}"
30
- set_authorization_header("Basic #{Base64.encode64(credentials).chomp}")
30
+ set_authorization_header("Basic #{Base64.strict_encode64(credentials).chomp}")
31
31
  end
32
32
 
33
33
  def bearer_authentication!
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LHC
4
- VERSION ||= '12.0.2'
4
+ VERSION ||= '12.0.3'
5
5
  end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'rails_helper'
4
+
5
+ describe LHC::Auth do
6
+ before(:each) do
7
+ LHC.config.interceptors = [LHC::Auth]
8
+ end
9
+
10
+ it 'adds basic auth in a correct way even if username and password are especially long' do
11
+ options = { basic: { username: '123456789101234', password: '12345678901234567890123456789012' } }
12
+ LHC.config.endpoint(:local, 'http://local.ch', auth: options)
13
+ stub_request(:get, 'http://local.ch')
14
+ .with(headers: { 'Authorization' => 'Basic MTIzNDU2Nzg5MTAxMjM0OjEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDU2Nzg5MDEy' })
15
+ LHC.get(:local)
16
+ end
17
+ 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.0.2
4
+ version: 12.0.3
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-13 00:00:00.000000000 Z
11
+ date: 2020-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -325,6 +325,7 @@ files:
325
325
  - spec/interceptors/after_response_spec.rb
326
326
  - spec/interceptors/auth/basic_auth_spec.rb
327
327
  - spec/interceptors/auth/bearer_spec.rb
328
+ - spec/interceptors/auth/long_basic_auth_credentials_spec.rb
328
329
  - spec/interceptors/auth/reauthentication_configuration_spec.rb
329
330
  - spec/interceptors/auth/reauthentication_spec.rb
330
331
  - spec/interceptors/before_request_spec.rb
@@ -475,6 +476,7 @@ test_files:
475
476
  - spec/interceptors/after_response_spec.rb
476
477
  - spec/interceptors/auth/basic_auth_spec.rb
477
478
  - spec/interceptors/auth/bearer_spec.rb
479
+ - spec/interceptors/auth/long_basic_auth_credentials_spec.rb
478
480
  - spec/interceptors/auth/reauthentication_configuration_spec.rb
479
481
  - spec/interceptors/auth/reauthentication_spec.rb
480
482
  - spec/interceptors/before_request_spec.rb