sorcery 0.1.1 → 0.2.0

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 (75) hide show
  1. data/Gemfile +4 -3
  2. data/Gemfile.lock +16 -13
  3. data/LICENSE.txt +1 -1
  4. data/README.rdoc +77 -63
  5. data/Rakefile +7 -13
  6. data/VERSION +1 -1
  7. data/lib/sorcery/controller/submodules/activity_logging.rb +58 -0
  8. data/lib/sorcery/controller/submodules/brute_force_protection.rb +15 -69
  9. data/lib/sorcery/controller/submodules/http_basic_auth.rb +65 -0
  10. data/lib/sorcery/controller/submodules/oauth/oauth1.rb +25 -0
  11. data/lib/sorcery/controller/submodules/oauth/oauth2.rb +23 -0
  12. data/lib/sorcery/controller/submodules/oauth/providers/facebook.rb +64 -0
  13. data/lib/sorcery/controller/submodules/oauth/providers/twitter.rb +61 -0
  14. data/lib/sorcery/controller/submodules/oauth.rb +95 -0
  15. data/lib/sorcery/controller/submodules/remember_me.rb +14 -5
  16. data/lib/sorcery/controller/submodules/session_timeout.rb +10 -2
  17. data/lib/sorcery/controller.rb +40 -22
  18. data/lib/sorcery/crypto_providers/bcrypt.rb +3 -7
  19. data/lib/sorcery/engine.rb +9 -2
  20. data/lib/sorcery/model/submodules/activity_logging.rb +40 -0
  21. data/lib/sorcery/model/submodules/brute_force_protection.rb +79 -0
  22. data/lib/sorcery/model/submodules/oauth.rb +53 -0
  23. data/lib/sorcery/model/submodules/remember_me.rb +6 -2
  24. data/lib/sorcery/model/submodules/reset_password.rb +96 -0
  25. data/lib/sorcery/model/submodules/user_activation.rb +44 -23
  26. data/lib/sorcery/model/temporary_token.rb +22 -0
  27. data/lib/sorcery/model.rb +13 -6
  28. data/lib/sorcery/test_helpers.rb +84 -0
  29. data/lib/sorcery.rb +17 -1
  30. data/sorcery.gemspec +85 -41
  31. data/spec/Gemfile +3 -2
  32. data/spec/Gemfile.lock +15 -2
  33. data/spec/rails3/app_root/.rspec +1 -0
  34. data/spec/rails3/{Gemfile → app_root/Gemfile} +5 -3
  35. data/spec/rails3/{Gemfile.lock → app_root/Gemfile.lock} +25 -2
  36. data/spec/rails3/app_root/app/controllers/application_controller.rb +48 -2
  37. data/spec/rails3/app_root/app/models/authentication.rb +3 -0
  38. data/spec/rails3/app_root/app/models/user.rb +4 -1
  39. data/spec/rails3/app_root/config/application.rb +1 -3
  40. data/spec/rails3/app_root/config/routes.rb +1 -9
  41. data/spec/rails3/app_root/db/migrate/activation/20101224223622_add_activation_to_users.rb +6 -4
  42. data/spec/rails3/app_root/db/migrate/activity_logging/20101224223624_add_activity_logging_to_users.rb +17 -0
  43. data/spec/rails3/app_root/db/migrate/brute_force_protection/20101224223626_add_brute_force_protection_to_users.rb +11 -0
  44. data/spec/rails3/app_root/db/migrate/core/20101224223620_create_users.rb +4 -4
  45. data/spec/rails3/app_root/db/migrate/oauth/20101224223628_create_authentications.rb +14 -0
  46. data/spec/rails3/app_root/db/migrate/reset_password/20101224223622_add_reset_password_to_users.rb +13 -0
  47. data/spec/rails3/app_root/spec/controller_activity_logging_spec.rb +84 -0
  48. data/spec/rails3/app_root/spec/controller_brute_force_protection_spec.rb +65 -0
  49. data/spec/rails3/app_root/spec/controller_http_basic_auth_spec.rb +50 -0
  50. data/spec/rails3/app_root/spec/controller_oauth2_spec.rb +117 -0
  51. data/spec/rails3/app_root/spec/controller_oauth_spec.rb +117 -0
  52. data/spec/rails3/{controller_remember_me_spec.rb → app_root/spec/controller_remember_me_spec.rb} +4 -4
  53. data/spec/rails3/{controller_session_timeout_spec.rb → app_root/spec/controller_session_timeout_spec.rb} +5 -4
  54. data/spec/rails3/{controller_spec.rb → app_root/spec/controller_spec.rb} +23 -16
  55. data/spec/rails3/app_root/spec/spec_helper.orig.rb +27 -0
  56. data/spec/rails3/app_root/spec/spec_helper.rb +61 -0
  57. data/spec/rails3/{user_activation_spec.rb → app_root/spec/user_activation_spec.rb} +62 -22
  58. data/spec/rails3/app_root/spec/user_activity_logging_spec.rb +36 -0
  59. data/spec/rails3/app_root/spec/user_brute_force_protection_spec.rb +76 -0
  60. data/spec/rails3/app_root/spec/user_oauth_spec.rb +39 -0
  61. data/spec/rails3/{user_remember_me_spec.rb → app_root/spec/user_remember_me_spec.rb} +4 -4
  62. data/spec/rails3/app_root/spec/user_reset_password_spec.rb +178 -0
  63. data/spec/rails3/{user_spec.rb → app_root/spec/user_spec.rb} +68 -38
  64. metadata +145 -61
  65. data/features/support/env.rb +0 -13
  66. data/lib/sorcery/model/submodules/password_reset.rb +0 -64
  67. data/spec/rails3/app_root/db/migrate/password_reset/20101224223622_add_password_reset_to_users.rb +0 -9
  68. data/spec/rails3/app_root/test/fixtures/users.yml +0 -9
  69. data/spec/rails3/app_root/test/performance/browsing_test.rb +0 -9
  70. data/spec/rails3/app_root/test/test_helper.rb +0 -13
  71. data/spec/rails3/app_root/test/unit/user_test.rb +0 -8
  72. data/spec/rails3/controller_brute_force_protection_spec.rb +0 -72
  73. data/spec/rails3/spec_helper.rb +0 -115
  74. data/spec/rails3/user_password_reset_spec.rb +0 -76
  75. /data/spec/rails3/{Rakefile → app_root/Rakefile} +0 -0
@@ -1,9 +1,9 @@
1
1
  require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
- require File.expand_path(File.dirname(__FILE__) + '/app_root/app/mailers/sorcery_mailer')
2
+ require File.expand_path(File.dirname(__FILE__) + '/../app/mailers/sorcery_mailer')
3
3
 
4
4
  describe "User with no submodules (core)" do
5
5
  before(:all) do
6
- plugin_model_configure
6
+ sorcery_reload!
7
7
  end
8
8
 
9
9
  describe User, "when app has plugin loaded" do
@@ -36,55 +36,55 @@ describe "User with no submodules (core)" do
36
36
  end
37
37
 
38
38
  it "should enable configuration option 'username_attribute_name'" do
39
- plugin_set_model_config_property(:username_attribute_name, :email)
39
+ sorcery_model_property_set(:username_attribute_name, :email)
40
40
  User.sorcery_config.username_attribute_name.should equal(:email)
41
41
  end
42
42
 
43
43
  it "should enable configuration option 'password_attribute_name'" do
44
- plugin_set_model_config_property(:password_attribute_name, :mypassword)
44
+ sorcery_model_property_set(:password_attribute_name, :mypassword)
45
45
  User.sorcery_config.password_attribute_name.should equal(:mypassword)
46
46
  end
47
47
 
48
48
  it "should enable configuration option 'email_attribute_name'" do
49
- plugin_set_model_config_property(:email_attribute_name, :my_email)
49
+ sorcery_model_property_set(:email_attribute_name, :my_email)
50
50
  User.sorcery_config.email_attribute_name.should equal(:my_email)
51
51
  end
52
52
 
53
53
  it "should enable configuration option 'crypted_password_attribute_name'" do
54
- plugin_set_model_config_property(:crypted_password_attribute_name, :password)
54
+ sorcery_model_property_set(:crypted_password_attribute_name, :password)
55
55
  User.sorcery_config.crypted_password_attribute_name.should equal(:password)
56
56
  end
57
57
 
58
58
  it "should enable configuration option 'salt_attribute_name'" do
59
- plugin_set_model_config_property(:salt_attribute_name, :my_salt)
59
+ sorcery_model_property_set(:salt_attribute_name, :my_salt)
60
60
  User.sorcery_config.salt_attribute_name.should equal(:my_salt)
61
61
  end
62
62
 
63
63
  it "should enable configuration option 'encryption_algorithm'" do
64
- plugin_set_model_config_property(:encryption_algorithm, :none)
64
+ sorcery_model_property_set(:encryption_algorithm, :none)
65
65
  User.sorcery_config.encryption_algorithm.should equal(:none)
66
66
  end
67
67
 
68
68
  it "should enable configuration option 'encryption_key'" do
69
- plugin_set_model_config_property(:encryption_key, 'asdadas424234242')
69
+ sorcery_model_property_set(:encryption_key, 'asdadas424234242')
70
70
  User.sorcery_config.encryption_key.should == 'asdadas424234242'
71
71
  end
72
72
 
73
73
  it "should enable configuration option 'custom_encryption_provider'" do
74
- plugin_set_model_config_property(:encryption_algorithm, :custom)
75
- plugin_set_model_config_property(:custom_encryption_provider, Array)
74
+ sorcery_model_property_set(:encryption_algorithm, :custom)
75
+ sorcery_model_property_set(:custom_encryption_provider, Array)
76
76
  User.sorcery_config.custom_encryption_provider.should equal(Array)
77
77
  end
78
78
 
79
79
  it "should enable configuration option 'salt_join_token'" do
80
80
  salt_join_token = "--%%*&-"
81
- plugin_set_model_config_property(:salt_join_token, salt_join_token)
81
+ sorcery_model_property_set(:salt_join_token, salt_join_token)
82
82
  User.sorcery_config.salt_join_token.should equal(salt_join_token)
83
83
  end
84
84
 
85
85
  it "should enable configuration option 'stretches'" do
86
86
  stretches = 15
87
- plugin_set_model_config_property(:stretches, stretches)
87
+ sorcery_model_property_set(:stretches, stretches)
88
88
  User.sorcery_config.stretches.should equal(stretches)
89
89
  end
90
90
 
@@ -93,7 +93,7 @@ describe "User with no submodules (core)" do
93
93
  # ----------------- PLUGIN ACTIVATED -----------------------
94
94
  describe User, "when activated with sorcery" do
95
95
  before(:all) do
96
- plugin_model_configure()
96
+ sorcery_reload!()
97
97
  end
98
98
 
99
99
  before(:each) do
@@ -124,7 +124,7 @@ describe "User with no submodules (core)" do
124
124
  describe User, "registration" do
125
125
 
126
126
  before(:all) do
127
- plugin_model_configure()
127
+ sorcery_reload!()
128
128
  end
129
129
 
130
130
  before(:each) do
@@ -159,9 +159,9 @@ describe "User with no submodules (core)" do
159
159
  it "should not clear the virtual password field if save failed due to exception" do
160
160
  create_new_user
161
161
  @user.password = 'blupush'
162
- @user.email = nil
162
+ @user.username = nil
163
163
  begin
164
- @user.save # triggers SQL exception since email field is defined not null.
164
+ @user.save # triggers SQL exception since username field is defined not null.
165
165
  rescue
166
166
  end
167
167
  @user.password.should_not be_nil
@@ -186,7 +186,7 @@ describe "User with no submodules (core)" do
186
186
  # ----------------- PASSWORD ENCRYPTION -----------------------
187
187
  describe User, "special encryption cases" do
188
188
  before(:all) do
189
- plugin_model_configure()
189
+ sorcery_reload!()
190
190
  @text = "Some Text!"
191
191
  end
192
192
 
@@ -199,7 +199,7 @@ describe "User with no submodules (core)" do
199
199
  end
200
200
 
201
201
  it "should work with no password encryption" do
202
- plugin_set_model_config_property(:encryption_algorithm, :none)
202
+ sorcery_model_property_set(:encryption_algorithm, :none)
203
203
  create_new_user
204
204
  User.authenticate(@user.send(User.sorcery_config.username_attribute_name), 'secret').should be_true
205
205
  end
@@ -214,66 +214,66 @@ describe "User with no submodules (core)" do
214
214
  crypted = encrypt(*tokens)
215
215
  end
216
216
  end
217
- plugin_set_model_config_property(:encryption_algorithm, :custom)
218
- plugin_set_model_config_property(:custom_encryption_provider, MyCrypto)
217
+ sorcery_model_property_set(:encryption_algorithm, :custom)
218
+ sorcery_model_property_set(:custom_encryption_provider, MyCrypto)
219
219
  create_new_user
220
220
  User.authenticate(@user.send(User.sorcery_config.username_attribute_name), 'secret').should be_true
221
221
  end
222
222
 
223
223
  it "if encryption algo is aes256, it should set key to crypto provider" do
224
- plugin_set_model_config_property(:encryption_algorithm, :aes256)
225
- plugin_set_model_config_property(:encryption_key, nil)
224
+ sorcery_model_property_set(:encryption_algorithm, :aes256)
225
+ sorcery_model_property_set(:encryption_key, nil)
226
226
  expect{User.encrypt(@text)}.to raise_error(ArgumentError)
227
- plugin_set_model_config_property(:encryption_key, "asd234dfs423fddsmndsflktsdf32343")
227
+ sorcery_model_property_set(:encryption_key, "asd234dfs423fddsmndsflktsdf32343")
228
228
  expect{User.encrypt(@text)}.to_not raise_error(ArgumentError)
229
229
  end
230
230
 
231
231
  it "if encryption algo is aes256, it should set key to crypto provider, even if attributes are set in reverse" do
232
- plugin_set_model_config_property(:encryption_key, nil)
233
- plugin_set_model_config_property(:encryption_algorithm, :none)
234
- plugin_set_model_config_property(:encryption_key, "asd234dfs423fddsmndsflktsdf32343")
235
- plugin_set_model_config_property(:encryption_algorithm, :aes256)
232
+ sorcery_model_property_set(:encryption_key, nil)
233
+ sorcery_model_property_set(:encryption_algorithm, :none)
234
+ sorcery_model_property_set(:encryption_key, "asd234dfs423fddsmndsflktsdf32343")
235
+ sorcery_model_property_set(:encryption_algorithm, :aes256)
236
236
  expect{User.encrypt(@text)}.to_not raise_error(ArgumentError)
237
237
  end
238
238
 
239
239
  it "if encryption algo is md5 it should work" do
240
- plugin_set_model_config_property(:encryption_algorithm, :md5)
240
+ sorcery_model_property_set(:encryption_algorithm, :md5)
241
241
  User.encrypt(@text).should == Sorcery::CryptoProviders::MD5.encrypt(@text)
242
242
  end
243
243
 
244
244
  it "if encryption algo is sha1 it should work" do
245
- plugin_set_model_config_property(:encryption_algorithm, :sha1)
245
+ sorcery_model_property_set(:encryption_algorithm, :sha1)
246
246
  User.encrypt(@text).should == Sorcery::CryptoProviders::SHA1.encrypt(@text)
247
247
  end
248
248
 
249
249
  it "if encryption algo is sha256 it should work" do
250
- plugin_set_model_config_property(:encryption_algorithm, :sha256)
250
+ sorcery_model_property_set(:encryption_algorithm, :sha256)
251
251
  User.encrypt(@text).should == Sorcery::CryptoProviders::SHA256.encrypt(@text)
252
252
  end
253
253
 
254
254
  it "if encryption algo is sha512 it should work" do
255
- plugin_set_model_config_property(:encryption_algorithm, :sha512)
255
+ sorcery_model_property_set(:encryption_algorithm, :sha512)
256
256
  User.encrypt(@text).should == Sorcery::CryptoProviders::SHA512.encrypt(@text)
257
257
  end
258
258
 
259
259
  it "salt should be random for each user and saved in db" do
260
- plugin_set_model_config_property(:salt_attribute_name, :salt)
260
+ sorcery_model_property_set(:salt_attribute_name, :salt)
261
261
  create_new_user
262
262
  @user.salt.should_not be_nil
263
263
  end
264
264
 
265
265
  it "if salt is set should use it to encrypt" do
266
- plugin_set_model_config_property(:salt_attribute_name, :salt)
267
- plugin_set_model_config_property(:encryption_algorithm, :sha512)
266
+ sorcery_model_property_set(:salt_attribute_name, :salt)
267
+ sorcery_model_property_set(:encryption_algorithm, :sha512)
268
268
  create_new_user
269
269
  @user.crypted_password.should_not == Sorcery::CryptoProviders::SHA512.encrypt('secret')
270
270
  @user.crypted_password.should == Sorcery::CryptoProviders::SHA512.encrypt('secret',@user.salt)
271
271
  end
272
272
 
273
273
  it "if salt_join_token is set should use it to encrypt" do
274
- plugin_set_model_config_property(:salt_attribute_name, :salt)
275
- plugin_set_model_config_property(:salt_join_token, "-@=>")
276
- plugin_set_model_config_property(:encryption_algorithm, :sha512)
274
+ sorcery_model_property_set(:salt_attribute_name, :salt)
275
+ sorcery_model_property_set(:salt_join_token, "-@=>")
276
+ sorcery_model_property_set(:encryption_algorithm, :sha512)
277
277
  create_new_user
278
278
  @user.crypted_password.should_not == Sorcery::CryptoProviders::SHA512.encrypt('secret')
279
279
  Sorcery::CryptoProviders::SHA512.join_token = ""
@@ -283,5 +283,35 @@ describe "User with no submodules (core)" do
283
283
  end
284
284
 
285
285
  end
286
+
287
+ describe User, "external users" do
288
+ before(:all) do
289
+ ActiveRecord::Migrator.migrate("#{Rails.root}/db/migrate/oauth")
290
+ sorcery_reload!()
291
+ end
292
+
293
+ after(:all) do
294
+ ActiveRecord::Migrator.rollback("#{Rails.root}/db/migrate/oauth")
295
+ end
296
+
297
+ before(:each) do
298
+ User.delete_all
299
+ end
300
+
301
+ it "should respond to 'external?'" do
302
+ create_new_user
303
+ @user.should respond_to(:external?)
304
+ end
305
+
306
+ it "external? should be false for regular users" do
307
+ create_new_user
308
+ @user.external?.should be_false
309
+ end
310
+
311
+ it "external? should be true for external users" do
312
+ create_new_external_user(:twitter)
313
+ @user.external?.should be_true
314
+ end
315
+ end
286
316
 
287
317
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: sorcery
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.1
5
+ version: 0.2.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - Noam Ben Ari
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-02-04 00:00:00 +02:00
13
+ date: 2011-03-13 00:00:00 +02:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -18,69 +18,69 @@ dependencies:
18
18
  requirement: &id001 !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
- - - "="
21
+ - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: 3.0.3
24
- type: :development
23
+ version: 3.0.0
24
+ type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: *id001
27
27
  - !ruby/object:Gem::Dependency
28
- name: rspec
28
+ name: json
29
29
  requirement: &id002 !ruby/object:Gem::Requirement
30
30
  none: false
31
31
  requirements:
32
- - - ~>
32
+ - - ">="
33
33
  - !ruby/object:Gem::Version
34
- version: 2.3.0
35
- type: :development
34
+ version: 1.5.1
35
+ type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: *id002
38
38
  - !ruby/object:Gem::Dependency
39
- name: rspec-rails
39
+ name: oauth
40
40
  requirement: &id003 !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
43
  - - ">="
44
44
  - !ruby/object:Gem::Version
45
- version: "0"
46
- type: :development
45
+ version: 0.4.4
46
+ type: :runtime
47
47
  prerelease: false
48
48
  version_requirements: *id003
49
49
  - !ruby/object:Gem::Dependency
50
- name: ruby-debug19
50
+ name: oauth2
51
51
  requirement: &id004 !ruby/object:Gem::Requirement
52
52
  none: false
53
53
  requirements:
54
54
  - - ">="
55
55
  - !ruby/object:Gem::Version
56
- version: "0"
57
- type: :development
56
+ version: 0.1.1
57
+ type: :runtime
58
58
  prerelease: false
59
59
  version_requirements: *id004
60
60
  - !ruby/object:Gem::Dependency
61
- name: sqlite3-ruby
61
+ name: rspec
62
62
  requirement: &id005 !ruby/object:Gem::Requirement
63
63
  none: false
64
64
  requirements:
65
- - - ">="
65
+ - - ~>
66
66
  - !ruby/object:Gem::Version
67
- version: "0"
67
+ version: 2.3.0
68
68
  type: :development
69
69
  prerelease: false
70
70
  version_requirements: *id005
71
71
  - !ruby/object:Gem::Dependency
72
- name: yard
72
+ name: rspec-rails
73
73
  requirement: &id006 !ruby/object:Gem::Requirement
74
74
  none: false
75
75
  requirements:
76
- - - ~>
76
+ - - ">="
77
77
  - !ruby/object:Gem::Version
78
- version: 0.6.0
78
+ version: "0"
79
79
  type: :development
80
80
  prerelease: false
81
81
  version_requirements: *id006
82
82
  - !ruby/object:Gem::Dependency
83
- name: cucumber
83
+ name: ruby-debug19
84
84
  requirement: &id007 !ruby/object:Gem::Requirement
85
85
  none: false
86
86
  requirements:
@@ -91,8 +91,30 @@ dependencies:
91
91
  prerelease: false
92
92
  version_requirements: *id007
93
93
  - !ruby/object:Gem::Dependency
94
- name: bundler
94
+ name: sqlite3-ruby
95
95
  requirement: &id008 !ruby/object:Gem::Requirement
96
+ none: false
97
+ requirements:
98
+ - - ">="
99
+ - !ruby/object:Gem::Version
100
+ version: "0"
101
+ type: :development
102
+ prerelease: false
103
+ version_requirements: *id008
104
+ - !ruby/object:Gem::Dependency
105
+ name: yard
106
+ requirement: &id009 !ruby/object:Gem::Requirement
107
+ none: false
108
+ requirements:
109
+ - - ~>
110
+ - !ruby/object:Gem::Version
111
+ version: 0.6.0
112
+ type: :development
113
+ prerelease: false
114
+ version_requirements: *id009
115
+ - !ruby/object:Gem::Dependency
116
+ name: bundler
117
+ requirement: &id010 !ruby/object:Gem::Requirement
96
118
  none: false
97
119
  requirements:
98
120
  - - ~>
@@ -100,10 +122,10 @@ dependencies:
100
122
  version: 1.0.0
101
123
  type: :development
102
124
  prerelease: false
103
- version_requirements: *id008
125
+ version_requirements: *id010
104
126
  - !ruby/object:Gem::Dependency
105
127
  name: jeweler
106
- requirement: &id009 !ruby/object:Gem::Requirement
128
+ requirement: &id011 !ruby/object:Gem::Requirement
107
129
  none: false
108
130
  requirements:
109
131
  - - ~>
@@ -111,10 +133,10 @@ dependencies:
111
133
  version: 1.5.2
112
134
  type: :development
113
135
  prerelease: false
114
- version_requirements: *id009
136
+ version_requirements: *id011
115
137
  - !ruby/object:Gem::Dependency
116
138
  name: simplecov
117
- requirement: &id010 !ruby/object:Gem::Requirement
139
+ requirement: &id012 !ruby/object:Gem::Requirement
118
140
  none: false
119
141
  requirements:
120
142
  - - ">="
@@ -122,7 +144,40 @@ dependencies:
122
144
  version: 0.3.8
123
145
  type: :development
124
146
  prerelease: false
125
- version_requirements: *id010
147
+ version_requirements: *id012
148
+ - !ruby/object:Gem::Dependency
149
+ name: bcrypt-ruby
150
+ requirement: &id013 !ruby/object:Gem::Requirement
151
+ none: false
152
+ requirements:
153
+ - - ~>
154
+ - !ruby/object:Gem::Version
155
+ version: 2.1.4
156
+ type: :runtime
157
+ prerelease: false
158
+ version_requirements: *id013
159
+ - !ruby/object:Gem::Dependency
160
+ name: oauth
161
+ requirement: &id014 !ruby/object:Gem::Requirement
162
+ none: false
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: 0.4.4
167
+ type: :runtime
168
+ prerelease: false
169
+ version_requirements: *id014
170
+ - !ruby/object:Gem::Dependency
171
+ name: oauth2
172
+ requirement: &id015 !ruby/object:Gem::Requirement
173
+ none: false
174
+ requirements:
175
+ - - ">="
176
+ - !ruby/object:Gem::Version
177
+ version: 0.1.1
178
+ type: :runtime
179
+ prerelease: false
180
+ version_requirements: *id015
126
181
  description: Provides common authentication needs such as signing in/out, activating by email and resetting password.
127
182
  email: nbenari@gmail.com
128
183
  executables: []
@@ -141,10 +196,16 @@ files:
141
196
  - README.rdoc
142
197
  - Rakefile
143
198
  - VERSION
144
- - features/support/env.rb
145
199
  - lib/sorcery.rb
146
200
  - lib/sorcery/controller.rb
201
+ - lib/sorcery/controller/submodules/activity_logging.rb
147
202
  - lib/sorcery/controller/submodules/brute_force_protection.rb
203
+ - lib/sorcery/controller/submodules/http_basic_auth.rb
204
+ - lib/sorcery/controller/submodules/oauth.rb
205
+ - lib/sorcery/controller/submodules/oauth/oauth1.rb
206
+ - lib/sorcery/controller/submodules/oauth/oauth2.rb
207
+ - lib/sorcery/controller/submodules/oauth/providers/facebook.rb
208
+ - lib/sorcery/controller/submodules/oauth/providers/twitter.rb
148
209
  - lib/sorcery/controller/submodules/remember_me.rb
149
210
  - lib/sorcery/controller/submodules/session_timeout.rb
150
211
  - lib/sorcery/crypto_providers/aes256.rb
@@ -155,23 +216,30 @@ files:
155
216
  - lib/sorcery/crypto_providers/sha512.rb
156
217
  - lib/sorcery/engine.rb
157
218
  - lib/sorcery/model.rb
158
- - lib/sorcery/model/submodules/password_reset.rb
219
+ - lib/sorcery/model/submodules/activity_logging.rb
220
+ - lib/sorcery/model/submodules/brute_force_protection.rb
221
+ - lib/sorcery/model/submodules/oauth.rb
159
222
  - lib/sorcery/model/submodules/remember_me.rb
223
+ - lib/sorcery/model/submodules/reset_password.rb
160
224
  - lib/sorcery/model/submodules/user_activation.rb
225
+ - lib/sorcery/model/temporary_token.rb
226
+ - lib/sorcery/test_helpers.rb
161
227
  - sorcery.gemspec
162
228
  - spec/Gemfile
163
229
  - spec/Gemfile.lock
164
230
  - spec/Rakefile
165
231
  - spec/rails3/.rspec
166
- - spec/rails3/Gemfile
167
- - spec/rails3/Gemfile.lock
168
- - spec/rails3/Rakefile
169
232
  - spec/rails3/app_root/.gitignore
233
+ - spec/rails3/app_root/.rspec
234
+ - spec/rails3/app_root/Gemfile
235
+ - spec/rails3/app_root/Gemfile.lock
170
236
  - spec/rails3/app_root/README
237
+ - spec/rails3/app_root/Rakefile
171
238
  - spec/rails3/app_root/Rakefile.unused
172
239
  - spec/rails3/app_root/app/controllers/application_controller.rb
173
240
  - spec/rails3/app_root/app/helpers/application_helper.rb
174
241
  - spec/rails3/app_root/app/mailers/sorcery_mailer.rb
242
+ - spec/rails3/app_root/app/models/authentication.rb
175
243
  - spec/rails3/app_root/app/models/user.rb
176
244
  - spec/rails3/app_root/app/views/layouts/application.html.erb
177
245
  - spec/rails3/app_root/app/views/sorcery_mailer/activation_email.html.erb
@@ -197,9 +265,12 @@ files:
197
265
  - spec/rails3/app_root/config/locales/en.yml
198
266
  - spec/rails3/app_root/config/routes.rb
199
267
  - spec/rails3/app_root/db/migrate/activation/20101224223622_add_activation_to_users.rb
268
+ - spec/rails3/app_root/db/migrate/activity_logging/20101224223624_add_activity_logging_to_users.rb
269
+ - spec/rails3/app_root/db/migrate/brute_force_protection/20101224223626_add_brute_force_protection_to_users.rb
200
270
  - spec/rails3/app_root/db/migrate/core/20101224223620_create_users.rb
201
- - spec/rails3/app_root/db/migrate/password_reset/20101224223622_add_password_reset_to_users.rb
271
+ - spec/rails3/app_root/db/migrate/oauth/20101224223628_create_authentications.rb
202
272
  - spec/rails3/app_root/db/migrate/remember_me/20101224223623_add_remember_me_token_to_users.rb
273
+ - spec/rails3/app_root/db/migrate/reset_password/20101224223622_add_reset_password_to_users.rb
203
274
  - spec/rails3/app_root/db/schema.rb
204
275
  - spec/rails3/app_root/db/seeds.rb
205
276
  - spec/rails3/app_root/lib/tasks/.gitkeep
@@ -218,20 +289,24 @@ files:
218
289
  - spec/rails3/app_root/public/robots.txt
219
290
  - spec/rails3/app_root/public/stylesheets/.gitkeep
220
291
  - spec/rails3/app_root/script/rails
221
- - spec/rails3/app_root/test/fixtures/users.yml
222
- - spec/rails3/app_root/test/performance/browsing_test.rb
223
- - spec/rails3/app_root/test/test_helper.rb
224
- - spec/rails3/app_root/test/unit/user_test.rb
292
+ - spec/rails3/app_root/spec/controller_activity_logging_spec.rb
293
+ - spec/rails3/app_root/spec/controller_brute_force_protection_spec.rb
294
+ - spec/rails3/app_root/spec/controller_http_basic_auth_spec.rb
295
+ - spec/rails3/app_root/spec/controller_oauth2_spec.rb
296
+ - spec/rails3/app_root/spec/controller_oauth_spec.rb
297
+ - spec/rails3/app_root/spec/controller_remember_me_spec.rb
298
+ - spec/rails3/app_root/spec/controller_session_timeout_spec.rb
299
+ - spec/rails3/app_root/spec/controller_spec.rb
300
+ - spec/rails3/app_root/spec/spec_helper.orig.rb
301
+ - spec/rails3/app_root/spec/spec_helper.rb
302
+ - spec/rails3/app_root/spec/user_activation_spec.rb
303
+ - spec/rails3/app_root/spec/user_activity_logging_spec.rb
304
+ - spec/rails3/app_root/spec/user_brute_force_protection_spec.rb
305
+ - spec/rails3/app_root/spec/user_oauth_spec.rb
306
+ - spec/rails3/app_root/spec/user_remember_me_spec.rb
307
+ - spec/rails3/app_root/spec/user_reset_password_spec.rb
308
+ - spec/rails3/app_root/spec/user_spec.rb
225
309
  - spec/rails3/app_root/vendor/plugins/.gitkeep
226
- - spec/rails3/controller_brute_force_protection_spec.rb
227
- - spec/rails3/controller_remember_me_spec.rb
228
- - spec/rails3/controller_session_timeout_spec.rb
229
- - spec/rails3/controller_spec.rb
230
- - spec/rails3/spec_helper.rb
231
- - spec/rails3/user_activation_spec.rb
232
- - spec/rails3/user_password_reset_spec.rb
233
- - spec/rails3/user_remember_me_spec.rb
234
- - spec/rails3/user_spec.rb
235
310
  - spec/sorcery_crypto_providers_spec.rb
236
311
  - spec/spec_helper.rb
237
312
  has_rdoc: true
@@ -258,7 +333,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
258
333
  requirements: []
259
334
 
260
335
  rubyforge_project:
261
- rubygems_version: 1.5.0
336
+ rubygems_version: 1.6.2
262
337
  signing_key:
263
338
  specification_version: 3
264
339
  summary: Magical authentication for Rails 3 applications
@@ -266,6 +341,7 @@ test_files:
266
341
  - spec/rails3/app_root/app/controllers/application_controller.rb
267
342
  - spec/rails3/app_root/app/helpers/application_helper.rb
268
343
  - spec/rails3/app_root/app/mailers/sorcery_mailer.rb
344
+ - spec/rails3/app_root/app/models/authentication.rb
269
345
  - spec/rails3/app_root/app/models/user.rb
270
346
  - spec/rails3/app_root/config/application.rb
271
347
  - spec/rails3/app_root/config/boot.rb
@@ -281,22 +357,30 @@ test_files:
281
357
  - spec/rails3/app_root/config/initializers/session_store.rb
282
358
  - spec/rails3/app_root/config/routes.rb
283
359
  - spec/rails3/app_root/db/migrate/activation/20101224223622_add_activation_to_users.rb
360
+ - spec/rails3/app_root/db/migrate/activity_logging/20101224223624_add_activity_logging_to_users.rb
361
+ - spec/rails3/app_root/db/migrate/brute_force_protection/20101224223626_add_brute_force_protection_to_users.rb
284
362
  - spec/rails3/app_root/db/migrate/core/20101224223620_create_users.rb
285
- - spec/rails3/app_root/db/migrate/password_reset/20101224223622_add_password_reset_to_users.rb
363
+ - spec/rails3/app_root/db/migrate/oauth/20101224223628_create_authentications.rb
286
364
  - spec/rails3/app_root/db/migrate/remember_me/20101224223623_add_remember_me_token_to_users.rb
365
+ - spec/rails3/app_root/db/migrate/reset_password/20101224223622_add_reset_password_to_users.rb
287
366
  - spec/rails3/app_root/db/schema.rb
288
367
  - spec/rails3/app_root/db/seeds.rb
289
- - spec/rails3/app_root/test/performance/browsing_test.rb
290
- - spec/rails3/app_root/test/test_helper.rb
291
- - spec/rails3/app_root/test/unit/user_test.rb
292
- - spec/rails3/controller_brute_force_protection_spec.rb
293
- - spec/rails3/controller_remember_me_spec.rb
294
- - spec/rails3/controller_session_timeout_spec.rb
295
- - spec/rails3/controller_spec.rb
296
- - spec/rails3/spec_helper.rb
297
- - spec/rails3/user_activation_spec.rb
298
- - spec/rails3/user_password_reset_spec.rb
299
- - spec/rails3/user_remember_me_spec.rb
300
- - spec/rails3/user_spec.rb
368
+ - spec/rails3/app_root/spec/controller_activity_logging_spec.rb
369
+ - spec/rails3/app_root/spec/controller_brute_force_protection_spec.rb
370
+ - spec/rails3/app_root/spec/controller_http_basic_auth_spec.rb
371
+ - spec/rails3/app_root/spec/controller_oauth2_spec.rb
372
+ - spec/rails3/app_root/spec/controller_oauth_spec.rb
373
+ - spec/rails3/app_root/spec/controller_remember_me_spec.rb
374
+ - spec/rails3/app_root/spec/controller_session_timeout_spec.rb
375
+ - spec/rails3/app_root/spec/controller_spec.rb
376
+ - spec/rails3/app_root/spec/spec_helper.orig.rb
377
+ - spec/rails3/app_root/spec/spec_helper.rb
378
+ - spec/rails3/app_root/spec/user_activation_spec.rb
379
+ - spec/rails3/app_root/spec/user_activity_logging_spec.rb
380
+ - spec/rails3/app_root/spec/user_brute_force_protection_spec.rb
381
+ - spec/rails3/app_root/spec/user_oauth_spec.rb
382
+ - spec/rails3/app_root/spec/user_remember_me_spec.rb
383
+ - spec/rails3/app_root/spec/user_reset_password_spec.rb
384
+ - spec/rails3/app_root/spec/user_spec.rb
301
385
  - spec/sorcery_crypto_providers_spec.rb
302
386
  - spec/spec_helper.rb
@@ -1,13 +0,0 @@
1
- require 'bundler'
2
- begin
3
- Bundler.setup(:default, :development)
4
- rescue Bundler::BundlerError => e
5
- $stderr.puts e.message
6
- $stderr.puts "Run `bundle install` to install missing gems"
7
- exit e.status_code
8
- end
9
-
10
- $LOAD_PATH.unshift(File.dirname(__FILE__) + '/../../lib')
11
- require 'sorcery'
12
-
13
- require 'rspec/expectations'