prx_auth 1.2.1 → 1.3.0

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: 1a851973aab51bd36533ff3959ab4d494886d0c6803fa1be1359ee1a5e0a68c0
4
- data.tar.gz: 9033b3e43be7f508ec7956df7be578e4b860f3285169ac1de6c5ee80b1e21c89
3
+ metadata.gz: ea45502db577f8550ac1aa9d96187123a7a62d67e7d51998eac6d0eded55e587
4
+ data.tar.gz: 1e0cd0290b00484e5bb3dc6979d79c154287c823bf5f284a2657f35addcb6272
5
5
  SHA512:
6
- metadata.gz: 92e74203143a4920470336dd93bedfe07fe03235bbcafc20229f4076bdfabe5240e5908b0765b035c9471c0a8bfbc001435e08e61830dd954f64e65f0d0f2e26
7
- data.tar.gz: 139726fa863102b0e179c63e29df3d42f4fa03082e1208668cc6f9d32062bcab1995921677f22138718449a5b6a1cb67694003e141b829f585f0b6cc141e5dc9
6
+ metadata.gz: cf7061a2989e205e67f8c908f971b26ebb6d281f3234dcfaef1d29b50ed33369a9256ad7472415e67f13f25f63d24f87298562435c70eb0dd4c489b6ca83dac9
7
+ data.tar.gz: ea96bdda24fd8a2a1dba8bea12b9ac793316d021962f0751b3ac3e3496e90b8096db7f38af664fca535e5951a37771761111144154abf4933e10b5f7c538c532
@@ -37,6 +37,14 @@ module PrxAuth
37
37
  end
38
38
  end
39
39
 
40
+ def [](key)
41
+ super(key.to_s)
42
+ end
43
+
44
+ def []=(key, value)
45
+ super(key.to_s, value)
46
+ end
47
+
40
48
  def condense
41
49
  condensed_wildcard = @wildcard.condense
42
50
  condensed_map = Hash[map do |resource, list|
@@ -129,6 +129,10 @@ module PrxAuth
129
129
  self - (self - other_list)
130
130
  end
131
131
 
132
+ def ==(other)
133
+ condense.sort_by(&:to_s) == other.condense.sort_by(&:to_s)
134
+ end
135
+
132
136
  private
133
137
 
134
138
  def symbolize(value)
@@ -1,3 +1,3 @@
1
1
  module PrxAuth
2
- VERSION = "1.2.1"
2
+ VERSION = "1.3.0"
3
3
  end
@@ -169,4 +169,17 @@ describe PrxAuth::ResourceMap do
169
169
  assert map.as_json.has_key?('*')
170
170
  end
171
171
  end
172
+
173
+ describe '#[]' do
174
+ it 'automatically stringifies' do
175
+ refute_nil map[123]
176
+ end
177
+ end
178
+
179
+ describe '#[]=' do
180
+ it 'automatically stringifies' do
181
+ map[789] = PrxAuth::ScopeList.new("")
182
+ refute_nil map["789"]
183
+ end
184
+ end
172
185
  end
@@ -105,4 +105,15 @@ describe PrxAuth::ScopeList do
105
105
  assert !sl.contains?(:one)
106
106
  end
107
107
  end
108
+
109
+ describe '==' do
110
+
111
+ it 'is equal when they are functionally equal' do
112
+ assert_equal PrxAuth::ScopeList.new("foo ns:foo bar ns2:baz"), PrxAuth::ScopeList.new("ns2:baz bar foo")
113
+ end
114
+
115
+ it 'is not equal when they are not functionally equal' do
116
+ refute_equal PrxAuth::ScopeList.new("foo bar"), PrxAuth::ScopeList.new("foo:bar bar:foo")
117
+ end
118
+ end
108
119
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prx_auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eve Asher
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-08-11 00:00:00.000000000 Z
12
+ date: 2020-08-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler