shibkit-meta_meta 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. data/.document +5 -0
  2. data/.rspec +1 -0
  3. data/Gemfile +21 -0
  4. data/Gemfile.lock +52 -0
  5. data/Icon.png +0 -0
  6. data/LICENSE.txt +177 -0
  7. data/README.md +789 -0
  8. data/Rakefile +38 -0
  9. data/VERSION +1 -0
  10. data/examples/biggest_entity_id.rb +4 -0
  11. data/lib/shibkit/meta_meta.rb +600 -0
  12. data/lib/shibkit/meta_meta/attribute.rb +73 -0
  13. data/lib/shibkit/meta_meta/config.rb +463 -0
  14. data/lib/shibkit/meta_meta/contact.rb +85 -0
  15. data/lib/shibkit/meta_meta/data/default_metadata/example_federation_metadata.xml +168 -0
  16. data/lib/shibkit/meta_meta/data/default_metadata/local_metadata.xml +66 -0
  17. data/lib/shibkit/meta_meta/data/default_metadata/uncommon_federation_metadata.xml +115 -0
  18. data/lib/shibkit/meta_meta/data/default_metadata_cache.yml +166 -0
  19. data/lib/shibkit/meta_meta/data/dev_sources.yml +86 -0
  20. data/lib/shibkit/meta_meta/data/real_sources.yml +163 -0
  21. data/lib/shibkit/meta_meta/entity.rb +219 -0
  22. data/lib/shibkit/meta_meta/federation.rb +161 -0
  23. data/lib/shibkit/meta_meta/idp.rb +81 -0
  24. data/lib/shibkit/meta_meta/logo.rb +216 -0
  25. data/lib/shibkit/meta_meta/metadata_item.rb +244 -0
  26. data/lib/shibkit/meta_meta/mixin/cached_downloads.rb +127 -0
  27. data/lib/shibkit/meta_meta/mixin/xpath_chores.rb +111 -0
  28. data/lib/shibkit/meta_meta/organisation.rb +73 -0
  29. data/lib/shibkit/meta_meta/provider.rb +195 -0
  30. data/lib/shibkit/meta_meta/provisioning/base.rb +33 -0
  31. data/lib/shibkit/meta_meta/requested_attribute.rb +29 -0
  32. data/lib/shibkit/meta_meta/service.rb +94 -0
  33. data/lib/shibkit/meta_meta/source.rb +558 -0
  34. data/lib/shibkit/meta_meta/sp.rb +79 -0
  35. data/shibkit-meta_meta.gemspec +154 -0
  36. data/spec/meta_meta/attribute/token +0 -0
  37. data/spec/meta_meta/config/autoloading_and_refreshing_spec.rb +72 -0
  38. data/spec/meta_meta/config/code_nspec.rb +13 -0
  39. data/spec/meta_meta/config/configuration_spec.rb +30 -0
  40. data/spec/meta_meta/config/creation_spec.rb +43 -0
  41. data/spec/meta_meta/config/downloading_and_caching_settings_spec.rb +216 -0
  42. data/spec/meta_meta/config/env_platform_settings.rb +129 -0
  43. data/spec/meta_meta/config/filtering_settings_spec.rb +123 -0
  44. data/spec/meta_meta/config/init.rb +8 -0
  45. data/spec/meta_meta/config/logger_settings_spec.rb +91 -0
  46. data/spec/meta_meta/config/smartcache_settings_spec.rb +110 -0
  47. data/spec/meta_meta/config/source_file_settings_spec.rb +99 -0
  48. data/spec/meta_meta/config/tagging_settings_spec.rb +81 -0
  49. data/spec/meta_meta/config/working_directory_settings_spec.rb +106 -0
  50. data/spec/meta_meta/config/xml_processing_settings_spec.rb +75 -0
  51. data/spec/meta_meta/contact/contact_oldspec.rb +0 -0
  52. data/spec/meta_meta/entity/entity_oldspec.rb +53 -0
  53. data/spec/meta_meta/federation/federation_oldspec.rb +0 -0
  54. data/spec/meta_meta/idp/token +0 -0
  55. data/spec/meta_meta/logo/token +0 -0
  56. data/spec/meta_meta/meta_meta/cache_example.yaml +141284 -0
  57. data/spec/meta_meta/meta_meta/meta_meta_spec.rb +269 -0
  58. data/spec/meta_meta/meta_meta/saved_sources.yaml +46 -0
  59. data/spec/meta_meta/metadata_item/token +0 -0
  60. data/spec/meta_meta/organisation/organisation_oldspec.rb +0 -0
  61. data/spec/meta_meta/provider/token +0 -0
  62. data/spec/meta_meta/requested_attribute/token +0 -0
  63. data/spec/meta_meta/service/token +0 -0
  64. data/spec/meta_meta/source/application_extras_spec.rb +234 -0
  65. data/spec/meta_meta/source/conversion_spec.rb +75 -0
  66. data/spec/meta_meta/source/creation_spec.rb +0 -0
  67. data/spec/meta_meta/source/downloads_and_caching_spec.rb +0 -0
  68. data/spec/meta_meta/source/federation_information_spec.rb +11 -0
  69. data/spec/meta_meta/source/fixtures.rb +24 -0
  70. data/spec/meta_meta/source/init.rb +1 -0
  71. data/spec/meta_meta/source/loading_and_saving_spec.rb +0 -0
  72. data/spec/meta_meta/source/metadata_details_spec.rb +0 -0
  73. data/spec/meta_meta/source/metadata_integrity_spec.rb +0 -0
  74. data/spec/meta_meta/source/selection_spec.rb +0 -0
  75. data/spec/meta_meta/source/source_oldspec.rb +353 -0
  76. data/spec/meta_meta/source/xml_parsing_spec.rb +0 -0
  77. data/spec/meta_meta/sp/token +0 -0
  78. data/spec/meta_meta/template +2 -0
  79. data/spec/moi/config_spec.rb +0 -0
  80. data/spec/spec.opts +1 -0
  81. data/spec/spec_helper.rb +25 -0
  82. data/spec/support/supply_xml.rb +0 -0
  83. metadata +320 -0
@@ -0,0 +1,75 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '../../../spec_helper')
2
+ require File.expand_path(File.dirname(__FILE__) + '/fixtures.rb')
3
+
4
+ describe Shibkit::MetaMeta::Source, "conversion to and from other classes" do
5
+
6
+ #require File.expand_path(File.dirname(__FILE__) + '/fixtures')
7
+
8
+ ##
9
+ before(:each) do
10
+ @source = Shibkit::MetaMeta::Source.new
11
+ @class = Shibkit::MetaMeta::Source
12
+ end
13
+
14
+ describe "the Source class" do
15
+
16
+ it "should respond to from_hash" do
17
+
18
+ Shibkit::MetaMeta::Source.should respond_to :from_hash
19
+
20
+ end
21
+
22
+ #it "should be able to create a new Source object from a Hash" do
23
+ #
24
+ # Shibkit::MetaMeta::Source.from_hash({})
25
+ #
26
+ #end
27
+
28
+ end
29
+
30
+ subject { @source }
31
+
32
+ it { should respond_to :to_hash }
33
+ it { should respond_to :to_federation }
34
+ it { should respond_to :to_s }
35
+
36
+ it "should be able to output a hash"
37
+
38
+ describe "the saved hash" do
39
+
40
+ @parent = TYPICAL_SOURCE_OBJECT
41
+
42
+ it "should have all keys as symbols"
43
+ it "should have the same name_uri"
44
+ it "should have the same name"
45
+ it "should have the same refresh_delay (stored as epoch seconds)"
46
+ it "should have the same display_name"
47
+ it "should have the same type"
48
+ it "should have the same countries"
49
+ it "should have the same metadata_source"
50
+ it "should have the same certificate_source"
51
+ it "should have the same fingerprint"
52
+ it "should have the same refeds_info"
53
+ it "should have the same homepage"
54
+ it "should have the same languages"
55
+ it "should have the same support_email"
56
+ it "should have the same description"
57
+ it "should have the same active"
58
+ it "should have the same trustiness"
59
+ it "should have the same groups"
60
+ it "should have the same tags"
61
+
62
+ end
63
+
64
+ it "should be able to create a federation object"
65
+
66
+ describe "the federation object" do
67
+
68
+ end
69
+
70
+ it "should have a special to_s method that is its URI"
71
+
72
+ end
73
+
74
+
75
+
File without changes
@@ -0,0 +1,11 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '../../../spec_helper')
2
+
3
+ describe Shibkit::MetaMeta::Config, "automatic download and refresh settings" do
4
+
5
+ ## Testing a singleton is tricky! Make a copy of the class each time
6
+ before(:each) do
7
+ @config_class = Shibkit::MetaMeta::Config.clone
8
+ @config = @config_class.instance
9
+ end
10
+
11
+ end
@@ -0,0 +1,24 @@
1
+
2
+ default_source_object = Shibkit::MetaMeta::Source.new
3
+
4
+ TYPICAL_SOURCE_OBJECT = Shibkit::MetaMeta::Source.new do |s|
5
+ s.name_uri = ""
6
+ s.name = "Unnown"
7
+ s.refresh_delay = 86400
8
+ s.display_name = "Unknown"
9
+ s.type = "federation"
10
+ s.countries = []
11
+ s.metadata_source = nil
12
+ s.certificate_source = nil
13
+ s.fingerprint = nil
14
+ s.refeds_url = nil
15
+ s.homepage = nil
16
+ s.languages = []
17
+ s.support_email = nil
18
+ s.description = ""
19
+ s.active = true
20
+ s.trustiness = 1
21
+ s.groups = []
22
+ s.tags = []
23
+
24
+ end
@@ -0,0 +1 @@
1
+ #
@@ -0,0 +1,353 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+ require 'shibkit/metameta/source'
3
+
4
+ describe Shibkit::MetaMeta::Source do
5
+
6
+ shared_examples "any source object" do
7
+
8
+ describe "#name_uri" do
9
+
10
+ it ""
11
+ it ""
12
+
13
+ end
14
+
15
+ describe "#name" do
16
+
17
+ it ""
18
+ it ""
19
+
20
+ end
21
+
22
+ describe "#display_name" do
23
+
24
+ it ""
25
+ it ""
26
+
27
+ end
28
+
29
+
30
+ describe "#type" do
31
+
32
+ it ""
33
+ it ""
34
+
35
+ end
36
+
37
+
38
+ describe "#refresh_delay" do
39
+
40
+ it ""
41
+ it ""
42
+
43
+ end
44
+
45
+
46
+ describe "#countries" do
47
+
48
+ it ""
49
+ it ""
50
+
51
+ end
52
+
53
+
54
+ describe "#metadata_source" do
55
+
56
+ it ""
57
+ it ""
58
+
59
+ end
60
+
61
+
62
+ describe "#certificate_source" do
63
+
64
+ it ""
65
+ it ""
66
+
67
+ end
68
+
69
+
70
+ describe "#fingerprint" do
71
+
72
+ it ""
73
+ it ""
74
+
75
+ end
76
+
77
+
78
+ describe "#refeds_info" do
79
+
80
+ it ""
81
+ it ""
82
+
83
+ end
84
+
85
+
86
+ describe "#homepage" do
87
+
88
+ it ""
89
+ it ""
90
+
91
+ end
92
+
93
+
94
+ describe "#languages" do
95
+
96
+ it ""
97
+ it ""
98
+
99
+ end
100
+
101
+
102
+ describe "#support_email" do
103
+
104
+ it ""
105
+ it ""
106
+
107
+ end
108
+
109
+
110
+ describe "#description" do
111
+
112
+ it ""
113
+ it ""
114
+
115
+ end
116
+
117
+
118
+ describe "#fetched_at" do
119
+
120
+ it ""
121
+ it ""
122
+
123
+ end
124
+
125
+
126
+ describe "#messages" do
127
+
128
+ it ""
129
+ it ""
130
+
131
+ end
132
+
133
+
134
+ describe "#status" do
135
+
136
+ it ""
137
+ it ""
138
+
139
+ end
140
+
141
+
142
+ describe "#refresh" do
143
+
144
+ it ""
145
+ it ""
146
+
147
+ end
148
+
149
+
150
+ describe "#fetch_metadata" do
151
+
152
+ it ""
153
+ it ""
154
+
155
+ end
156
+
157
+
158
+ describe "#fetch_certificate" do
159
+
160
+ it ""
161
+ it ""
162
+
163
+ end
164
+
165
+
166
+ describe "#validate" do
167
+
168
+ it ""
169
+ it ""
170
+
171
+ end
172
+
173
+
174
+ describe "#valid?" do
175
+
176
+ it ""
177
+ it ""
178
+
179
+ end
180
+
181
+
182
+ describe "#certificate_pem" do
183
+
184
+ it ""
185
+ it ""
186
+
187
+ end
188
+
189
+
190
+ describe "#content" do
191
+
192
+ it ""
193
+ it ""
194
+
195
+ end
196
+
197
+
198
+ describe "#ok?" do
199
+
200
+ it ""
201
+ it ""
202
+
203
+ end
204
+
205
+ end
206
+
207
+ shared_examples "a federation" do
208
+
209
+ end
210
+
211
+
212
+ shared_examples "a collection" do
213
+
214
+ end
215
+
216
+
217
+ shared_examples "a remote source" do
218
+
219
+ end
220
+
221
+
222
+ shared_examples "a local source" do
223
+
224
+ end
225
+
226
+ context "created with default values" do
227
+
228
+ it_behaves_like "any source object"
229
+
230
+ end
231
+
232
+ context "manually defined as a federation with remote metadata" do
233
+
234
+ it_behaves_like "any source object"
235
+ it_behaves_like "a federation"
236
+ it_behaves_like "a remote source"
237
+
238
+ end
239
+
240
+ context "manually defined as a federation with local metadata" do
241
+
242
+ it_behaves_like "any source object"
243
+ it_behaves_like "a federation"
244
+ it_behaves_like "a local source"
245
+
246
+ end
247
+
248
+ context "manually defined as a collection with local metadata" do
249
+
250
+ it_behaves_like "any source object"
251
+ it_behaves_like "a collection"
252
+ it_behaves_like "a local source"
253
+
254
+ end
255
+
256
+ context "manually defined as a collection with remote metadata" do
257
+
258
+ it_behaves_like "any source object"
259
+ it_behaves_like "a collection"
260
+ it_behaves_like "a remote source"
261
+ end
262
+
263
+ context "a collection loaded from the dev sourcefile" do
264
+
265
+ it_behaves_like "any source object"
266
+ it_behaves_like "a collection"
267
+
268
+ end
269
+
270
+ context "a federation loaded from the dev sourcefile" do
271
+
272
+ it_behaves_like "any source object"
273
+ it_behaves_like "a federation"
274
+
275
+ end
276
+
277
+ context "a collection loaded from the real sourcefile" do
278
+
279
+ it_behaves_like "any source object"
280
+ it_behaves_like "a collection"
281
+
282
+ end
283
+
284
+ context "a federation loaded from the real sourcefile" do
285
+
286
+ it_behaves_like "any source object"
287
+ it_behaves_like "a federation"
288
+
289
+ end
290
+
291
+
292
+
293
+
294
+ describe "Source#config" do
295
+
296
+ it ""
297
+ it ""
298
+
299
+ end
300
+
301
+
302
+ describe "Source#load" do
303
+
304
+ it ""
305
+ it ""
306
+
307
+ end
308
+
309
+
310
+ describe "Source#cache_options" do
311
+
312
+ it ""
313
+ it ""
314
+
315
+ end
316
+
317
+
318
+ describe "Source#environment" do
319
+
320
+ it ""
321
+ it ""
322
+
323
+ end
324
+
325
+
326
+ describe "Source#verbose?" do
327
+
328
+ it ""
329
+ it ""
330
+
331
+ end
332
+
333
+
334
+ describe "Source#auto_refresh" do
335
+
336
+ it ""
337
+ it ""
338
+
339
+ end
340
+
341
+
342
+ describe "Source#log_file" do
343
+
344
+ it ""
345
+ it ""
346
+
347
+ end
348
+
349
+ end
350
+
351
+ ## Must have an ID/URI before considered useful - various method should raise
352
+ # exceptions when object is unsuitable.
353
+