rails-auth 2.2.1 → 2.2.2

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: 973af02d5cdabe033f2dbdaf000cbbc0ad234d5e9f7af2f029d3648413de0ffd
4
- data.tar.gz: 1c2072d5bd8f8a8b251c6feefd5bf731a46813c7686f1db00355dcfaecd6b686
3
+ metadata.gz: 773018e606b80732c9e9feeba00cc583032a39ee74de25b2ccaf3e6a852f086b
4
+ data.tar.gz: 755f13226f84aec603eaac1ab5d21ed803aa7ac4b37e35e3e072be3b8c7a7803
5
5
  SHA512:
6
- metadata.gz: 46ef4b6d00a5a7fddd575ccbe5942101a10cc96cf193df18a3a8ca93a779b55ce4b77855ebb2362d366eccb52ef910d035bbbca36522960365aaa350463d1347
7
- data.tar.gz: 0fed93cd383fb6508c4c37511346ab7012ac5efb830f5012920dd51523525104c1ef851319801ebee9029abd15097675f31219e0e3b8fc53439698b6b12722dd
6
+ metadata.gz: a900eea1969e11b56b431fab48fbe35edd4785a3d15c68ab28e0168a4289678fab7da65ed4cd136821bab93b0fce3b8ac29fb05ab02286542585bbb572d4f217
7
+ data.tar.gz: 55a2d4e03156e24f75db902f0c5346e756912d053b667ab4c64536902d1d443020e07be138fdc480d4dae951e73d9c55340faea88d41c7587d13f1bb11df3542
data/CHANGES.md CHANGED
@@ -1,3 +1,9 @@
1
+ ### 2.2.2 (2020-07-02)
2
+
3
+ * [#65](https://github.com/square/rails-auth/pull/65)
4
+ Fix error when passing `truststore` instead of `ca_file` to X509 middleware.
5
+ ([@drcapulet])
6
+
1
7
  ### 2.2.1 (2020-01-08)
2
8
 
3
9
  * [#63](https://github.com/square/rails-auth/pull/63)
@@ -3,6 +3,6 @@
3
3
  module Rails
4
4
  # Pluggable authentication and authorization for Rack/Rails
5
5
  module Auth
6
- VERSION = "2.2.1"
6
+ VERSION = "2.2.2"
7
7
  end
8
8
  end
@@ -12,20 +12,21 @@ module Rails
12
12
  # Create a new X.509 Middleware object
13
13
  #
14
14
  # @param [Object] app next app in the Rack middleware chain
15
- # @param [Hash] cert_filters maps Rack environment names to cert extractors
16
15
  # @param [String] ca_file path to the CA bundle to verify client certs with
17
- # @param [OpenSSL::X509::Store] truststore (optional) provide your own truststore (for e.g. CRLs)
16
+ # @param [Hash] cert_filters maps Rack environment names to cert extractors
17
+ # @param [Logger] logger place to log verification successes & failures
18
18
  # @param [Boolean] require_cert causes middleware to raise if certs are unverified
19
+ # @param [OpenSSL::X509::Store] truststore (optional) provide your own truststore (for e.g. CRLs)
19
20
  #
20
21
  # @return [Rails::Auth::X509::Middleware] new X509 middleware instance
21
- def initialize(app, cert_filters: {}, ca_file: nil, truststore: nil, require_cert: false, logger: nil)
22
- raise ArgumentError, "no ca_file given" unless ca_file
22
+ def initialize(app, ca_file: nil, cert_filters: {}, logger: nil, require_cert: false, truststore: nil)
23
+ raise ArgumentError, "no ca_file or truststore given" unless ca_file || truststore
23
24
 
24
25
  @app = app
26
+ @cert_filters = cert_filters
25
27
  @logger = logger
26
- @truststore = truststore || OpenSSL::X509::Store.new.add_file(ca_file)
27
28
  @require_cert = require_cert
28
- @cert_filters = cert_filters
29
+ @truststore = truststore || OpenSSL::X509::Store.new.add_file(ca_file)
29
30
 
30
31
  @cert_filters.each do |key, filter|
31
32
  next unless filter.is_a?(Symbol)
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: 2.2.1
4
+ version: 2.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tony Arcieri
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-01-09 00:00:00.000000000 Z
11
+ date: 2020-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack