gitlab_omniauth-ldap 2.1.0 → 2.1.1

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
  SHA1:
3
- metadata.gz: 107e59861e46c73e0ef7ecce99aae216a71f9dd1
4
- data.tar.gz: 0eee9f8076ecad7e956ddd666e5b921b0fcd55e8
3
+ metadata.gz: 6d0257f9f6fc7f3368403940bba04ecc860b8c52
4
+ data.tar.gz: 706ce31f13aa10bc0e5e982ae2ad52d611ec1dbd
5
5
  SHA512:
6
- metadata.gz: 91734fda37560214286bfce376042ad99a972f285de2e6c61d189ddab9a81c0ae3d8eab2ff209c41b1eb378e680f1570942e5cb08b1e729f245b65223618ee59
7
- data.tar.gz: efe11e7dc19bf70bc74f2ac3e71cf345bf0ac20c8ef36fabceaa01c1066228d48acf5b5226ff9f951249080e0d0d5b31f79ee1c3788f2bf4cd0782e18726dec9
6
+ metadata.gz: 22c81461f04cd89702366adabeeff539195a887f046ebd1d0235f9bbbed2d0c8ace4a74e151924a37d330de3806727475e2d27790a328eb824e623e1e0e9295d
7
+ data.tar.gz: 29bcd91f9be90911956f7891f81f33fcc591c0258861e2a99f2b99312b8ae6473cec4dfcef4dd535081254530e8e50b0968aa385b127ba530459ec97ba2ae6c7
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ ## 2.1.1
2
+ - Add a String check to `tls_options` sanitization to allow other objects
3
+
1
4
  ## 2.1.0
2
5
  - Expose `:tls_options` SSL configuration option. Deprecate :ca_file, :ssl_version
3
6
 
@@ -213,8 +213,14 @@ module OmniAuth
213
213
  end
214
214
 
215
215
  # Removes keys that have blank values
216
+ #
217
+ # This gem may not always be in the context of Rails so we
218
+ # do this rather than `.blank?`.
216
219
  def sanitize_hash_values(hash)
217
- hash.delete_if { |_, value| value.nil? || value !~ /\S/ }
220
+ hash.delete_if do |_, value|
221
+ value.nil? ||
222
+ (value.is_a?(String) && value !~ /\S/)
223
+ end
218
224
  end
219
225
 
220
226
  def symbolize_hash_keys(hash)
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module LDAP
3
- VERSION = "2.1.0"
3
+ VERSION = "2.1.1"
4
4
  end
5
5
  end
@@ -128,8 +128,11 @@ describe OmniAuth::LDAP::Adaptor do
128
128
 
129
129
  context 'when tls_options are specified' do
130
130
  it 'should pass the values along with defaults' do
131
- adaptor = OmniAuth::LDAP::Adaptor.new({host: "192.168.1.145", encryption: 'ssl', base: 'dc=intridea, dc=com', port: 636, uid: 'sAMAccountName', bind_dn: 'bind_dn', password: 'password', tls_options: { ca_file: '/etc/ca.pem', ssl_version: 'TLSv1_2' }})
132
- adaptor.connection.instance_variable_get('@encryption').should include tls_options: OpenSSL::SSL::SSLContext::DEFAULT_PARAMS.merge(ca_file: '/etc/ca.pem', ssl_version: 'TLSv1_2')
131
+ cert = OpenSSL::X509::Certificate.new
132
+ key = OpenSSL::PKey::RSA.new
133
+
134
+ adaptor = OmniAuth::LDAP::Adaptor.new({host: "192.168.1.145", encryption: 'ssl', base: 'dc=intridea, dc=com', port: 636, uid: 'sAMAccountName', bind_dn: 'bind_dn', password: 'password', tls_options: { ca_file: '/etc/ca.pem', ssl_version: 'TLSv1_2', cert: cert, key: key }})
135
+ adaptor.connection.instance_variable_get('@encryption').should include tls_options: OpenSSL::SSL::SSLContext::DEFAULT_PARAMS.merge(ca_file: '/etc/ca.pem', ssl_version: 'TLSv1_2', cert: cert, key: key)
133
136
  end
134
137
 
135
138
  it 'does not pass nil or blank values' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab_omniauth-ldap
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ping Yu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-18 00:00:00.000000000 Z
11
+ date: 2019-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth
@@ -172,7 +172,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
172
172
  version: '0'
173
173
  requirements: []
174
174
  rubyforge_project:
175
- rubygems_version: 2.4.5.1
175
+ rubygems_version: 2.6.14.3
176
176
  signing_key:
177
177
  specification_version: 4
178
178
  summary: A LDAP strategy for OmniAuth.