devise-async-stretch 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. checksums.yaml +15 -0
  2. data/.gitignore +14 -0
  3. data/.travis.yml +9 -0
  4. data/Gemfile +4 -0
  5. data/LICENSE.txt +22 -0
  6. data/README.md +31 -0
  7. data/Rakefile +12 -0
  8. data/devise-async-stretch.gemspec +29 -0
  9. data/lib/devise/async/stretch.rb +52 -0
  10. data/lib/devise/async/stretch/backend.rb +15 -0
  11. data/lib/devise/async/stretch/backend/base.rb +25 -0
  12. data/lib/devise/async/stretch/backend/sidekiq.rb +17 -0
  13. data/lib/devise/async/stretch/model.rb +49 -0
  14. data/lib/devise/async/stretch/version.rb +7 -0
  15. data/lib/devise/async/stretch/worker.rb +19 -0
  16. data/lib/generators/devise/async/stretch/install_generator.rb +25 -0
  17. data/lib/generators/templates/devise_async_stretch.rb +21 -0
  18. data/log/test.log +0 -0
  19. data/test/devise/async/stretch/backend/base_test.rb +41 -0
  20. data/test/devise/async/stretch/backend/sidekiq_test.rb +42 -0
  21. data/test/devise/async/stretch/backend_test.rb +25 -0
  22. data/test/devise/async/stretch/model_test.rb +27 -0
  23. data/test/devise/async/stretch/worker_test.rb +19 -0
  24. data/test/devise/async/stretch_test.rb +24 -0
  25. data/test/rails_app/.gitignore +16 -0
  26. data/test/rails_app/README.rdoc +28 -0
  27. data/test/rails_app/Rakefile +6 -0
  28. data/test/rails_app/app/assets/images/.keep +0 -0
  29. data/test/rails_app/app/assets/javascripts/application.js +16 -0
  30. data/test/rails_app/app/assets/stylesheets/application.css +15 -0
  31. data/test/rails_app/app/controllers/application_controller.rb +5 -0
  32. data/test/rails_app/app/controllers/concerns/.keep +0 -0
  33. data/test/rails_app/app/helpers/application_helper.rb +2 -0
  34. data/test/rails_app/app/mailers/.keep +0 -0
  35. data/test/rails_app/app/models/.keep +0 -0
  36. data/test/rails_app/app/models/concerns/.keep +0 -0
  37. data/test/rails_app/app/models/user.rb +5 -0
  38. data/test/rails_app/app/views/layouts/application.html.erb +14 -0
  39. data/test/rails_app/bin/bundle +3 -0
  40. data/test/rails_app/bin/rails +8 -0
  41. data/test/rails_app/bin/rake +8 -0
  42. data/test/rails_app/bin/spring +18 -0
  43. data/test/rails_app/config.ru +4 -0
  44. data/test/rails_app/config/application.rb +29 -0
  45. data/test/rails_app/config/boot.rb +4 -0
  46. data/test/rails_app/config/database.yml +25 -0
  47. data/test/rails_app/config/environment.rb +5 -0
  48. data/test/rails_app/config/environments/development.rb +37 -0
  49. data/test/rails_app/config/environments/production.rb +78 -0
  50. data/test/rails_app/config/environments/test.rb +39 -0
  51. data/test/rails_app/config/initializers/assets.rb +8 -0
  52. data/test/rails_app/config/initializers/backtrace_silencers.rb +7 -0
  53. data/test/rails_app/config/initializers/cookies_serializer.rb +3 -0
  54. data/test/rails_app/config/initializers/devise.rb +259 -0
  55. data/test/rails_app/config/initializers/devise_async_stretch.rb +21 -0
  56. data/test/rails_app/config/initializers/filter_parameter_logging.rb +4 -0
  57. data/test/rails_app/config/initializers/inflections.rb +16 -0
  58. data/test/rails_app/config/initializers/mime_types.rb +4 -0
  59. data/test/rails_app/config/initializers/session_store.rb +3 -0
  60. data/test/rails_app/config/initializers/wrap_parameters.rb +14 -0
  61. data/test/rails_app/config/locales/devise.en.yml +60 -0
  62. data/test/rails_app/config/locales/en.yml +23 -0
  63. data/test/rails_app/config/routes.rb +57 -0
  64. data/test/rails_app/config/secrets.yml +22 -0
  65. data/test/rails_app/db/migrate/20141227205721_devise_create_users.rb +42 -0
  66. data/test/rails_app/db/schema.rb +34 -0
  67. data/test/rails_app/db/seeds.rb +7 -0
  68. data/test/rails_app/lib/assets/.keep +0 -0
  69. data/test/rails_app/lib/tasks/.keep +0 -0
  70. data/test/rails_app/log/.keep +0 -0
  71. data/test/rails_app/public/404.html +67 -0
  72. data/test/rails_app/public/422.html +67 -0
  73. data/test/rails_app/public/500.html +66 -0
  74. data/test/rails_app/public/favicon.ico +0 -0
  75. data/test/rails_app/public/robots.txt +5 -0
  76. data/test/rails_app/test/controllers/.keep +0 -0
  77. data/test/rails_app/test/fixtures/.keep +0 -0
  78. data/test/rails_app/test/fixtures/users.yml +7 -0
  79. data/test/rails_app/test/helpers/.keep +0 -0
  80. data/test/rails_app/test/integration/.keep +0 -0
  81. data/test/rails_app/test/mailers/.keep +0 -0
  82. data/test/rails_app/test/models/.keep +0 -0
  83. data/test/rails_app/test/models/user_test.rb +32 -0
  84. data/test/rails_app/test/test_helper.rb +11 -0
  85. data/test/rails_app/vendor/assets/javascripts/.keep +0 -0
  86. data/test/rails_app/vendor/assets/stylesheets/.keep +0 -0
  87. data/test/test_helper.rb +56 -0
  88. metadata +298 -0
@@ -0,0 +1,11 @@
1
+ ENV['RAILS_ENV'] ||= 'test'
2
+ require File.expand_path('../../config/environment', __FILE__)
3
+ require 'rails/test_help'
4
+
5
+ class ActiveSupport::TestCase
6
+ # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
7
+ fixtures :all
8
+ self.use_transactional_fixtures = true
9
+
10
+ # Add more helper methods to be used by all tests here...
11
+ end
File without changes
File without changes
@@ -0,0 +1,56 @@
1
+ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
2
+ require "devise/async/stretch"
3
+
4
+ require "sidekiq"
5
+ require "sidekiq/testing"
6
+
7
+ # Load test/rails_app
8
+ ENV["RAILS_ENV"] = "test"
9
+
10
+ require File.expand_path("../rails_app/config/environment.rb", __FILE__)
11
+ require "rails/test_help"
12
+
13
+ Rails.backtrace_cleaner.remove_silencers!
14
+
15
+ # Load support files
16
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
17
+
18
+ # Load fixtures from the engine
19
+ ActiveSupport::TestCase.fixture_path = File.expand_path("../rails_app/test/fixtures", __FILE__)
20
+ ActionDispatch::IntegrationTest.fixture_path = ActiveSupport::TestCase.fixture_path
21
+
22
+ # Make ActiveRecord happy
23
+ ActiveRecord::Base.logger = Logger.new(nil)
24
+ ActiveRecord::Migration.verbose = false
25
+
26
+ ActiveRecord::Base.establish_connection(Rails.application.config.database_configuration[ENV['RAILS_ENV']])
27
+ ActiveRecord::Migrator.migrate(File.expand_path("../rails_app/db/migrate/", __FILE__))
28
+
29
+ class ActiveSupport::TestCase
30
+ include ActiveRecord::TestFixtures
31
+
32
+ setup do
33
+ Devise::Async::Stretch.enabled = true
34
+ Devise::Async::Stretch.backend = :sidekiq
35
+ end
36
+
37
+ fixtures :users
38
+
39
+ def create_test_table(name, &block)
40
+ with_migration { |m| m.create_table name, &block }
41
+ end
42
+
43
+ def drop_test_table(name, opts = {})
44
+ with_migration { |m| m.drop_table name, opts }
45
+ end
46
+
47
+ protected
48
+
49
+ def with_migration
50
+ ActiveRecord::Migration.tap do |m|
51
+ m.verbose = false
52
+ yield m
53
+ m.verbose = true
54
+ end
55
+ end
56
+ end
metadata ADDED
@@ -0,0 +1,298 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: devise-async-stretch
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Daniel Westendorf
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-12-29 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: devise
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ! '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ! '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '1.7'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '1.7'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rails
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 4.1.0
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: 4.1.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: mocha
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ~>
74
+ - !ruby/object:Gem::Version
75
+ version: '0.11'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ~>
81
+ - !ruby/object:Gem::Version
82
+ version: '0.11'
83
+ - !ruby/object:Gem::Dependency
84
+ name: sqlite3
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: sidekiq
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ! '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ! '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ description: Uncompromised security for your user's passwords. Move password stretching
112
+ into a background job for fast user creation, but maintainging safety.
113
+ email:
114
+ - daniel@prowestech.com
115
+ executables: []
116
+ extensions: []
117
+ extra_rdoc_files: []
118
+ files:
119
+ - .gitignore
120
+ - .travis.yml
121
+ - Gemfile
122
+ - LICENSE.txt
123
+ - README.md
124
+ - Rakefile
125
+ - devise-async-stretch.gemspec
126
+ - lib/devise/async/stretch.rb
127
+ - lib/devise/async/stretch/backend.rb
128
+ - lib/devise/async/stretch/backend/base.rb
129
+ - lib/devise/async/stretch/backend/sidekiq.rb
130
+ - lib/devise/async/stretch/model.rb
131
+ - lib/devise/async/stretch/version.rb
132
+ - lib/devise/async/stretch/worker.rb
133
+ - lib/generators/devise/async/stretch/install_generator.rb
134
+ - lib/generators/templates/devise_async_stretch.rb
135
+ - log/test.log
136
+ - test/devise/async/stretch/backend/base_test.rb
137
+ - test/devise/async/stretch/backend/sidekiq_test.rb
138
+ - test/devise/async/stretch/backend_test.rb
139
+ - test/devise/async/stretch/model_test.rb
140
+ - test/devise/async/stretch/worker_test.rb
141
+ - test/devise/async/stretch_test.rb
142
+ - test/rails_app/.gitignore
143
+ - test/rails_app/README.rdoc
144
+ - test/rails_app/Rakefile
145
+ - test/rails_app/app/assets/images/.keep
146
+ - test/rails_app/app/assets/javascripts/application.js
147
+ - test/rails_app/app/assets/stylesheets/application.css
148
+ - test/rails_app/app/controllers/application_controller.rb
149
+ - test/rails_app/app/controllers/concerns/.keep
150
+ - test/rails_app/app/helpers/application_helper.rb
151
+ - test/rails_app/app/mailers/.keep
152
+ - test/rails_app/app/models/.keep
153
+ - test/rails_app/app/models/concerns/.keep
154
+ - test/rails_app/app/models/user.rb
155
+ - test/rails_app/app/views/layouts/application.html.erb
156
+ - test/rails_app/bin/bundle
157
+ - test/rails_app/bin/rails
158
+ - test/rails_app/bin/rake
159
+ - test/rails_app/bin/spring
160
+ - test/rails_app/config.ru
161
+ - test/rails_app/config/application.rb
162
+ - test/rails_app/config/boot.rb
163
+ - test/rails_app/config/database.yml
164
+ - test/rails_app/config/environment.rb
165
+ - test/rails_app/config/environments/development.rb
166
+ - test/rails_app/config/environments/production.rb
167
+ - test/rails_app/config/environments/test.rb
168
+ - test/rails_app/config/initializers/assets.rb
169
+ - test/rails_app/config/initializers/backtrace_silencers.rb
170
+ - test/rails_app/config/initializers/cookies_serializer.rb
171
+ - test/rails_app/config/initializers/devise.rb
172
+ - test/rails_app/config/initializers/devise_async_stretch.rb
173
+ - test/rails_app/config/initializers/filter_parameter_logging.rb
174
+ - test/rails_app/config/initializers/inflections.rb
175
+ - test/rails_app/config/initializers/mime_types.rb
176
+ - test/rails_app/config/initializers/session_store.rb
177
+ - test/rails_app/config/initializers/wrap_parameters.rb
178
+ - test/rails_app/config/locales/devise.en.yml
179
+ - test/rails_app/config/locales/en.yml
180
+ - test/rails_app/config/routes.rb
181
+ - test/rails_app/config/secrets.yml
182
+ - test/rails_app/db/migrate/20141227205721_devise_create_users.rb
183
+ - test/rails_app/db/schema.rb
184
+ - test/rails_app/db/seeds.rb
185
+ - test/rails_app/lib/assets/.keep
186
+ - test/rails_app/lib/tasks/.keep
187
+ - test/rails_app/log/.keep
188
+ - test/rails_app/public/404.html
189
+ - test/rails_app/public/422.html
190
+ - test/rails_app/public/500.html
191
+ - test/rails_app/public/favicon.ico
192
+ - test/rails_app/public/robots.txt
193
+ - test/rails_app/test/controllers/.keep
194
+ - test/rails_app/test/fixtures/.keep
195
+ - test/rails_app/test/fixtures/users.yml
196
+ - test/rails_app/test/helpers/.keep
197
+ - test/rails_app/test/integration/.keep
198
+ - test/rails_app/test/mailers/.keep
199
+ - test/rails_app/test/models/.keep
200
+ - test/rails_app/test/models/user_test.rb
201
+ - test/rails_app/test/test_helper.rb
202
+ - test/rails_app/vendor/assets/javascripts/.keep
203
+ - test/rails_app/vendor/assets/stylesheets/.keep
204
+ - test/test_helper.rb
205
+ homepage: ''
206
+ licenses:
207
+ - MIT
208
+ metadata: {}
209
+ post_install_message:
210
+ rdoc_options: []
211
+ require_paths:
212
+ - lib
213
+ required_ruby_version: !ruby/object:Gem::Requirement
214
+ requirements:
215
+ - - ! '>='
216
+ - !ruby/object:Gem::Version
217
+ version: '0'
218
+ required_rubygems_version: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - ! '>='
221
+ - !ruby/object:Gem::Version
222
+ version: '0'
223
+ requirements: []
224
+ rubyforge_project:
225
+ rubygems_version: 2.4.5
226
+ signing_key:
227
+ specification_version: 4
228
+ summary: Move password stretching into a background job for fast user creation.
229
+ test_files:
230
+ - test/devise/async/stretch/backend/base_test.rb
231
+ - test/devise/async/stretch/backend/sidekiq_test.rb
232
+ - test/devise/async/stretch/backend_test.rb
233
+ - test/devise/async/stretch/model_test.rb
234
+ - test/devise/async/stretch/worker_test.rb
235
+ - test/devise/async/stretch_test.rb
236
+ - test/rails_app/.gitignore
237
+ - test/rails_app/README.rdoc
238
+ - test/rails_app/Rakefile
239
+ - test/rails_app/app/assets/images/.keep
240
+ - test/rails_app/app/assets/javascripts/application.js
241
+ - test/rails_app/app/assets/stylesheets/application.css
242
+ - test/rails_app/app/controllers/application_controller.rb
243
+ - test/rails_app/app/controllers/concerns/.keep
244
+ - test/rails_app/app/helpers/application_helper.rb
245
+ - test/rails_app/app/mailers/.keep
246
+ - test/rails_app/app/models/.keep
247
+ - test/rails_app/app/models/concerns/.keep
248
+ - test/rails_app/app/models/user.rb
249
+ - test/rails_app/app/views/layouts/application.html.erb
250
+ - test/rails_app/bin/bundle
251
+ - test/rails_app/bin/rails
252
+ - test/rails_app/bin/rake
253
+ - test/rails_app/bin/spring
254
+ - test/rails_app/config.ru
255
+ - test/rails_app/config/application.rb
256
+ - test/rails_app/config/boot.rb
257
+ - test/rails_app/config/database.yml
258
+ - test/rails_app/config/environment.rb
259
+ - test/rails_app/config/environments/development.rb
260
+ - test/rails_app/config/environments/production.rb
261
+ - test/rails_app/config/environments/test.rb
262
+ - test/rails_app/config/initializers/assets.rb
263
+ - test/rails_app/config/initializers/backtrace_silencers.rb
264
+ - test/rails_app/config/initializers/cookies_serializer.rb
265
+ - test/rails_app/config/initializers/devise.rb
266
+ - test/rails_app/config/initializers/devise_async_stretch.rb
267
+ - test/rails_app/config/initializers/filter_parameter_logging.rb
268
+ - test/rails_app/config/initializers/inflections.rb
269
+ - test/rails_app/config/initializers/mime_types.rb
270
+ - test/rails_app/config/initializers/session_store.rb
271
+ - test/rails_app/config/initializers/wrap_parameters.rb
272
+ - test/rails_app/config/locales/devise.en.yml
273
+ - test/rails_app/config/locales/en.yml
274
+ - test/rails_app/config/routes.rb
275
+ - test/rails_app/config/secrets.yml
276
+ - test/rails_app/db/migrate/20141227205721_devise_create_users.rb
277
+ - test/rails_app/db/schema.rb
278
+ - test/rails_app/db/seeds.rb
279
+ - test/rails_app/lib/assets/.keep
280
+ - test/rails_app/lib/tasks/.keep
281
+ - test/rails_app/log/.keep
282
+ - test/rails_app/public/404.html
283
+ - test/rails_app/public/422.html
284
+ - test/rails_app/public/500.html
285
+ - test/rails_app/public/favicon.ico
286
+ - test/rails_app/public/robots.txt
287
+ - test/rails_app/test/controllers/.keep
288
+ - test/rails_app/test/fixtures/.keep
289
+ - test/rails_app/test/fixtures/users.yml
290
+ - test/rails_app/test/helpers/.keep
291
+ - test/rails_app/test/integration/.keep
292
+ - test/rails_app/test/mailers/.keep
293
+ - test/rails_app/test/models/.keep
294
+ - test/rails_app/test/models/user_test.rb
295
+ - test/rails_app/test/test_helper.rb
296
+ - test/rails_app/vendor/assets/javascripts/.keep
297
+ - test/rails_app/vendor/assets/stylesheets/.keep
298
+ - test/test_helper.rb