scooter 0.0.0 → 3.2.19

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.
Files changed (47) hide show
  1. checksums.yaml +15 -0
  2. data/.env +5 -0
  3. data/.gitignore +47 -19
  4. data/Gemfile +3 -0
  5. data/HISTORY.md +1539 -0
  6. data/README.md +69 -10
  7. data/Rakefile +7 -0
  8. data/docs/http_dispatchers.md +79 -0
  9. data/lib/scooter.rb +11 -3
  10. data/lib/scooter/httpdispatchers.rb +12 -0
  11. data/lib/scooter/httpdispatchers/activity.rb +46 -0
  12. data/lib/scooter/httpdispatchers/activity/v1/v1.rb +50 -0
  13. data/lib/scooter/httpdispatchers/classifier.rb +376 -0
  14. data/lib/scooter/httpdispatchers/classifier/v1/v1.rb +99 -0
  15. data/lib/scooter/httpdispatchers/code_manager.rb +31 -0
  16. data/lib/scooter/httpdispatchers/code_manager/v1/v1.rb +17 -0
  17. data/lib/scooter/httpdispatchers/consoledispatcher.rb +132 -0
  18. data/lib/scooter/httpdispatchers/httpdispatcher.rb +168 -0
  19. data/lib/scooter/httpdispatchers/orchestrator/v1/v1.rb +87 -0
  20. data/lib/scooter/httpdispatchers/orchestratordispatcher.rb +83 -0
  21. data/lib/scooter/httpdispatchers/puppetdb/v4/v4.rb +51 -0
  22. data/lib/scooter/httpdispatchers/puppetdbdispatcher.rb +390 -0
  23. data/lib/scooter/httpdispatchers/rbac.rb +231 -0
  24. data/lib/scooter/httpdispatchers/rbac/v1/directory_service.rb +68 -0
  25. data/lib/scooter/httpdispatchers/rbac/v1/v1.rb +116 -0
  26. data/lib/scooter/ldap.rb +349 -0
  27. data/lib/scooter/ldap/ldap_fixtures.rb +60 -0
  28. data/lib/scooter/middleware/rbac_auth_token.rb +35 -0
  29. data/lib/scooter/utilities.rb +9 -0
  30. data/lib/scooter/utilities/beaker_utilities.rb +41 -0
  31. data/lib/scooter/utilities/string_utilities.rb +32 -0
  32. data/lib/scooter/version.rb +3 -1
  33. data/scooter.gemspec +23 -6
  34. data/spec/scooter/beaker_utilities_spec.rb +53 -0
  35. data/spec/scooter/httpdispatchers/activity/activity_spec.rb +218 -0
  36. data/spec/scooter/httpdispatchers/classifier/classifier_spec.rb +542 -0
  37. data/spec/scooter/httpdispatchers/code_manager/code-manager_spec.rb +67 -0
  38. data/spec/scooter/httpdispatchers/consoledispatcher_spec.rb +80 -0
  39. data/spec/scooter/httpdispatchers/httpdispatcher_spec.rb +91 -0
  40. data/spec/scooter/httpdispatchers/middleware/rbac_auth_token_spec.rb +58 -0
  41. data/spec/scooter/httpdispatchers/orchestratordispatcher_spec.rb +195 -0
  42. data/spec/scooter/httpdispatchers/puppetdbdispatcher_spec.rb +246 -0
  43. data/spec/scooter/httpdispatchers/rbac/rbac_spec.rb +387 -0
  44. data/spec/scooter/string_utilities_spec.rb +83 -0
  45. data/spec/spec_helper.rb +8 -0
  46. metadata +270 -18
  47. data/LICENSE.txt +0 -15
@@ -0,0 +1,83 @@
1
+ require 'spec_helper'
2
+
3
+ describe Scooter::Utilities::StringUtilities::RandomString do
4
+ describe '.generate' do
5
+ context 'no arguements supplied' do
6
+
7
+ it 'should generate a string 32 chars in length' do
8
+ expect(described_class.generate).to be_a(String)
9
+ expect(described_class.generate.length).to eq(32)
10
+ end
11
+
12
+ end
13
+ context 'valid arguement' do
14
+
15
+ it 'should generate' do
16
+ expect(described_class.generate(78)).to be_a(String)
17
+ expect(described_class.generate(78).length).to eq(78)
18
+ end
19
+
20
+ end
21
+ end
22
+ end
23
+
24
+ describe Scooter::Utilities::StringUtilities::RandomTwoByteUnicodeString do
25
+ describe '.generate' do
26
+ context 'no arguements supplied' do
27
+
28
+ it 'is encoded in utf-8' do
29
+ expect(described_class.generate.encoding.to_s).to eq('UTF-8')
30
+ end
31
+
32
+ it 'all characters should be two bytes' do
33
+ described_class.generate.each_char do |c|
34
+ expect(c.bytesize).to eq(2)
35
+ end
36
+ end
37
+
38
+ it 'string returned is 32 chars long' do
39
+ expect(described_class.generate.length).to eq(32)
40
+ end
41
+
42
+ end
43
+ context 'valid arguement' do
44
+
45
+ it 'should return a string of the correct length' do
46
+ length = 99
47
+ expect(described_class.generate(length).length).to eq(length)
48
+ end
49
+
50
+ end
51
+
52
+ end
53
+ end
54
+
55
+ describe Scooter::Utilities::StringUtilities::RandomHighbitString do
56
+ describe '.generate' do
57
+ context 'no arguements supplied' do
58
+
59
+ it 'is encoded in ASCII-8BIT' do
60
+ expect(described_class.generate.encoding.to_s).to eq('ASCII-8BIT')
61
+ end
62
+
63
+ it 'all characters should be one byte' do
64
+ described_class.generate.each_char do |c|
65
+ expect(c.bytesize).to eq(1)
66
+ end
67
+ end
68
+
69
+ it 'string returned is 32 chars long' do
70
+ expect(described_class.generate.length).to eq(32)
71
+ end
72
+
73
+ end
74
+ context 'valid arguement' do
75
+
76
+ it 'should return a string of the correct length' do
77
+ length = 99
78
+ expect(described_class.generate(length).length).to eq(length)
79
+ end
80
+
81
+ end
82
+ end
83
+ end
@@ -0,0 +1,8 @@
1
+ require 'scooter'
2
+ RSpec.configure do |c|
3
+
4
+ end
5
+
6
+ def random_string
7
+ (0...10).map { ('a'..'z').to_a[rand(26)] }.join
8
+ end
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scooter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
5
- prerelease:
4
+ version: 3.2.19
6
5
  platform: ruby
7
6
  authors:
8
7
  - Puppetlabs
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-11-18 00:00:00.000000000 Z
11
+ date: 2016-10-26 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: bundler
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
@@ -22,15 +20,27 @@ dependencies:
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
29
26
  version: '1.6'
27
+ - !ruby/object:Gem::Dependency
28
+ name: pry
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: 0.9.12
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: 0.9.12
30
41
  - !ruby/object:Gem::Dependency
31
42
  name: rake
32
43
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
44
  requirements:
35
45
  - - ! '>='
36
46
  - !ruby/object:Gem::Version
@@ -38,50 +48,292 @@ dependencies:
38
48
  type: :development
39
49
  prerelease: false
40
50
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
51
  requirements:
43
52
  - - ! '>='
44
53
  - !ruby/object:Gem::Version
45
54
  version: '0'
46
- description: Puppetlabs testing tool
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: 3.0.0
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ! '>='
67
+ - !ruby/object:Gem::Version
68
+ version: 3.0.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: yard
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ~>
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ~>
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: markdown
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ~>
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ~>
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: activesupport
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - '='
102
+ - !ruby/object:Gem::Version
103
+ version: 4.2.6
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - '='
109
+ - !ruby/object:Gem::Version
110
+ version: 4.2.6
111
+ - !ruby/object:Gem::Dependency
112
+ name: json
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ~>
116
+ - !ruby/object:Gem::Version
117
+ version: '1.8'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ~>
123
+ - !ruby/object:Gem::Version
124
+ version: '1.8'
125
+ - !ruby/object:Gem::Dependency
126
+ name: test-unit
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ! '>='
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ! '>='
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: net-ldap
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ~>
144
+ - !ruby/object:Gem::Version
145
+ version: '0.6'
146
+ - - ! '>='
147
+ - !ruby/object:Gem::Version
148
+ version: 0.6.1
149
+ - - <=
150
+ - !ruby/object:Gem::Version
151
+ version: 0.12.1
152
+ type: :runtime
153
+ prerelease: false
154
+ version_requirements: !ruby/object:Gem::Requirement
155
+ requirements:
156
+ - - ~>
157
+ - !ruby/object:Gem::Version
158
+ version: '0.6'
159
+ - - ! '>='
160
+ - !ruby/object:Gem::Version
161
+ version: 0.6.1
162
+ - - <=
163
+ - !ruby/object:Gem::Version
164
+ version: 0.12.1
165
+ - !ruby/object:Gem::Dependency
166
+ name: beaker
167
+ requirement: !ruby/object:Gem::Requirement
168
+ requirements:
169
+ - - ! '>='
170
+ - !ruby/object:Gem::Version
171
+ version: 2.1.0
172
+ type: :runtime
173
+ prerelease: false
174
+ version_requirements: !ruby/object:Gem::Requirement
175
+ requirements:
176
+ - - ! '>='
177
+ - !ruby/object:Gem::Version
178
+ version: 2.1.0
179
+ - !ruby/object:Gem::Dependency
180
+ name: faraday
181
+ requirement: !ruby/object:Gem::Requirement
182
+ requirements:
183
+ - - ~>
184
+ - !ruby/object:Gem::Version
185
+ version: '0.9'
186
+ - - ! '>='
187
+ - !ruby/object:Gem::Version
188
+ version: 0.9.1
189
+ type: :runtime
190
+ prerelease: false
191
+ version_requirements: !ruby/object:Gem::Requirement
192
+ requirements:
193
+ - - ~>
194
+ - !ruby/object:Gem::Version
195
+ version: '0.9'
196
+ - - ! '>='
197
+ - !ruby/object:Gem::Version
198
+ version: 0.9.1
199
+ - !ruby/object:Gem::Dependency
200
+ name: faraday_middleware
201
+ requirement: !ruby/object:Gem::Requirement
202
+ requirements:
203
+ - - ~>
204
+ - !ruby/object:Gem::Version
205
+ version: '0.9'
206
+ type: :runtime
207
+ prerelease: false
208
+ version_requirements: !ruby/object:Gem::Requirement
209
+ requirements:
210
+ - - ~>
211
+ - !ruby/object:Gem::Version
212
+ version: '0.9'
213
+ - !ruby/object:Gem::Dependency
214
+ name: faraday-cookie_jar
215
+ requirement: !ruby/object:Gem::Requirement
216
+ requirements:
217
+ - - ~>
218
+ - !ruby/object:Gem::Version
219
+ version: '0.0'
220
+ - - ! '>='
221
+ - !ruby/object:Gem::Version
222
+ version: 0.0.6
223
+ type: :runtime
224
+ prerelease: false
225
+ version_requirements: !ruby/object:Gem::Requirement
226
+ requirements:
227
+ - - ~>
228
+ - !ruby/object:Gem::Version
229
+ version: '0.0'
230
+ - - ! '>='
231
+ - !ruby/object:Gem::Version
232
+ version: 0.0.6
233
+ - !ruby/object:Gem::Dependency
234
+ name: nokogiri
235
+ requirement: !ruby/object:Gem::Requirement
236
+ requirements:
237
+ - - ~>
238
+ - !ruby/object:Gem::Version
239
+ version: '1.5'
240
+ - - ! '>='
241
+ - !ruby/object:Gem::Version
242
+ version: 1.5.10
243
+ type: :runtime
244
+ prerelease: false
245
+ version_requirements: !ruby/object:Gem::Requirement
246
+ requirements:
247
+ - - ~>
248
+ - !ruby/object:Gem::Version
249
+ version: '1.5'
250
+ - - ! '>='
251
+ - !ruby/object:Gem::Version
252
+ version: 1.5.10
253
+ description: Puppetlabs testing tool coupled with Beaker
47
254
  email:
48
255
  - qa@puppetlabs.com
49
256
  executables: []
50
257
  extensions: []
51
258
  extra_rdoc_files: []
52
259
  files:
260
+ - .env
53
261
  - .gitignore
54
262
  - Gemfile
55
- - LICENSE.txt
263
+ - HISTORY.md
56
264
  - README.md
57
265
  - Rakefile
266
+ - docs/http_dispatchers.md
58
267
  - lib/scooter.rb
268
+ - lib/scooter/httpdispatchers.rb
269
+ - lib/scooter/httpdispatchers/activity.rb
270
+ - lib/scooter/httpdispatchers/activity/v1/v1.rb
271
+ - lib/scooter/httpdispatchers/classifier.rb
272
+ - lib/scooter/httpdispatchers/classifier/v1/v1.rb
273
+ - lib/scooter/httpdispatchers/code_manager.rb
274
+ - lib/scooter/httpdispatchers/code_manager/v1/v1.rb
275
+ - lib/scooter/httpdispatchers/consoledispatcher.rb
276
+ - lib/scooter/httpdispatchers/httpdispatcher.rb
277
+ - lib/scooter/httpdispatchers/orchestrator/v1/v1.rb
278
+ - lib/scooter/httpdispatchers/orchestratordispatcher.rb
279
+ - lib/scooter/httpdispatchers/puppetdb/v4/v4.rb
280
+ - lib/scooter/httpdispatchers/puppetdbdispatcher.rb
281
+ - lib/scooter/httpdispatchers/rbac.rb
282
+ - lib/scooter/httpdispatchers/rbac/v1/directory_service.rb
283
+ - lib/scooter/httpdispatchers/rbac/v1/v1.rb
284
+ - lib/scooter/ldap.rb
285
+ - lib/scooter/ldap/ldap_fixtures.rb
286
+ - lib/scooter/middleware/rbac_auth_token.rb
287
+ - lib/scooter/utilities.rb
288
+ - lib/scooter/utilities/beaker_utilities.rb
289
+ - lib/scooter/utilities/string_utilities.rb
59
290
  - lib/scooter/version.rb
60
291
  - scooter.gemspec
61
- homepage: ''
62
- licenses:
63
- - Apache2
292
+ - spec/scooter/beaker_utilities_spec.rb
293
+ - spec/scooter/httpdispatchers/activity/activity_spec.rb
294
+ - spec/scooter/httpdispatchers/classifier/classifier_spec.rb
295
+ - spec/scooter/httpdispatchers/code_manager/code-manager_spec.rb
296
+ - spec/scooter/httpdispatchers/consoledispatcher_spec.rb
297
+ - spec/scooter/httpdispatchers/httpdispatcher_spec.rb
298
+ - spec/scooter/httpdispatchers/middleware/rbac_auth_token_spec.rb
299
+ - spec/scooter/httpdispatchers/orchestratordispatcher_spec.rb
300
+ - spec/scooter/httpdispatchers/puppetdbdispatcher_spec.rb
301
+ - spec/scooter/httpdispatchers/rbac/rbac_spec.rb
302
+ - spec/scooter/string_utilities_spec.rb
303
+ - spec/spec_helper.rb
304
+ homepage: https://github.com/puppetlabs/scooter
305
+ licenses: []
306
+ metadata: {}
64
307
  post_install_message:
65
308
  rdoc_options: []
66
309
  require_paths:
67
310
  - lib
68
311
  required_ruby_version: !ruby/object:Gem::Requirement
69
- none: false
70
312
  requirements:
71
313
  - - ! '>='
72
314
  - !ruby/object:Gem::Version
73
315
  version: '0'
74
316
  required_rubygems_version: !ruby/object:Gem::Requirement
75
- none: false
76
317
  requirements:
77
318
  - - ! '>='
78
319
  - !ruby/object:Gem::Version
79
320
  version: '0'
80
321
  requirements: []
81
322
  rubyforge_project:
82
- rubygems_version: 1.8.23
323
+ rubygems_version: 2.4.6
83
324
  signing_key:
84
- specification_version: 3
325
+ specification_version: 4
85
326
  summary: Puppetlabs testing tool
86
- test_files: []
87
- has_rdoc:
327
+ test_files:
328
+ - spec/scooter/beaker_utilities_spec.rb
329
+ - spec/scooter/httpdispatchers/activity/activity_spec.rb
330
+ - spec/scooter/httpdispatchers/classifier/classifier_spec.rb
331
+ - spec/scooter/httpdispatchers/code_manager/code-manager_spec.rb
332
+ - spec/scooter/httpdispatchers/consoledispatcher_spec.rb
333
+ - spec/scooter/httpdispatchers/httpdispatcher_spec.rb
334
+ - spec/scooter/httpdispatchers/middleware/rbac_auth_token_spec.rb
335
+ - spec/scooter/httpdispatchers/orchestratordispatcher_spec.rb
336
+ - spec/scooter/httpdispatchers/puppetdbdispatcher_spec.rb
337
+ - spec/scooter/httpdispatchers/rbac/rbac_spec.rb
338
+ - spec/scooter/string_utilities_spec.rb
339
+ - spec/spec_helper.rb
data/LICENSE.txt DELETED
@@ -1,15 +0,0 @@
1
- Copyright (C) 2011-2013 Puppet Labs Inc
2
-
3
- Puppet Labs can be contacted at: info@puppetlabs.com
4
-
5
- Licensed under the Apache License, Version 2.0 (the "License");
6
- you may not use this file except in compliance with the License.
7
- You may obtain a copy of the License at
8
-
9
- http://www.apache.org/licenses/LICENSE-2.0
10
-
11
- Unless required by applicable law or agreed to in writing, software
12
- distributed under the License is distributed on an "AS IS" BASIS,
13
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- See the License for the specific language governing permissions and
15
- limitations under the License.