rails-auth 2.1.2 → 2.1.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 +4 -4
- data/CHANGES.md +6 -0
- data/lib/rails/auth/version.rb +1 -1
- data/lib/rails/auth/x509/filter/pem.rb +8 -1
- data/spec/rails/auth/x509/middleware_spec.rb +7 -0
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 04accd9068297df63d222180e00d66bb5a3cdc24
|
|
4
|
+
data.tar.gz: 36dba8c9eee4957f1defe679ae9d98ceba53393f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 790da2f08086cee1fd8719fff050e18e7cfc1301fb12483c327d117c0875bdc945fe404d7040a184f28dd69c352803b525acd720f94b8f7920f550776d950371
|
|
7
|
+
data.tar.gz: 4f6d90c4d94195cc5b42cd0f783d64168aa045178bea6ac6e646cbf80e221bc0668a9400358271449e570fe8358592ae7ae2d84897771da583c2a45592325426
|
data/CHANGES.md
CHANGED
data/lib/rails/auth/version.rb
CHANGED
|
@@ -5,7 +5,14 @@ module Rails
|
|
|
5
5
|
# Extract OpenSSL::X509::Certificates from Privacy Enhanced Mail (PEM) certificates
|
|
6
6
|
class Pem
|
|
7
7
|
def call(pem)
|
|
8
|
-
|
|
8
|
+
# Normalize the whitespace in the certificate to the exact format
|
|
9
|
+
# certificates are normally formatted in otherwise parsing with fail
|
|
10
|
+
# with a 'nested asn1 error'. split(" ") handles sequential whitespace
|
|
11
|
+
# characters like \t, \n, and space.
|
|
12
|
+
OpenSSL::X509::Certificate.new(pem.split(" ").instance_eval do
|
|
13
|
+
[[self[0], self[1]].join(" "), self[2...-2], [self[-2], self[-1]].join(" ")]
|
|
14
|
+
.flatten.join("\n")
|
|
15
|
+
end).freeze
|
|
9
16
|
end
|
|
10
17
|
end
|
|
11
18
|
end
|
|
@@ -33,6 +33,13 @@ RSpec.describe Rails::Auth::X509::Middleware do
|
|
|
33
33
|
_response, env = middleware.call(request.merge(example_key => bad_cert_pem))
|
|
34
34
|
expect(Rails::Auth.credentials(env)).to be_empty
|
|
35
35
|
end
|
|
36
|
+
|
|
37
|
+
it "normalizes abnormal whitespace" do
|
|
38
|
+
_response, env = middleware.call(request.merge(example_key => valid_cert_pem.tr("\n", "\t")))
|
|
39
|
+
|
|
40
|
+
credential = Rails::Auth.credentials(env).fetch("x509")
|
|
41
|
+
expect(credential).to be_a Rails::Auth::X509::Certificate
|
|
42
|
+
end
|
|
36
43
|
end
|
|
37
44
|
|
|
38
45
|
# :nocov:
|
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.1.
|
|
4
|
+
version: 2.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tony Arcieri
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-
|
|
11
|
+
date: 2017-08-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rack
|
|
@@ -145,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
145
145
|
version: '0'
|
|
146
146
|
requirements: []
|
|
147
147
|
rubyforge_project:
|
|
148
|
-
rubygems_version: 2.6.
|
|
148
|
+
rubygems_version: 2.6.11
|
|
149
149
|
signing_key:
|
|
150
150
|
specification_version: 4
|
|
151
151
|
summary: Modular resource-oriented authentication and authorization for Rails/Rack
|