rails-auth 0.5.0 → 0.5.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: 5b53b6e5c83754e0969eb6316702cb4c86d400ef
4
- data.tar.gz: 742a2563345cbfa9e46f76455e751a8401d121e7
3
+ metadata.gz: 2d372187c646424f03fc0c51565e968dcbb3f6a4
4
+ data.tar.gz: 5de2b2d0f88d7112402a9dee2680772fd04e23a9
5
5
  SHA512:
6
- metadata.gz: f2dc8374a0087e53aa9abb7f9a9525154b1d77af73ff19438d41e344aad213f6a98b835a8013ec454988418833970dff6f5b3c6dbce70a922709347e737be4ee
7
- data.tar.gz: 57c08bf49162fef4de03e307fa2895353edfd8709cc3f453ac4def792a19723bd053639a2fb0419672dbc952582b4b08e29be5f15ce5d38ff63b69a73ddd1f1a
6
+ metadata.gz: 0a8445e89067478c73a7a98a7e4bec6ede6986e883af8e252ee488853b281f1d626bf651a740e178e4ec29d3f907e34d09445ad64a36feefdef14b310e6a2ca6
7
+ data.tar.gz: 52f2b7cc60c0ca6ec7a71cd167e8d2a2041a9b650e20949aa8f9d841d06e3fdb1ae83a83693dbe2321ebf43eb4a7281f886ec740f40eea74ec986100aa6aadc8
data/CHANGES.md CHANGED
@@ -1,3 +1,9 @@
1
+ ### 0.5.1 (2016-04-24)
2
+
3
+ * [#20](https://github.com/square/rails-auth/pull/20)
4
+ Handle X5.09 filter exceptions.
5
+ ([@tarcieri])
6
+
1
7
  ### 0.5.0 (2016-04-24)
2
8
 
3
9
  * [#19](https://github.com/square/rails-auth/pull/19)
@@ -3,6 +3,6 @@
3
3
  module Rails
4
4
  # Pluggable authentication and authorization for Rack/Rails
5
5
  module Auth
6
- VERSION = "0.5.0".freeze
6
+ VERSION = "0.5.1".freeze
7
7
  end
8
8
  end
@@ -46,10 +46,7 @@ module Rails
46
46
 
47
47
  def extract_credential(env)
48
48
  @cert_filters.each do |key, filter|
49
- raw_cert = env[key]
50
- next unless raw_cert
51
-
52
- cert = filter.call(raw_cert)
49
+ cert = extract_certificate_with_filter(filter, env[key])
53
50
  next unless cert
54
51
 
55
52
  if @truststore.verify(cert)
@@ -65,6 +62,18 @@ module Rails
65
62
  nil
66
63
  end
67
64
 
65
+ def extract_certificate_with_filter(filter, raw_cert)
66
+ case raw_cert
67
+ when String then return if raw_cert.empty?
68
+ when NilClass then return
69
+ end
70
+
71
+ filter.call(raw_cert)
72
+ rescue => ex
73
+ @logger.debug("rails-auth: Certificate error: #{ex.class}: #{ex.message}") if @logger
74
+ nil
75
+ end
76
+
68
77
  def log(message, cert)
69
78
  @logger.debug("rails-auth: #{message} (#{subject(cert)})") if @logger
70
79
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tony Arcieri
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-04-24 00:00:00.000000000 Z
11
+ date: 2016-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack