rails-auth 2.2.0 → 2.2.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
  SHA256:
3
- metadata.gz: c22c652d804b973313277d33b6c08dd0f3ae6389dfa0ebeaba73fd84488084b3
4
- data.tar.gz: 95f4c1eab88b2ee3f8f608682690e70c8ca3a4c1b9925b537f14d33c88b91f7c
3
+ metadata.gz: 973af02d5cdabe033f2dbdaf000cbbc0ad234d5e9f7af2f029d3648413de0ffd
4
+ data.tar.gz: 1c2072d5bd8f8a8b251c6feefd5bf731a46813c7686f1db00355dcfaecd6b686
5
5
  SHA512:
6
- metadata.gz: a78bb6b55dd36517e9fd325f433210d3367d2aab18541507ac9feb607cdc92c4f2ce4b26df69bdd093c918b98bfc8c37c75add8ce572a0eb07025d96f2bc95f7
7
- data.tar.gz: c5363dfa5f09bef450d827bdfa24226c4e080c47ff8c4b5c81da94192c834ac4d3fa97531d9dec11b5907949d249f59cf9856dd1b727f40d89b1ce2379ce60ac
6
+ metadata.gz: 46ef4b6d00a5a7fddd575ccbe5942101a10cc96cf193df18a3a8ca93a779b55ce4b77855ebb2362d366eccb52ef910d035bbbca36522960365aaa350463d1347
7
+ data.tar.gz: 0fed93cd383fb6508c4c37511346ab7012ac5efb830f5012920dd51523525104c1ef851319801ebee9029abd15097675f31219e0e3b8fc53439698b6b12722dd
data/CHANGES.md CHANGED
@@ -1,3 +1,9 @@
1
+ ### 2.2.1 (2020-01-08)
2
+
3
+ * [#63](https://github.com/square/rails-auth/pull/63)
4
+ Fix `FrozenError` in `permit` matcher description.
5
+ ([@drcapulet])
6
+
1
7
  ### 2.2.0 (2019-12-05)
2
8
 
3
9
  * [#55](https://github.com/square/rails-auth/pull/55)
@@ -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 << "unauthenticated clients" if credentials.count.zero?
9
+ return message + "unauthenticated clients" if credentials.count.zero?
10
10
 
11
- message << credentials.values.map(&:inspect).join(", ")
11
+ message + credentials.values.map(&:inspect).join(", ")
12
12
  end
13
13
 
14
14
  match { |acl| acl.match(env) }
@@ -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.0"
6
+ VERSION = "2.2.1"
7
7
  end
8
8
  end
@@ -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.0
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: 2019-12-05 00:00:00.000000000 Z
11
+ date: 2020-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack