scram 0.1.1 → 0.1.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
  SHA1:
3
- metadata.gz: 2eb81ae87cd936d67d91dcb5ad6b103a7ab44b04
4
- data.tar.gz: 1e0a1f8cef2a5c5a804f0a15677ca0b45033a407
3
+ metadata.gz: 14a3276893ab2d561da7da52f2f55044f17c0a18
4
+ data.tar.gz: fcb4eb6f0c10f0149cb9ac536804711d8943ac3d
5
5
  SHA512:
6
- metadata.gz: c3bec78c1ab0ca02ca53879fdd3e94351b597a4c7b69d0fca0234f7bc166ace4437e2edbe97a24b6e3fd42cbb0cfd5cc795d5797b47124dd70a3e75ea0ec7aea
7
- data.tar.gz: 03026fec11fdf520300f8c053e17a91d50f3251a33bec782536874749dcc5544b07bcd8b969309d0ece57695431f7512ccdbc6776e0c6bafa08b1b59193b263c
6
+ metadata.gz: bedd3948a313855e61c15dc1652b4c684144798a01c14ff5c34aad880cf20327ba587e5a0463811ac99681fed6bd4581f520bcf54a0a3b7a63d8228911477620
7
+ data.tar.gz: 530fbc07133e45472140a3e248417ea07c6bb81580eff8146df83a14c1ce882fbe9f013d8973e1ea6dc03c92b62c58a0b9b83e72fbb006d5546e253c131d8b5f
@@ -57,8 +57,7 @@ module Scram
57
57
  attribute = begin obj.send(:"#{field}") rescue return :abstain end
58
58
 
59
59
  # Special value substitutions
60
- (model_value = holder.scram_compare_value) if model_value == "*holder"
61
-
60
+ (model_value = holder.scram_compare_value) if model_value.to_s == "*holder"
62
61
  # Abstain if this target doesn't apply to obj in any of its attributes
63
62
  return :abstain unless comparator.call(attribute, model_value)
64
63
  end
@@ -1,3 +1,3 @@
1
1
  module Scram
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -73,3 +73,204 @@ MONGODB | localhost:27017 | scram_dummy_test.listCollections | STARTED | {"listC
73
73
  MONGODB | localhost:27017 | scram_dummy_test.listCollections | SUCCEEDED | 0.000962s
74
74
  MONGODB | localhost:27017 | scram_dummy_test.delete | STARTED | {"delete"=>"scram_policies", "deletes"=>[{"q"=>{}, "limit"=>0}], "ordered"=>true}
75
75
  MONGODB | localhost:27017 | scram_dummy_test.delete | SUCCEEDED | 0.002934s
76
+ MONGODB | Topology type 'unknown' initializing.
77
+ MONGODB | Server localhost:27017 initializing.
78
+ MONGODB | Topology type 'unknown' changed to type 'single'.
79
+ MONGODB | Server description for localhost:27017 changed from 'unknown' to 'standalone'.
80
+ MONGODB | There was a change in the members of the 'single' topology.
81
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | STARTED | {"listCollections"=>1, "cursor"=>{}, "filter"=>{:name=>{"$not"=>/system\.|\$/}}}
82
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | SUCCEEDED | 0.0010680000000000002s
83
+ MONGODB | localhost:27017 | scram_dummy_test.delete | STARTED | {"delete"=>"scram_policies", "deletes"=>[{"q"=>{}, "limit"=>0}], "ordered"=>true}
84
+ MONGODB | localhost:27017 | scram_dummy_test.delete | SUCCEEDED | 0.00038199999999999996s
85
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | STARTED | {"listCollections"=>1, "cursor"=>{}, "filter"=>{:name=>{"$not"=>/system\.|\$/}}}
86
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | SUCCEEDED | 0.000677s
87
+ MONGODB | localhost:27017 | scram_dummy_test.delete | STARTED | {"delete"=>"scram_policies", "deletes"=>[{"q"=>{}, "limit"=>0}], "ordered"=>true}
88
+ MONGODB | localhost:27017 | scram_dummy_test.delete | SUCCEEDED | 0.000684s
89
+ MONGODB | Topology type 'unknown' initializing.
90
+ MONGODB | Server localhost:27017 initializing.
91
+ MONGODB | Topology type 'unknown' changed to type 'single'.
92
+ MONGODB | Server description for localhost:27017 changed from 'unknown' to 'standalone'.
93
+ MONGODB | There was a change in the members of the 'single' topology.
94
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | STARTED | {"listCollections"=>1, "cursor"=>{}, "filter"=>{:name=>{"$not"=>/system\.|\$/}}}
95
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | SUCCEEDED | 0.0024879999999999998s
96
+ MONGODB | localhost:27017 | scram_dummy_test.delete | STARTED | {"delete"=>"scram_policies", "deletes"=>[{"q"=>{}, "limit"=>0}], "ordered"=>true}
97
+ MONGODB | localhost:27017 | scram_dummy_test.delete | SUCCEEDED | 0.0009119999999999999s
98
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | STARTED | {"listCollections"=>1, "cursor"=>{}, "filter"=>{:name=>{"$not"=>/system\.|\$/}}}
99
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | SUCCEEDED | 0.001471s
100
+ MONGODB | localhost:27017 | scram_dummy_test.delete | STARTED | {"delete"=>"scram_policies", "deletes"=>[{"q"=>{}, "limit"=>0}], "ordered"=>true}
101
+ MONGODB | localhost:27017 | scram_dummy_test.delete | SUCCEEDED | 0.000915s
102
+ MONGODB | Topology type 'unknown' initializing.
103
+ MONGODB | Server localhost:27017 initializing.
104
+ MONGODB | Topology type 'unknown' changed to type 'single'.
105
+ MONGODB | Server description for localhost:27017 changed from 'unknown' to 'standalone'.
106
+ MONGODB | There was a change in the members of the 'single' topology.
107
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | STARTED | {"listCollections"=>1, "cursor"=>{}, "filter"=>{:name=>{"$not"=>/system\.|\$/}}}
108
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | SUCCEEDED | 0.001676s
109
+ MONGODB | localhost:27017 | scram_dummy_test.delete | STARTED | {"delete"=>"scram_policies", "deletes"=>[{"q"=>{}, "limit"=>0}], "ordered"=>true}
110
+ MONGODB | localhost:27017 | scram_dummy_test.delete | SUCCEEDED | 0.000859s
111
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | STARTED | {"listCollections"=>1, "cursor"=>{}, "filter"=>{:name=>{"$not"=>/system\.|\$/}}}
112
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | SUCCEEDED | 0.001075s
113
+ MONGODB | localhost:27017 | scram_dummy_test.delete | STARTED | {"delete"=>"scram_policies", "deletes"=>[{"q"=>{}, "limit"=>0}], "ordered"=>true}
114
+ MONGODB | localhost:27017 | scram_dummy_test.delete | SUCCEEDED | 0.000921s
115
+ MONGODB | Topology type 'unknown' initializing.
116
+ MONGODB | Server localhost:27017 initializing.
117
+ MONGODB | Topology type 'unknown' changed to type 'single'.
118
+ MONGODB | Server description for localhost:27017 changed from 'unknown' to 'standalone'.
119
+ MONGODB | There was a change in the members of the 'single' topology.
120
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | STARTED | {"listCollections"=>1, "cursor"=>{}, "filter"=>{:name=>{"$not"=>/system\.|\$/}}}
121
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | SUCCEEDED | 0.002256s
122
+ MONGODB | localhost:27017 | scram_dummy_test.delete | STARTED | {"delete"=>"scram_policies", "deletes"=>[{"q"=>{}, "limit"=>0}], "ordered"=>true}
123
+ MONGODB | localhost:27017 | scram_dummy_test.delete | SUCCEEDED | 0.0007930000000000001s
124
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | STARTED | {"listCollections"=>1, "cursor"=>{}, "filter"=>{:name=>{"$not"=>/system\.|\$/}}}
125
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | SUCCEEDED | 0.000655s
126
+ MONGODB | localhost:27017 | scram_dummy_test.delete | STARTED | {"delete"=>"scram_policies", "deletes"=>[{"q"=>{}, "limit"=>0}], "ordered"=>true}
127
+ MONGODB | localhost:27017 | scram_dummy_test.delete | SUCCEEDED | 0.00066s
128
+ MONGODB | Topology type 'unknown' initializing.
129
+ MONGODB | Server localhost:27017 initializing.
130
+ MONGODB | Topology type 'unknown' changed to type 'single'.
131
+ MONGODB | Server description for localhost:27017 changed from 'unknown' to 'standalone'.
132
+ MONGODB | There was a change in the members of the 'single' topology.
133
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | STARTED | {"listCollections"=>1, "cursor"=>{}, "filter"=>{:name=>{"$not"=>/system\.|\$/}}}
134
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | SUCCEEDED | 0.002345s
135
+ MONGODB | localhost:27017 | scram_dummy_test.delete | STARTED | {"delete"=>"scram_policies", "deletes"=>[{"q"=>{}, "limit"=>0}], "ordered"=>true}
136
+ MONGODB | localhost:27017 | scram_dummy_test.delete | SUCCEEDED | 0.000648s
137
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | STARTED | {"listCollections"=>1, "cursor"=>{}, "filter"=>{:name=>{"$not"=>/system\.|\$/}}}
138
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | SUCCEEDED | 0.001227s
139
+ MONGODB | localhost:27017 | scram_dummy_test.delete | STARTED | {"delete"=>"scram_policies", "deletes"=>[{"q"=>{}, "limit"=>0}], "ordered"=>true}
140
+ MONGODB | localhost:27017 | scram_dummy_test.delete | SUCCEEDED | 0.0008900000000000001s
141
+ MONGODB | Topology type 'unknown' initializing.
142
+ MONGODB | Server localhost:27017 initializing.
143
+ MONGODB | Topology type 'unknown' changed to type 'single'.
144
+ MONGODB | Server description for localhost:27017 changed from 'unknown' to 'standalone'.
145
+ MONGODB | There was a change in the members of the 'single' topology.
146
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | STARTED | {"listCollections"=>1, "cursor"=>{}, "filter"=>{:name=>{"$not"=>/system\.|\$/}}}
147
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | SUCCEEDED | 0.001961s
148
+ MONGODB | localhost:27017 | scram_dummy_test.delete | STARTED | {"delete"=>"scram_policies", "deletes"=>[{"q"=>{}, "limit"=>0}], "ordered"=>true}
149
+ MONGODB | localhost:27017 | scram_dummy_test.delete | SUCCEEDED | 0.000775s
150
+ MONGODB | Topology type 'unknown' initializing.
151
+ MONGODB | Server localhost:27017 initializing.
152
+ MONGODB | Topology type 'unknown' changed to type 'single'.
153
+ MONGODB | Server description for localhost:27017 changed from 'unknown' to 'standalone'.
154
+ MONGODB | There was a change in the members of the 'single' topology.
155
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | STARTED | {"listCollections"=>1, "cursor"=>{}, "filter"=>{:name=>{"$not"=>/system\.|\$/}}}
156
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | SUCCEEDED | 0.001716s
157
+ MONGODB | localhost:27017 | scram_dummy_test.delete | STARTED | {"delete"=>"scram_policies", "deletes"=>[{"q"=>{}, "limit"=>0}], "ordered"=>true}
158
+ MONGODB | localhost:27017 | scram_dummy_test.delete | SUCCEEDED | 0.000649s
159
+ MONGODB | Topology type 'unknown' initializing.
160
+ MONGODB | Server localhost:27017 initializing.
161
+ MONGODB | Topology type 'unknown' changed to type 'single'.
162
+ MONGODB | Server description for localhost:27017 changed from 'unknown' to 'standalone'.
163
+ MONGODB | There was a change in the members of the 'single' topology.
164
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | STARTED | {"listCollections"=>1, "cursor"=>{}, "filter"=>{:name=>{"$not"=>/system\.|\$/}}}
165
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | SUCCEEDED | 0.001733s
166
+ MONGODB | localhost:27017 | scram_dummy_test.delete | STARTED | {"delete"=>"scram_policies", "deletes"=>[{"q"=>{}, "limit"=>0}], "ordered"=>true}
167
+ MONGODB | localhost:27017 | scram_dummy_test.delete | SUCCEEDED | 0.000619s
168
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | STARTED | {"listCollections"=>1, "cursor"=>{}, "filter"=>{:name=>{"$not"=>/system\.|\$/}}}
169
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | SUCCEEDED | 0.001104s
170
+ MONGODB | localhost:27017 | scram_dummy_test.delete | STARTED | {"delete"=>"scram_policies", "deletes"=>[{"q"=>{}, "limit"=>0}], "ordered"=>true}
171
+ MONGODB | localhost:27017 | scram_dummy_test.delete | SUCCEEDED | 0.000652s
172
+ MONGODB | Topology type 'unknown' initializing.
173
+ MONGODB | Server localhost:27017 initializing.
174
+ MONGODB | Topology type 'unknown' changed to type 'single'.
175
+ MONGODB | Server description for localhost:27017 changed from 'unknown' to 'standalone'.
176
+ MONGODB | There was a change in the members of the 'single' topology.
177
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | STARTED | {"listCollections"=>1, "cursor"=>{}, "filter"=>{:name=>{"$not"=>/system\.|\$/}}}
178
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | SUCCEEDED | 0.002765s
179
+ MONGODB | localhost:27017 | scram_dummy_test.delete | STARTED | {"delete"=>"scram_policies", "deletes"=>[{"q"=>{}, "limit"=>0}], "ordered"=>true}
180
+ MONGODB | localhost:27017 | scram_dummy_test.delete | SUCCEEDED | 0.001145s
181
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | STARTED | {"listCollections"=>1, "cursor"=>{}, "filter"=>{:name=>{"$not"=>/system\.|\$/}}}
182
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | SUCCEEDED | 0.000998s
183
+ MONGODB | localhost:27017 | scram_dummy_test.delete | STARTED | {"delete"=>"scram_policies", "deletes"=>[{"q"=>{}, "limit"=>0}], "ordered"=>true}
184
+ MONGODB | localhost:27017 | scram_dummy_test.delete | SUCCEEDED | 0.0006299999999999999s
185
+ MONGODB | Topology type 'unknown' initializing.
186
+ MONGODB | Server localhost:27017 initializing.
187
+ MONGODB | Topology type 'unknown' changed to type 'single'.
188
+ MONGODB | Server description for localhost:27017 changed from 'unknown' to 'standalone'.
189
+ MONGODB | There was a change in the members of the 'single' topology.
190
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | STARTED | {"listCollections"=>1, "cursor"=>{}, "filter"=>{:name=>{"$not"=>/system\.|\$/}}}
191
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | SUCCEEDED | 0.0019310000000000002s
192
+ MONGODB | localhost:27017 | scram_dummy_test.delete | STARTED | {"delete"=>"scram_policies", "deletes"=>[{"q"=>{}, "limit"=>0}], "ordered"=>true}
193
+ MONGODB | localhost:27017 | scram_dummy_test.delete | SUCCEEDED | 0.00067s
194
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | STARTED | {"listCollections"=>1, "cursor"=>{}, "filter"=>{:name=>{"$not"=>/system\.|\$/}}}
195
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | SUCCEEDED | 0.001535s
196
+ MONGODB | localhost:27017 | scram_dummy_test.delete | STARTED | {"delete"=>"scram_policies", "deletes"=>[{"q"=>{}, "limit"=>0}], "ordered"=>true}
197
+ MONGODB | localhost:27017 | scram_dummy_test.delete | SUCCEEDED | 0.000992s
198
+ MONGODB | Topology type 'unknown' initializing.
199
+ MONGODB | Server localhost:27017 initializing.
200
+ MONGODB | Topology type 'unknown' changed to type 'single'.
201
+ MONGODB | Server description for localhost:27017 changed from 'unknown' to 'standalone'.
202
+ MONGODB | There was a change in the members of the 'single' topology.
203
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | STARTED | {"listCollections"=>1, "cursor"=>{}, "filter"=>{:name=>{"$not"=>/system\.|\$/}}}
204
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | SUCCEEDED | 0.0016669999999999999s
205
+ MONGODB | localhost:27017 | scram_dummy_test.delete | STARTED | {"delete"=>"scram_policies", "deletes"=>[{"q"=>{}, "limit"=>0}], "ordered"=>true}
206
+ MONGODB | localhost:27017 | scram_dummy_test.delete | SUCCEEDED | 0.000651s
207
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | STARTED | {"listCollections"=>1, "cursor"=>{}, "filter"=>{:name=>{"$not"=>/system\.|\$/}}}
208
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | SUCCEEDED | 0.000817s
209
+ MONGODB | localhost:27017 | scram_dummy_test.delete | STARTED | {"delete"=>"scram_policies", "deletes"=>[{"q"=>{}, "limit"=>0}], "ordered"=>true}
210
+ MONGODB | localhost:27017 | scram_dummy_test.delete | SUCCEEDED | 0.000542s
211
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | STARTED | {"listCollections"=>1, "cursor"=>{}, "filter"=>{:name=>{"$not"=>/system\.|\$/}}}
212
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | SUCCEEDED | 0.000874s
213
+ MONGODB | localhost:27017 | scram_dummy_test.delete | STARTED | {"delete"=>"scram_policies", "deletes"=>[{"q"=>{}, "limit"=>0}], "ordered"=>true}
214
+ MONGODB | localhost:27017 | scram_dummy_test.delete | SUCCEEDED | 0.000705s
215
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | STARTED | {"listCollections"=>1, "cursor"=>{}, "filter"=>{:name=>{"$not"=>/system\.|\$/}}}
216
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | SUCCEEDED | 0.000784s
217
+ MONGODB | localhost:27017 | scram_dummy_test.delete | STARTED | {"delete"=>"scram_policies", "deletes"=>[{"q"=>{}, "limit"=>0}], "ordered"=>true}
218
+ MONGODB | localhost:27017 | scram_dummy_test.delete | SUCCEEDED | 0.000534s
219
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | STARTED | {"listCollections"=>1, "cursor"=>{}, "filter"=>{:name=>{"$not"=>/system\.|\$/}}}
220
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | SUCCEEDED | 0.0006789999999999999s
221
+ MONGODB | localhost:27017 | scram_dummy_test.delete | STARTED | {"delete"=>"scram_policies", "deletes"=>[{"q"=>{}, "limit"=>0}], "ordered"=>true}
222
+ MONGODB | localhost:27017 | scram_dummy_test.delete | SUCCEEDED | 0.000557s
223
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | STARTED | {"listCollections"=>1, "cursor"=>{}, "filter"=>{:name=>{"$not"=>/system\.|\$/}}}
224
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | SUCCEEDED | 0.001057s
225
+ MONGODB | localhost:27017 | scram_dummy_test.delete | STARTED | {"delete"=>"scram_policies", "deletes"=>[{"q"=>{}, "limit"=>0}], "ordered"=>true}
226
+ MONGODB | localhost:27017 | scram_dummy_test.delete | SUCCEEDED | 0.000595s
227
+ MONGODB | localhost:27017 | scram_dummy_test.insert | STARTED | {"insert"=>"scram_policies", "documents"=>[{"_id"=>BSON::ObjectId('59a0c227366a35e506a488b0'), "priority"=>0, "name"=>"globals", "targets"=>[{"_id"=>BSON::ObjectId('59a0c227366a35e506a488b1'), "actions"=>["woot"], "conditions"=>{"equals"=>{"*target_na...
228
+ MONGODB | localhost:27017 | scram_dummy_test.insert | SUCCEEDED | 0.002778s
229
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | STARTED | {"listCollections"=>1, "cursor"=>{}, "filter"=>{:name=>{"$not"=>/system\.|\$/}}}
230
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | SUCCEEDED | 0.000777s
231
+ MONGODB | localhost:27017 | scram_dummy_test.delete | STARTED | {"delete"=>"scram_policies", "deletes"=>[{"q"=>{}, "limit"=>0}], "ordered"=>true}
232
+ MONGODB | localhost:27017 | scram_dummy_test.delete | SUCCEEDED | 0.000908s
233
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | STARTED | {"listCollections"=>1, "cursor"=>{}, "filter"=>{:name=>{"$not"=>/system\.|\$/}}}
234
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | SUCCEEDED | 0.00131s
235
+ MONGODB | localhost:27017 | scram_dummy_test.delete | STARTED | {"delete"=>"scram_policies", "deletes"=>[{"q"=>{}, "limit"=>0}], "ordered"=>true}
236
+ MONGODB | localhost:27017 | scram_dummy_test.delete | SUCCEEDED | 0.001341s
237
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | STARTED | {"listCollections"=>1, "cursor"=>{}, "filter"=>{:name=>{"$not"=>/system\.|\$/}}}
238
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | SUCCEEDED | 0.0008629999999999999s
239
+ MONGODB | localhost:27017 | scram_dummy_test.delete | STARTED | {"delete"=>"scram_policies", "deletes"=>[{"q"=>{}, "limit"=>0}], "ordered"=>true}
240
+ MONGODB | localhost:27017 | scram_dummy_test.delete | SUCCEEDED | 0.000464s
241
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | STARTED | {"listCollections"=>1, "cursor"=>{}, "filter"=>{:name=>{"$not"=>/system\.|\$/}}}
242
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | SUCCEEDED | 0.0008510000000000001s
243
+ MONGODB | localhost:27017 | scram_dummy_test.delete | STARTED | {"delete"=>"scram_policies", "deletes"=>[{"q"=>{}, "limit"=>0}], "ordered"=>true}
244
+ MONGODB | localhost:27017 | scram_dummy_test.delete | SUCCEEDED | 0.0005589999999999999s
245
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | STARTED | {"listCollections"=>1, "cursor"=>{}, "filter"=>{:name=>{"$not"=>/system\.|\$/}}}
246
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | SUCCEEDED | 0.000828s
247
+ MONGODB | localhost:27017 | scram_dummy_test.delete | STARTED | {"delete"=>"scram_policies", "deletes"=>[{"q"=>{}, "limit"=>0}], "ordered"=>true}
248
+ MONGODB | localhost:27017 | scram_dummy_test.delete | SUCCEEDED | 0.001186s
249
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | STARTED | {"listCollections"=>1, "cursor"=>{}, "filter"=>{:name=>{"$not"=>/system\.|\$/}}}
250
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | SUCCEEDED | 0.0011149999999999999s
251
+ MONGODB | localhost:27017 | scram_dummy_test.delete | STARTED | {"delete"=>"scram_policies", "deletes"=>[{"q"=>{}, "limit"=>0}], "ordered"=>true}
252
+ MONGODB | localhost:27017 | scram_dummy_test.delete | SUCCEEDED | 0.0006789999999999999s
253
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | STARTED | {"listCollections"=>1, "cursor"=>{}, "filter"=>{:name=>{"$not"=>/system\.|\$/}}}
254
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | SUCCEEDED | 0.000691s
255
+ MONGODB | localhost:27017 | scram_dummy_test.delete | STARTED | {"delete"=>"scram_policies", "deletes"=>[{"q"=>{}, "limit"=>0}], "ordered"=>true}
256
+ MONGODB | localhost:27017 | scram_dummy_test.delete | SUCCEEDED | 0.000484s
257
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | STARTED | {"listCollections"=>1, "cursor"=>{}, "filter"=>{:name=>{"$not"=>/system\.|\$/}}}
258
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | SUCCEEDED | 0.00079s
259
+ MONGODB | localhost:27017 | scram_dummy_test.delete | STARTED | {"delete"=>"scram_policies", "deletes"=>[{"q"=>{}, "limit"=>0}], "ordered"=>true}
260
+ MONGODB | localhost:27017 | scram_dummy_test.delete | SUCCEEDED | 0.000532s
261
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | STARTED | {"listCollections"=>1, "cursor"=>{}, "filter"=>{:name=>{"$not"=>/system\.|\$/}}}
262
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | SUCCEEDED | 0.000632s
263
+ MONGODB | localhost:27017 | scram_dummy_test.delete | STARTED | {"delete"=>"scram_policies", "deletes"=>[{"q"=>{}, "limit"=>0}], "ordered"=>true}
264
+ MONGODB | localhost:27017 | scram_dummy_test.delete | SUCCEEDED | 0.001043s
265
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | STARTED | {"listCollections"=>1, "cursor"=>{}, "filter"=>{:name=>{"$not"=>/system\.|\$/}}}
266
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | SUCCEEDED | 0.00102s
267
+ MONGODB | localhost:27017 | scram_dummy_test.delete | STARTED | {"delete"=>"scram_policies", "deletes"=>[{"q"=>{}, "limit"=>0}], "ordered"=>true}
268
+ MONGODB | localhost:27017 | scram_dummy_test.delete | SUCCEEDED | 0.000848s
269
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | STARTED | {"listCollections"=>1, "cursor"=>{}, "filter"=>{:name=>{"$not"=>/system\.|\$/}}}
270
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | SUCCEEDED | 0.000825s
271
+ MONGODB | localhost:27017 | scram_dummy_test.delete | STARTED | {"delete"=>"scram_policies", "deletes"=>[{"q"=>{}, "limit"=>0}], "ordered"=>true}
272
+ MONGODB | localhost:27017 | scram_dummy_test.delete | SUCCEEDED | 0.0006619999999999999s
273
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | STARTED | {"listCollections"=>1, "cursor"=>{}, "filter"=>{:name=>{"$not"=>/system\.|\$/}}}
274
+ MONGODB | localhost:27017 | scram_dummy_test.listCollections | SUCCEEDED | 0.001619s
275
+ MONGODB | localhost:27017 | scram_dummy_test.delete | STARTED | {"delete"=>"scram_policies", "deletes"=>[{"q"=>{}, "limit"=>0}], "ordered"=>true}
276
+ MONGODB | localhost:27017 | scram_dummy_test.delete | SUCCEEDED | 0.0009209999999999999s
@@ -17,6 +17,27 @@ module Scram
17
17
  dude = SimpleHolder.new(policies: [policy]) # This is a test holder
18
18
  expect(dude.can? :woot, TestModel.new).to be false
19
19
  end
20
+
21
+ it "can compare holders" do
22
+ policy = Policy.new
23
+ policy.context = SimpleHolder.name
24
+
25
+ target = Target.new
26
+ target.actions << "edit"
27
+ target.allow = true
28
+ target.conditions = {:equals => {:scram_compare_value => :'*holder'}}
29
+ policy.targets << target
30
+
31
+ policy.save
32
+
33
+ dude1 = SimpleHolder.new(policies: [policy], scram_compare_value: "Mr. Holder Guy")
34
+ dude2 = SimpleHolder.new(policies: [], scram_compare_value: "Mr. Holder Man")
35
+
36
+ expect(dude1.can? :edit, dude1).to be true
37
+ expect(dude1.can? :edit, dude2).to be false
38
+ expect(dude2.can? :edit, dude2).to be false
39
+ expect(dude2.can? :edit, dude1).to be false
40
+ end
20
41
  end
21
42
 
22
43
  describe Scram::Target do
@@ -8,14 +8,11 @@ module Scram
8
8
  class SimpleHolder
9
9
  include Holder
10
10
 
11
- attr_accessor :policies
11
+ attr_accessor :policies, :scram_compare_value
12
12
 
13
- def initialize(policies: [])
13
+ def initialize(policies: [], scram_compare_value: "Mr. Holder Guy")
14
14
  @policies = policies
15
- end
16
-
17
- def scram_compare_value
18
- "Mr. Holder Guy"
15
+ @scram_compare_value = scram_compare_value
19
16
  end
20
17
  end
21
18
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scram
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - skreem
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-26 00:00:00.000000000 Z
11
+ date: 2017-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -206,7 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
206
206
  version: '0'
207
207
  requirements: []
208
208
  rubyforge_project:
209
- rubygems_version: 2.6.10
209
+ rubygems_version: 2.6.12
210
210
  signing_key:
211
211
  specification_version: 4
212
212
  summary: Awesome authorization system