rails-auth 2.2.0 → 2.2.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 973af02d5cdabe033f2dbdaf000cbbc0ad234d5e9f7af2f029d3648413de0ffd
|
4
|
+
data.tar.gz: 1c2072d5bd8f8a8b251c6feefd5bf731a46813c7686f1db00355dcfaecd6b686
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46ef4b6d00a5a7fddd575ccbe5942101a10cc96cf193df18a3a8ca93a779b55ce4b77855ebb2362d366eccb52ef910d035bbbca36522960365aaa350463d1347
|
7
|
+
data.tar.gz: 0fed93cd383fb6508c4c37511346ab7012ac5efb830f5012920dd51523525104c1ef851319801ebee9029abd15097675f31219e0e3b8fc53439698b6b12722dd
|
data/CHANGES.md
CHANGED
@@ -6,9 +6,9 @@ RSpec::Matchers.define(:permit) do |env|
|
|
6
6
|
credentials = Rails::Auth.credentials(env)
|
7
7
|
message = "allow #{method}s by "
|
8
8
|
|
9
|
-
return message
|
9
|
+
return message + "unauthenticated clients" if credentials.count.zero?
|
10
10
|
|
11
|
-
message
|
11
|
+
message + credentials.values.map(&:inspect).join(", ")
|
12
12
|
end
|
13
13
|
|
14
14
|
match { |acl| acl.match(env) }
|
data/lib/rails/auth/version.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
RSpec.describe "RSpec ACL matchers", acl_spec: true do
|
4
|
-
let(:example_certificate) { x509_certificate_hash(ou: "ponycopter") }
|
5
4
|
let(:another_certificate) { x509_certificate_hash(ou: "derpderp") }
|
5
|
+
let(:example_certificate) { x509_certificate_hash(ou: "ponycopter") }
|
6
6
|
|
7
7
|
subject do
|
8
8
|
Rails::Auth::ACL.from_yaml(
|
@@ -18,5 +18,14 @@ RSpec.describe "RSpec ACL matchers", acl_spec: true do
|
|
18
18
|
it { is_expected.to permit get_request(credentials: example_certificate) }
|
19
19
|
it { is_expected.not_to permit get_request(credentials: another_certificate) }
|
20
20
|
it { is_expected.not_to permit get_request }
|
21
|
+
|
22
|
+
it "has the correct description" do
|
23
|
+
expect(permit(get_request(credentials: example_certificate)).description)
|
24
|
+
.to eq('allow GETs by #<InstanceDouble(Rails::Auth::X509::Certificate) "OU=ponycopter">')
|
25
|
+
expect(permit(get_request(credentials: another_certificate)).description)
|
26
|
+
.to eq('allow GETs by #<InstanceDouble(Rails::Auth::X509::Certificate) "OU=derpderp">')
|
27
|
+
expect(permit(get_request).description)
|
28
|
+
.to eq("allow GETs by unauthenticated clients")
|
29
|
+
end
|
21
30
|
end
|
22
31
|
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: 2.2.
|
4
|
+
version: 2.2.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:
|
11
|
+
date: 2020-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|