right_support 2.6.17 → 2.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. data/.rspec +4 -0
  2. data/CHANGELOG.rdoc +37 -0
  3. data/Gemfile +29 -0
  4. data/Gemfile.lock +111 -0
  5. data/README.rdoc +2 -0
  6. data/Rakefile +62 -0
  7. data/VERSION +1 -0
  8. data/features/balancer_error_handling.feature +34 -0
  9. data/features/balancer_health_check.feature +33 -0
  10. data/features/continuous_integration.feature +51 -0
  11. data/features/continuous_integration_cucumber.feature +28 -0
  12. data/features/continuous_integration_rspec1.feature +28 -0
  13. data/features/continuous_integration_rspec2.feature +28 -0
  14. data/features/http_client_timeout.feature +19 -0
  15. data/features/serialization.feature +95 -0
  16. data/features/step_definitions/http_client_steps.rb +27 -0
  17. data/features/step_definitions/request_balancer_steps.rb +93 -0
  18. data/features/step_definitions/ruby_steps.rb +176 -0
  19. data/features/step_definitions/serialization_steps.rb +96 -0
  20. data/features/step_definitions/server_steps.rb +134 -0
  21. data/features/support/env.rb +138 -0
  22. data/features/support/file_utils_bundler_mixin.rb +45 -0
  23. data/lib/right_support/ci/java_cucumber_formatter.rb +22 -8
  24. data/lib/right_support/ci/java_spec_formatter.rb +26 -8
  25. data/lib/right_support/ci/rake_task.rb +3 -0
  26. data/lib/right_support/ci.rb +24 -0
  27. data/lib/right_support/crypto/signed_hash.rb +22 -0
  28. data/lib/right_support/data/serializer.rb +24 -2
  29. data/lib/right_support/net/address_helper.rb +20 -8
  30. data/lib/right_support/net/dns.rb +20 -8
  31. data/lib/right_support/net/http_client.rb +22 -0
  32. data/lib/right_support/net/request_balancer.rb +27 -21
  33. data/lib/right_support/net/s3_helper.rb +20 -8
  34. data/lib/right_support/net/ssl/open_ssl_patch.rb +22 -0
  35. data/lib/right_support/net/ssl.rb +20 -8
  36. data/lib/right_support/ruby/easy_singleton.rb +22 -0
  37. data/lib/right_support/ruby/object_extensions.rb +22 -0
  38. data/lib/right_support/ruby/string_extensions.rb +1 -1
  39. data/lib/right_support.rb +13 -10
  40. data/right_support.gemspec +180 -18
  41. data/right_support.rconf +8 -0
  42. data/spec/config/feature_set_spec.rb +83 -0
  43. data/spec/crypto/signed_hash_spec.rb +60 -0
  44. data/spec/data/hash_tools_spec.rb +471 -0
  45. data/spec/data/uuid_spec.rb +45 -0
  46. data/spec/db/cassandra_model_part1_spec.rb +84 -0
  47. data/spec/db/cassandra_model_part2_spec.rb +73 -0
  48. data/spec/db/cassandra_model_spec.rb +359 -0
  49. data/spec/fixtures/encrypted_priv_rsa.pem +30 -0
  50. data/spec/fixtures/good_priv_dsa.pem +12 -0
  51. data/spec/fixtures/good_priv_rsa.pem +15 -0
  52. data/spec/fixtures/good_pub_dsa.ssh +1 -0
  53. data/spec/fixtures/good_pub_rsa.pem +5 -0
  54. data/spec/fixtures/good_pub_rsa.ssh +1 -0
  55. data/spec/log/exception_logger_spec.rb +76 -0
  56. data/spec/log/filter_logger_spec.rb +8 -0
  57. data/spec/log/mixin_spec.rb +62 -0
  58. data/spec/log/multiplexer_spec.rb +54 -0
  59. data/spec/log/null_logger_spec.rb +36 -0
  60. data/spec/log/system_logger_spec.rb +92 -0
  61. data/spec/net/address_helper_spec.rb +57 -0
  62. data/spec/net/balancing/health_check_spec.rb +382 -0
  63. data/spec/net/balancing/round_robin_spec.rb +15 -0
  64. data/spec/net/balancing/sticky_policy_spec.rb +92 -0
  65. data/spec/net/dns_spec.rb +152 -0
  66. data/spec/net/http_client_spec.rb +171 -0
  67. data/spec/net/request_balancer_spec.rb +579 -0
  68. data/spec/net/s3_helper_spec.rb +160 -0
  69. data/spec/net/ssl_spec.rb +42 -0
  70. data/spec/net/string_encoder_spec.rb +58 -0
  71. data/spec/rack/log_setter_spec.rb +5 -0
  72. data/spec/rack/request_logger_spec.rb +68 -0
  73. data/spec/rack/request_tracker_spec.rb +5 -0
  74. data/spec/ruby/easy_singleton_spec.rb +72 -0
  75. data/spec/ruby/object_extensions_spec.rb +27 -0
  76. data/spec/ruby/string_extensions_spec.rb +98 -0
  77. data/spec/spec_helper.rb +181 -0
  78. data/spec/stats/activity_spec.rb +193 -0
  79. data/spec/stats/exceptions_spec.rb +123 -0
  80. data/spec/stats/helpers_spec.rb +603 -0
  81. data/spec/validation/openssl_spec.rb +37 -0
  82. data/spec/validation/ssh_spec.rb +39 -0
  83. metadata +218 -19
@@ -0,0 +1,39 @@
1
+ require 'spec_helper'
2
+
3
+ describe RightSupport::Validation::SSH do
4
+ GOOD_PEM_PRIV_RSA = read_fixture('good_priv_rsa.pem')
5
+ GOOD_ENCRYPTED_PEM_PRIV_RSA = read_fixture('encrypted_priv_rsa.pem')
6
+ GOOD_SSH_PUB_RSA = read_fixture('good_pub_rsa.ssh')
7
+ GOOD_SSH_PUB_DSA = read_fixture('good_pub_dsa.ssh')
8
+ GOOD_PEM_PRIV_DSA = read_fixture('good_priv_dsa.pem')
9
+
10
+ context :ssh_private_key? do
11
+ it 'recognizes valid keys' do
12
+ RightSupport::Validation.ssh_private_key?(GOOD_PEM_PRIV_RSA).should == true
13
+ RightSupport::Validation.ssh_private_key?(GOOD_PEM_PRIV_DSA).should == true
14
+ end
15
+ it 'considers encrypted keys to be "bad" (not usable)' do
16
+ RightSupport::Validation.ssh_private_key?(GOOD_ENCRYPTED_PEM_PRIV_RSA).should == false
17
+ end
18
+ it 'recognizes bad keys' do
19
+ RightSupport::Validation.ssh_private_key?(corrupt(GOOD_PEM_PRIV_RSA)).should == false
20
+ RightSupport::Validation.ssh_private_key?(corrupt(GOOD_PEM_PRIV_RSA, 16)).should == false
21
+ RightSupport::Validation.ssh_private_key?(nil).should == false
22
+ RightSupport::Validation.ssh_private_key?('').should == false
23
+ end
24
+ end
25
+
26
+ context :ssh_public_key? do
27
+ it 'recognizes valid keys' do
28
+ RightSupport::Validation.ssh_public_key?(GOOD_SSH_PUB_RSA).should == true
29
+ end
30
+ it 'recognizes bad keys' do
31
+ RightSupport::Validation.ssh_public_key?('ssh-rsa AAAAB3Nhowdybob').should == false
32
+ RightSupport::Validation.ssh_public_key?('ssh-rsa hello there').should == false
33
+ RightSupport::Validation.ssh_public_key?('ssh-rsa one two three! user@host').should == false
34
+ RightSupport::Validation.ssh_public_key?('fafafafafafa mumumumumumu').should == false
35
+ RightSupport::Validation.ssh_public_key?(nil).should == false
36
+ RightSupport::Validation.ssh_public_key?('').should == false
37
+ end
38
+ end
39
+ end
metadata CHANGED
@@ -1,41 +1,200 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: right_support
3
3
  version: !ruby/object:Gem::Version
4
- hash: 53
5
- prerelease: false
4
+ hash: 19
5
+ prerelease:
6
6
  segments:
7
7
  - 2
8
- - 6
9
- - 17
10
- version: 2.6.17
8
+ - 7
9
+ - 0
10
+ version: 2.7.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Tony Spataro
14
14
  - Sergey Sergyenko
15
15
  - Ryan Williamson
16
16
  - Lee Kirchhoff
17
- - Sergey Enin
18
17
  - Alexey Karpik
19
18
  - Scott Messier
20
19
  autorequire:
21
20
  bindir: bin
22
21
  cert_chain: []
23
22
 
24
- date: 2013-01-29 00:00:00 -08:00
23
+ date: 2013-04-26 00:00:00 -07:00
25
24
  default_executable:
26
- dependencies: []
27
-
25
+ dependencies:
26
+ - !ruby/object:Gem::Dependency
27
+ requirement: &id001 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ~>
31
+ - !ruby/object:Gem::Version
32
+ hash: 25
33
+ segments:
34
+ - 0
35
+ - 9
36
+ version: "0.9"
37
+ type: :development
38
+ name: rake
39
+ version_requirements: *id001
40
+ prerelease: false
41
+ - !ruby/object:Gem::Dependency
42
+ requirement: &id002 !ruby/object:Gem::Requirement
43
+ none: false
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ hash: 49
48
+ segments:
49
+ - 1
50
+ - 8
51
+ - 3
52
+ version: 1.8.3
53
+ type: :development
54
+ name: jeweler
55
+ version_requirements: *id002
56
+ prerelease: false
57
+ - !ruby/object:Gem::Dependency
58
+ requirement: &id003 !ruby/object:Gem::Requirement
59
+ none: false
60
+ requirements:
61
+ - - ~>
62
+ - !ruby/object:Gem::Version
63
+ hash: 15
64
+ segments:
65
+ - 1
66
+ - 0
67
+ version: "1.0"
68
+ type: :development
69
+ name: right_develop
70
+ version_requirements: *id003
71
+ prerelease: false
72
+ - !ruby/object:Gem::Dependency
73
+ requirement: &id004 !ruby/object:Gem::Requirement
74
+ none: false
75
+ requirements:
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ hash: 31
79
+ segments:
80
+ - 0
81
+ - 10
82
+ version: "0.10"
83
+ type: :development
84
+ name: ruby-debug
85
+ version_requirements: *id004
86
+ prerelease: false
87
+ - !ruby/object:Gem::Dependency
88
+ requirement: &id005 !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ">="
92
+ - !ruby/object:Gem::Version
93
+ hash: 63
94
+ segments:
95
+ - 0
96
+ - 11
97
+ - 6
98
+ version: 0.11.6
99
+ type: :development
100
+ name: ruby-debug19
101
+ version_requirements: *id005
102
+ prerelease: false
103
+ - !ruby/object:Gem::Dependency
104
+ requirement: &id006 !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ hash: 27
110
+ segments:
111
+ - 2
112
+ - 4
113
+ - 2
114
+ version: 2.4.2
115
+ type: :development
116
+ name: rdoc
117
+ version_requirements: *id006
118
+ prerelease: false
119
+ - !ruby/object:Gem::Dependency
120
+ requirement: &id007 !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ~>
124
+ - !ruby/object:Gem::Version
125
+ hash: 27
126
+ segments:
127
+ - 0
128
+ - 8
129
+ version: "0.8"
130
+ type: :development
131
+ name: flexmock
132
+ version_requirements: *id007
133
+ prerelease: false
134
+ - !ruby/object:Gem::Dependency
135
+ requirement: &id008 !ruby/object:Gem::Requirement
136
+ none: false
137
+ requirements:
138
+ - - ~>
139
+ - !ruby/object:Gem::Version
140
+ hash: 23
141
+ segments:
142
+ - 1
143
+ - 0
144
+ - 0
145
+ version: 1.0.0
146
+ type: :development
147
+ name: syntax
148
+ version_requirements: *id008
149
+ prerelease: false
150
+ - !ruby/object:Gem::Dependency
151
+ requirement: &id009 !ruby/object:Gem::Requirement
152
+ none: false
153
+ requirements:
154
+ - - ~>
155
+ - !ruby/object:Gem::Version
156
+ hash: 5
157
+ segments:
158
+ - 1
159
+ - 5
160
+ version: "1.5"
161
+ type: :development
162
+ name: nokogiri
163
+ version_requirements: *id009
164
+ prerelease: false
28
165
  description: A toolkit of useful, reusable foundation code created by RightScale.
29
166
  email: support@rightscale.com
30
167
  executables: []
31
168
 
32
169
  extensions: []
33
170
 
34
- extra_rdoc_files: []
35
-
171
+ extra_rdoc_files:
172
+ - LICENSE
173
+ - README.rdoc
36
174
  files:
175
+ - .rspec
176
+ - CHANGELOG.rdoc
177
+ - Gemfile
178
+ - Gemfile.lock
37
179
  - LICENSE
38
180
  - README.rdoc
181
+ - Rakefile
182
+ - VERSION
183
+ - features/balancer_error_handling.feature
184
+ - features/balancer_health_check.feature
185
+ - features/continuous_integration.feature
186
+ - features/continuous_integration_cucumber.feature
187
+ - features/continuous_integration_rspec1.feature
188
+ - features/continuous_integration_rspec2.feature
189
+ - features/http_client_timeout.feature
190
+ - features/serialization.feature
191
+ - features/step_definitions/http_client_steps.rb
192
+ - features/step_definitions/request_balancer_steps.rb
193
+ - features/step_definitions/ruby_steps.rb
194
+ - features/step_definitions/serialization_steps.rb
195
+ - features/step_definitions/server_steps.rb
196
+ - features/support/env.rb
197
+ - features/support/file_utils_bundler_mixin.rb
39
198
  - lib/right_support.rb
40
199
  - lib/right_support/ci.rb
41
200
  - lib/right_support/ci/java_cucumber_formatter.rb
@@ -89,10 +248,52 @@ files:
89
248
  - lib/right_support/validation/openssl.rb
90
249
  - lib/right_support/validation/ssh.rb
91
250
  - right_support.gemspec
251
+ - right_support.rconf
252
+ - spec/config/feature_set_spec.rb
253
+ - spec/crypto/signed_hash_spec.rb
254
+ - spec/data/hash_tools_spec.rb
255
+ - spec/data/uuid_spec.rb
256
+ - spec/db/cassandra_model_part1_spec.rb
257
+ - spec/db/cassandra_model_part2_spec.rb
258
+ - spec/db/cassandra_model_spec.rb
259
+ - spec/fixtures/encrypted_priv_rsa.pem
260
+ - spec/fixtures/good_priv_dsa.pem
261
+ - spec/fixtures/good_priv_rsa.pem
262
+ - spec/fixtures/good_pub_dsa.ssh
263
+ - spec/fixtures/good_pub_rsa.pem
264
+ - spec/fixtures/good_pub_rsa.ssh
265
+ - spec/log/exception_logger_spec.rb
266
+ - spec/log/filter_logger_spec.rb
267
+ - spec/log/mixin_spec.rb
268
+ - spec/log/multiplexer_spec.rb
269
+ - spec/log/null_logger_spec.rb
270
+ - spec/log/system_logger_spec.rb
271
+ - spec/net/address_helper_spec.rb
272
+ - spec/net/balancing/health_check_spec.rb
273
+ - spec/net/balancing/round_robin_spec.rb
274
+ - spec/net/balancing/sticky_policy_spec.rb
275
+ - spec/net/dns_spec.rb
276
+ - spec/net/http_client_spec.rb
277
+ - spec/net/request_balancer_spec.rb
278
+ - spec/net/s3_helper_spec.rb
279
+ - spec/net/ssl_spec.rb
280
+ - spec/net/string_encoder_spec.rb
281
+ - spec/rack/log_setter_spec.rb
282
+ - spec/rack/request_logger_spec.rb
283
+ - spec/rack/request_tracker_spec.rb
284
+ - spec/ruby/easy_singleton_spec.rb
285
+ - spec/ruby/object_extensions_spec.rb
286
+ - spec/ruby/string_extensions_spec.rb
287
+ - spec/spec_helper.rb
288
+ - spec/stats/activity_spec.rb
289
+ - spec/stats/exceptions_spec.rb
290
+ - spec/stats/helpers_spec.rb
291
+ - spec/validation/openssl_spec.rb
292
+ - spec/validation/ssh_spec.rb
92
293
  has_rdoc: true
93
294
  homepage: https://github.com/rightscale/right_support
94
- licenses: []
95
-
295
+ licenses:
296
+ - MIT
96
297
  post_install_message:
97
298
  rdoc_options: []
98
299
 
@@ -103,12 +304,10 @@ required_ruby_version: !ruby/object:Gem::Requirement
103
304
  requirements:
104
305
  - - ">="
105
306
  - !ruby/object:Gem::Version
106
- hash: 57
307
+ hash: 3
107
308
  segments:
108
- - 1
109
- - 8
110
- - 7
111
- version: 1.8.7
309
+ - 0
310
+ version: "0"
112
311
  required_rubygems_version: !ruby/object:Gem::Requirement
113
312
  none: false
114
313
  requirements:
@@ -121,7 +320,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
320
  requirements: []
122
321
 
123
322
  rubyforge_project:
124
- rubygems_version: 1.3.7
323
+ rubygems_version: 1.6.2
125
324
  signing_key:
126
325
  specification_version: 3
127
326
  summary: Reusable foundation code.