sorcery 0.8.4 → 0.8.5

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of sorcery might be problematic. Click here for more details.

Files changed (281) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +54 -0
  3. data/.travis.yml +13 -1
  4. data/CHANGELOG.md +234 -0
  5. data/Gemfile +17 -14
  6. data/Gemfile.rails4 +24 -0
  7. data/README.md +300 -0
  8. data/Rakefile +3 -79
  9. data/VERSION +1 -1
  10. data/lib/generators/sorcery/helpers.rb +40 -0
  11. data/lib/generators/sorcery/install_generator.rb +21 -17
  12. data/lib/generators/sorcery/templates/initializer.rb +1 -1
  13. data/lib/generators/sorcery/templates/migration/activity_logging.rb +2 -11
  14. data/lib/generators/sorcery/templates/migration/brute_force_protection.rb +1 -7
  15. data/lib/generators/sorcery/templates/migration/core.rb +5 -8
  16. data/lib/generators/sorcery/templates/migration/external.rb +1 -5
  17. data/lib/generators/sorcery/templates/migration/remember_me.rb +2 -9
  18. data/lib/generators/sorcery/templates/migration/reset_password.rb +2 -10
  19. data/lib/generators/sorcery/templates/migration/user_activation.rb +2 -10
  20. data/lib/sorcery/controller.rb +16 -4
  21. data/lib/sorcery/controller/submodules/external.rb +9 -8
  22. data/lib/sorcery/controller/submodules/external/protocols/oauth2.rb +2 -1
  23. data/lib/sorcery/controller/submodules/external/providers/facebook.rb +2 -1
  24. data/lib/sorcery/controller/submodules/external/providers/github.rb +2 -1
  25. data/lib/sorcery/controller/submodules/external/providers/google.rb +2 -1
  26. data/lib/sorcery/controller/submodules/external/providers/linkedin.rb +2 -1
  27. data/lib/sorcery/controller/submodules/external/providers/liveid.rb +2 -1
  28. data/lib/sorcery/controller/submodules/external/providers/twitter.rb +3 -2
  29. data/lib/sorcery/controller/submodules/external/providers/vk.rb +2 -1
  30. data/lib/sorcery/controller/submodules/external/providers/xing.rb +2 -1
  31. data/lib/sorcery/controller/submodules/remember_me.rb +1 -1
  32. data/lib/sorcery/controller/submodules/session_timeout.rb +1 -1
  33. data/lib/sorcery/model.rb +9 -3
  34. data/lib/sorcery/model/adapters/mongoid.rb +3 -3
  35. data/lib/sorcery/model/submodules/brute_force_protection.rb +6 -8
  36. data/lib/sorcery/model/submodules/reset_password.rb +5 -1
  37. data/lib/sorcery/model/submodules/user_activation.rb +18 -4
  38. data/lib/sorcery/test_helpers/internal.rb +21 -4
  39. data/lib/sorcery/test_helpers/internal/rails.rb +4 -4
  40. data/lib/sorcery/test_helpers/rails.rb +2 -2
  41. data/sorcery.gemspec +25 -363
  42. data/spec/{rails3/spec → active_record}/controller_activity_logging_spec.rb +29 -19
  43. data/spec/active_record/controller_brute_force_protection_spec.rb +136 -0
  44. data/spec/{rails3/spec → active_record}/controller_http_basic_auth_spec.rb +26 -17
  45. data/spec/{rails3/spec → active_record}/controller_oauth2_spec.rb +93 -56
  46. data/spec/{rails3/spec → active_record}/controller_oauth_spec.rb +35 -29
  47. data/spec/{rails3/spec → active_record}/controller_remember_me_spec.rb +28 -28
  48. data/spec/{rails3/spec → active_record}/controller_session_timeout_spec.rb +11 -11
  49. data/spec/{rails3/spec → active_record}/controller_spec.rb +19 -19
  50. data/spec/{rails3/spec → active_record}/integration_spec.rb +2 -2
  51. data/spec/{rails3/spec → active_record}/user_activation_spec.rb +8 -6
  52. data/spec/active_record/user_activity_logging_spec.rb +8 -0
  53. data/spec/{rails3/spec → active_record}/user_brute_force_protection_spec.rb +5 -4
  54. data/spec/{rails3/spec → active_record}/user_oauth_spec.rb +5 -4
  55. data/spec/{rails3/spec → active_record}/user_remember_me_spec.rb +4 -3
  56. data/spec/{rails3/spec → active_record}/user_reset_password_spec.rb +6 -6
  57. data/spec/{rails3/spec → active_record}/user_spec.rb +12 -10
  58. data/spec/{rails3_mongo_mapper/spec → mongo_mapper}/controller_spec.rb +15 -15
  59. data/spec/mongo_mapper/user_activation_spec.rb +10 -0
  60. data/spec/mongo_mapper/user_activity_logging_spec.rb +8 -0
  61. data/spec/mongo_mapper/user_brute_force_protection_spec.rb +8 -0
  62. data/spec/mongo_mapper/user_oauth_spec.rb +8 -0
  63. data/spec/mongo_mapper/user_remember_me_spec.rb +8 -0
  64. data/spec/mongo_mapper/user_reset_password_spec.rb +8 -0
  65. data/spec/{rails3_mongo_mapper/spec → mongo_mapper}/user_spec.rb +9 -8
  66. data/spec/{rails3_mongoid/spec → mongoid}/controller_activity_logging_spec.rb +8 -8
  67. data/spec/{rails3_mongoid/spec → mongoid}/controller_spec.rb +14 -14
  68. data/spec/mongoid/user_activation_spec.rb +10 -0
  69. data/spec/mongoid/user_activity_logging_spec.rb +9 -0
  70. data/spec/mongoid/user_brute_force_protection_spec.rb +9 -0
  71. data/spec/mongoid/user_oauth_spec.rb +9 -0
  72. data/spec/mongoid/user_remember_me_spec.rb +9 -0
  73. data/spec/mongoid/user_reset_password_spec.rb +9 -0
  74. data/spec/{rails3_mongoid/spec → mongoid}/user_spec.rb +10 -9
  75. data/spec/orm/active_record.rb +7 -0
  76. data/spec/orm/mongo_mapper.rb +10 -0
  77. data/spec/orm/mongoid.rb +17 -0
  78. data/spec/{rails3/app/models → rails_app/app/active_record}/authentication.rb +0 -0
  79. data/spec/{rails3/app/models → rails_app/app/active_record}/user.rb +1 -2
  80. data/spec/rails_app/app/active_record/user_provider.rb +3 -0
  81. data/spec/{rails3/app/controllers/application_controller.rb → rails_app/app/controllers/sorcery_controller.rb} +26 -15
  82. data/spec/{rails3 → rails_app}/app/helpers/application_helper.rb +0 -0
  83. data/spec/{rails3 → rails_app}/app/mailers/sorcery_mailer.rb +0 -0
  84. data/spec/{rails3_mongo_mapper/app/models → rails_app/app/mongo_mapper}/authentication.rb +0 -0
  85. data/spec/{rails3_mongo_mapper/app/models → rails_app/app/mongo_mapper}/user.rb +0 -0
  86. data/spec/{rails3_mongoid/app/models → rails_app/app/mongoid}/authentication.rb +0 -0
  87. data/spec/{rails3_mongoid/app/models → rails_app/app/mongoid}/user.rb +2 -0
  88. data/spec/{rails3 → rails_app}/app/views/application/index.html.erb +0 -0
  89. data/spec/{rails3 → rails_app}/app/views/layouts/application.html.erb +0 -0
  90. data/spec/{rails3 → rails_app}/app/views/sorcery_mailer/activation_email.html.erb +0 -0
  91. data/spec/{rails3 → rails_app}/app/views/sorcery_mailer/activation_email.text.erb +0 -0
  92. data/spec/{rails3/app/views/sorcery_mailer/activation_success_email.html.erb → rails_app/app/views/sorcery_mailer/activation_needed_email.html.erb} +0 -0
  93. data/spec/{rails3_mongo_mapper → rails_app}/app/views/sorcery_mailer/activation_success_email.html.erb +0 -0
  94. data/spec/{rails3 → rails_app}/app/views/sorcery_mailer/activation_success_email.text.erb +0 -0
  95. data/spec/{rails3 → rails_app}/app/views/sorcery_mailer/reset_password_email.html.erb +0 -0
  96. data/spec/{rails3 → rails_app}/app/views/sorcery_mailer/reset_password_email.text.erb +0 -0
  97. data/spec/{rails3 → rails_app}/app/views/sorcery_mailer/send_unlock_token_email.text.erb +0 -0
  98. data/spec/{rails3_mongo_mapper → rails_app}/config.ru +1 -1
  99. data/spec/{rails3_mongoid → rails_app}/config/application.rb +13 -8
  100. data/spec/rails_app/config/boot.rb +4 -0
  101. data/spec/rails_app/config/database.yml +22 -0
  102. data/spec/{rails3 → rails_app}/config/environment.rb +0 -0
  103. data/spec/{rails3_mongo_mapper → rails_app}/config/environments/test.rb +2 -0
  104. data/spec/{rails3 → rails_app}/config/initializers/backtrace_silencers.rb +0 -0
  105. data/spec/{rails3 → rails_app}/config/initializers/inflections.rb +0 -0
  106. data/spec/{rails3 → rails_app}/config/initializers/mime_types.rb +0 -0
  107. data/spec/{rails3 → rails_app}/config/initializers/secret_token.rb +0 -0
  108. data/spec/{rails3 → rails_app}/config/initializers/session_store.rb +4 -0
  109. data/spec/{rails3 → rails_app}/config/locales/en.yml +0 -0
  110. data/spec/rails_app/config/routes.rb +37 -0
  111. data/spec/{rails3 → rails_app}/db/migrate/activation/20101224223622_add_activation_to_users.rb +3 -3
  112. data/spec/{rails3 → rails_app}/db/migrate/activity_logging/20101224223624_add_activity_logging_to_users.rb +0 -0
  113. data/spec/{rails3 → rails_app}/db/migrate/brute_force_protection/20101224223626_add_brute_force_protection_to_users.rb +0 -0
  114. data/spec/{rails3 → rails_app}/db/migrate/core/20101224223620_create_users.rb +0 -0
  115. data/spec/rails_app/db/migrate/external/20101224223628_create_authentications_and_user_providers.rb +22 -0
  116. data/spec/{rails3 → rails_app}/db/migrate/remember_me/20101224223623_add_remember_me_token_to_users.rb +0 -0
  117. data/spec/{rails3 → rails_app}/db/migrate/reset_password/20101224223622_add_reset_password_to_users.rb +0 -0
  118. data/spec/{rails3 → rails_app}/db/schema.rb +0 -0
  119. data/spec/{rails3 → rails_app}/db/seeds.rb +0 -0
  120. data/spec/{rails3 → rails_app}/public/404.html +0 -0
  121. data/spec/{rails3 → rails_app}/public/422.html +0 -0
  122. data/spec/{rails3 → rails_app}/public/500.html +0 -0
  123. data/spec/{rails3 → rails_app}/public/favicon.ico +0 -0
  124. data/spec/{rails3 → rails_app}/public/images/rails.png +0 -0
  125. data/spec/{rails3 → rails_app}/public/javascripts/application.js +0 -0
  126. data/spec/{rails3 → rails_app}/public/javascripts/controls.js +0 -0
  127. data/spec/{rails3 → rails_app}/public/javascripts/dragdrop.js +0 -0
  128. data/spec/{rails3 → rails_app}/public/javascripts/effects.js +0 -0
  129. data/spec/{rails3 → rails_app}/public/javascripts/prototype.js +0 -0
  130. data/spec/{rails3 → rails_app}/public/javascripts/rails.js +0 -0
  131. data/spec/{rails3 → rails_app}/public/robots.txt +0 -0
  132. data/spec/{rails3/lib/tasks → rails_app/public/stylesheets}/.gitkeep +0 -0
  133. data/spec/shared_examples/controller_oauth_shared_examples.rb +22 -8
  134. data/spec/shared_examples/user_activation_shared_examples.rb +49 -27
  135. data/spec/shared_examples/user_reset_password_shared_examples.rb +33 -21
  136. data/spec/shared_examples/user_shared_examples.rb +65 -50
  137. data/spec/sorcery_crypto_providers_spec.rb +47 -45
  138. data/spec/spec_helper.rb +38 -4
  139. metadata +117 -254
  140. data/Gemfile.lock +0 -175
  141. data/README.rdoc +0 -261
  142. data/spec/Gemfile +0 -12
  143. data/spec/Gemfile.lock +0 -129
  144. data/spec/README.md +0 -31
  145. data/spec/Rakefile +0 -12
  146. data/spec/rails3/.gitignore +0 -4
  147. data/spec/rails3/.rspec +0 -1
  148. data/spec/rails3/Gemfile +0 -15
  149. data/spec/rails3/Gemfile.lock +0 -162
  150. data/spec/rails3/README +0 -256
  151. data/spec/rails3/Rakefile +0 -11
  152. data/spec/rails3/config.ru +0 -4
  153. data/spec/rails3/config/application.rb +0 -46
  154. data/spec/rails3/config/boot.rb +0 -13
  155. data/spec/rails3/config/database.yml +0 -27
  156. data/spec/rails3/config/environments/development.rb +0 -26
  157. data/spec/rails3/config/environments/in_memory.rb +0 -35
  158. data/spec/rails3/config/environments/production.rb +0 -49
  159. data/spec/rails3/config/environments/test.rb +0 -35
  160. data/spec/rails3/config/routes.rb +0 -59
  161. data/spec/rails3/db/migrate/external/20101224223628_create_authentications.rb +0 -14
  162. data/spec/rails3/public/stylesheets/.gitkeep +0 -0
  163. data/spec/rails3/script/rails +0 -6
  164. data/spec/rails3/spec/controller_brute_force_protection_spec.rb +0 -96
  165. data/spec/rails3/spec/spec.opts +0 -2
  166. data/spec/rails3/spec/spec_helper.orig.rb +0 -27
  167. data/spec/rails3/spec/spec_helper.rb +0 -71
  168. data/spec/rails3/spec/user_activity_logging_spec.rb +0 -8
  169. data/spec/rails3/vendor/plugins/.gitkeep +0 -0
  170. data/spec/rails3_mongo_mapper/.gitignore +0 -4
  171. data/spec/rails3_mongo_mapper/.rspec +0 -1
  172. data/spec/rails3_mongo_mapper/Gemfile +0 -16
  173. data/spec/rails3_mongo_mapper/Gemfile.lock +0 -156
  174. data/spec/rails3_mongo_mapper/Rakefile +0 -11
  175. data/spec/rails3_mongo_mapper/app/controllers/application_controller.rb +0 -122
  176. data/spec/rails3_mongo_mapper/app/helpers/application_helper.rb +0 -2
  177. data/spec/rails3_mongo_mapper/app/mailers/sorcery_mailer.rb +0 -25
  178. data/spec/rails3_mongo_mapper/app/views/layouts/application.html.erb +0 -14
  179. data/spec/rails3_mongo_mapper/app/views/sorcery_mailer/activation_email.html.erb +0 -17
  180. data/spec/rails3_mongo_mapper/app/views/sorcery_mailer/activation_email.text.erb +0 -9
  181. data/spec/rails3_mongo_mapper/app/views/sorcery_mailer/activation_success_email.text.erb +0 -9
  182. data/spec/rails3_mongo_mapper/app/views/sorcery_mailer/reset_password_email.html.erb +0 -16
  183. data/spec/rails3_mongo_mapper/app/views/sorcery_mailer/reset_password_email.text.erb +0 -8
  184. data/spec/rails3_mongo_mapper/config/application.rb +0 -51
  185. data/spec/rails3_mongo_mapper/config/boot.rb +0 -13
  186. data/spec/rails3_mongo_mapper/config/environment.rb +0 -5
  187. data/spec/rails3_mongo_mapper/config/environments/development.rb +0 -30
  188. data/spec/rails3_mongo_mapper/config/environments/in_memory.rb +0 -0
  189. data/spec/rails3_mongo_mapper/config/environments/production.rb +0 -49
  190. data/spec/rails3_mongo_mapper/config/initializers/backtrace_silencers.rb +0 -7
  191. data/spec/rails3_mongo_mapper/config/initializers/inflections.rb +0 -10
  192. data/spec/rails3_mongo_mapper/config/initializers/mime_types.rb +0 -5
  193. data/spec/rails3_mongo_mapper/config/initializers/mongo.rb +0 -2
  194. data/spec/rails3_mongo_mapper/config/initializers/secret_token.rb +0 -7
  195. data/spec/rails3_mongo_mapper/config/initializers/session_store.rb +0 -8
  196. data/spec/rails3_mongo_mapper/config/locales/en.yml +0 -5
  197. data/spec/rails3_mongo_mapper/config/routes.rb +0 -59
  198. data/spec/rails3_mongo_mapper/db/schema.rb +0 -23
  199. data/spec/rails3_mongo_mapper/db/seeds.rb +0 -7
  200. data/spec/rails3_mongo_mapper/lib/tasks/.gitkeep +0 -0
  201. data/spec/rails3_mongo_mapper/public/404.html +0 -26
  202. data/spec/rails3_mongo_mapper/public/422.html +0 -26
  203. data/spec/rails3_mongo_mapper/public/500.html +0 -26
  204. data/spec/rails3_mongo_mapper/public/favicon.ico +0 -0
  205. data/spec/rails3_mongo_mapper/public/images/rails.png +0 -0
  206. data/spec/rails3_mongo_mapper/public/javascripts/application.js +0 -2
  207. data/spec/rails3_mongo_mapper/public/javascripts/controls.js +0 -965
  208. data/spec/rails3_mongo_mapper/public/javascripts/dragdrop.js +0 -974
  209. data/spec/rails3_mongo_mapper/public/javascripts/effects.js +0 -1123
  210. data/spec/rails3_mongo_mapper/public/javascripts/prototype.js +0 -6001
  211. data/spec/rails3_mongo_mapper/public/javascripts/rails.js +0 -175
  212. data/spec/rails3_mongo_mapper/public/robots.txt +0 -5
  213. data/spec/rails3_mongo_mapper/public/stylesheets/.gitkeep +0 -0
  214. data/spec/rails3_mongo_mapper/script/rails +0 -6
  215. data/spec/rails3_mongo_mapper/spec/spec.opts +0 -2
  216. data/spec/rails3_mongo_mapper/spec/spec_helper.orig.rb +0 -27
  217. data/spec/rails3_mongo_mapper/spec/spec_helper.rb +0 -55
  218. data/spec/rails3_mongo_mapper/spec/user_activation_spec.rb +0 -9
  219. data/spec/rails3_mongo_mapper/spec/user_activity_logging_spec.rb +0 -8
  220. data/spec/rails3_mongo_mapper/spec/user_brute_force_protection_spec.rb +0 -8
  221. data/spec/rails3_mongo_mapper/spec/user_oauth_spec.rb +0 -8
  222. data/spec/rails3_mongo_mapper/spec/user_remember_me_spec.rb +0 -8
  223. data/spec/rails3_mongo_mapper/spec/user_reset_password_spec.rb +0 -8
  224. data/spec/rails3_mongo_mapper/vendor/plugins/.gitkeep +0 -0
  225. data/spec/rails3_mongoid/.gitignore +0 -4
  226. data/spec/rails3_mongoid/.rspec +0 -1
  227. data/spec/rails3_mongoid/Gemfile +0 -15
  228. data/spec/rails3_mongoid/Gemfile.lock +0 -146
  229. data/spec/rails3_mongoid/Rakefile +0 -11
  230. data/spec/rails3_mongoid/app/controllers/application_controller.rb +0 -127
  231. data/spec/rails3_mongoid/app/helpers/application_helper.rb +0 -2
  232. data/spec/rails3_mongoid/app/mailers/sorcery_mailer.rb +0 -25
  233. data/spec/rails3_mongoid/app/views/layouts/application.html.erb +0 -14
  234. data/spec/rails3_mongoid/app/views/sorcery_mailer/activation_email.html.erb +0 -17
  235. data/spec/rails3_mongoid/app/views/sorcery_mailer/activation_email.text.erb +0 -9
  236. data/spec/rails3_mongoid/app/views/sorcery_mailer/activation_success_email.html.erb +0 -17
  237. data/spec/rails3_mongoid/app/views/sorcery_mailer/activation_success_email.text.erb +0 -9
  238. data/spec/rails3_mongoid/app/views/sorcery_mailer/reset_password_email.html.erb +0 -16
  239. data/spec/rails3_mongoid/app/views/sorcery_mailer/reset_password_email.text.erb +0 -8
  240. data/spec/rails3_mongoid/config.ru +0 -4
  241. data/spec/rails3_mongoid/config/boot.rb +0 -13
  242. data/spec/rails3_mongoid/config/environment.rb +0 -5
  243. data/spec/rails3_mongoid/config/environments/development.rb +0 -26
  244. data/spec/rails3_mongoid/config/environments/in_memory.rb +0 -0
  245. data/spec/rails3_mongoid/config/environments/production.rb +0 -49
  246. data/spec/rails3_mongoid/config/environments/test.rb +0 -35
  247. data/spec/rails3_mongoid/config/initializers/backtrace_silencers.rb +0 -7
  248. data/spec/rails3_mongoid/config/initializers/inflections.rb +0 -10
  249. data/spec/rails3_mongoid/config/initializers/mime_types.rb +0 -5
  250. data/spec/rails3_mongoid/config/initializers/secret_token.rb +0 -7
  251. data/spec/rails3_mongoid/config/initializers/session_store.rb +0 -8
  252. data/spec/rails3_mongoid/config/locales/en.yml +0 -5
  253. data/spec/rails3_mongoid/config/mongoid.yml +0 -7
  254. data/spec/rails3_mongoid/config/routes.rb +0 -59
  255. data/spec/rails3_mongoid/db/schema.rb +0 -23
  256. data/spec/rails3_mongoid/db/seeds.rb +0 -7
  257. data/spec/rails3_mongoid/lib/tasks/.gitkeep +0 -0
  258. data/spec/rails3_mongoid/public/404.html +0 -26
  259. data/spec/rails3_mongoid/public/422.html +0 -26
  260. data/spec/rails3_mongoid/public/500.html +0 -26
  261. data/spec/rails3_mongoid/public/favicon.ico +0 -0
  262. data/spec/rails3_mongoid/public/images/rails.png +0 -0
  263. data/spec/rails3_mongoid/public/javascripts/application.js +0 -2
  264. data/spec/rails3_mongoid/public/javascripts/controls.js +0 -965
  265. data/spec/rails3_mongoid/public/javascripts/dragdrop.js +0 -974
  266. data/spec/rails3_mongoid/public/javascripts/effects.js +0 -1123
  267. data/spec/rails3_mongoid/public/javascripts/prototype.js +0 -6001
  268. data/spec/rails3_mongoid/public/javascripts/rails.js +0 -175
  269. data/spec/rails3_mongoid/public/robots.txt +0 -5
  270. data/spec/rails3_mongoid/public/stylesheets/.gitkeep +0 -0
  271. data/spec/rails3_mongoid/script/rails +0 -6
  272. data/spec/rails3_mongoid/spec/spec.opts +0 -2
  273. data/spec/rails3_mongoid/spec/spec_helper.orig.rb +0 -27
  274. data/spec/rails3_mongoid/spec/spec_helper.rb +0 -55
  275. data/spec/rails3_mongoid/spec/user_activation_spec.rb +0 -9
  276. data/spec/rails3_mongoid/spec/user_activity_logging_spec.rb +0 -8
  277. data/spec/rails3_mongoid/spec/user_brute_force_protection_spec.rb +0 -8
  278. data/spec/rails3_mongoid/spec/user_oauth_spec.rb +0 -8
  279. data/spec/rails3_mongoid/spec/user_remember_me_spec.rb +0 -8
  280. data/spec/rails3_mongoid/spec/user_reset_password_spec.rb +0 -8
  281. data/spec/rails3_mongoid/vendor/plugins/.gitkeep +0 -0
@@ -14,7 +14,8 @@ module Sorcery
14
14
  client.auth_code.authorize_url(
15
15
  :redirect_uri => @callback_url,
16
16
  :scope => @scope,
17
- :display => @display
17
+ :display => @display,
18
+ :state => @state
18
19
  )
19
20
  end
20
21
 
@@ -37,7 +37,8 @@ module Sorcery
37
37
  :scope,
38
38
  :user_info_mapping,
39
39
  :display,
40
- :access_permissions
40
+ :access_permissions,
41
+ :state
41
42
  attr_reader :access_token
42
43
 
43
44
  include Protocols::Oauth2
@@ -37,7 +37,8 @@ module Sorcery
37
37
  :site,
38
38
  :scope,
39
39
  :user_info_path,
40
- :user_info_mapping
40
+ :user_info_mapping,
41
+ :state
41
42
  attr_reader :access_token
42
43
 
43
44
  include Protocols::Oauth2
@@ -37,7 +37,8 @@ module Sorcery
37
37
  :token_path,
38
38
  :user_info_url,
39
39
  :scope,
40
- :user_info_mapping
40
+ :user_info_mapping,
41
+ :state
41
42
  attr_reader :access_token
42
43
 
43
44
  include Protocols::Oauth2
@@ -39,7 +39,8 @@ module Sorcery
39
39
  :user_info_path,
40
40
  :user_info_mapping,
41
41
  :user_info_fields,
42
- :access_permissions
42
+ :access_permissions,
43
+ :state
43
44
  attr_reader :access_token
44
45
 
45
46
  include Protocols::Oauth1
@@ -37,7 +37,8 @@ module Sorcery
37
37
  :token_path,
38
38
  :user_info_url,
39
39
  :scope,
40
- :user_info_mapping
40
+ :user_info_mapping,
41
+ :state
41
42
  attr_reader :access_token
42
43
 
43
44
  include Protocols::Oauth2
@@ -37,7 +37,8 @@ module Sorcery
37
37
  :callback_url,
38
38
  :site,
39
39
  :user_info_path,
40
- :user_info_mapping
40
+ :user_info_mapping,
41
+ :state
41
42
  attr_reader :access_token
42
43
 
43
44
  include Protocols::Oauth1
@@ -67,7 +68,7 @@ module Sorcery
67
68
 
68
69
  # calculates and returns the url to which the user should be redirected,
69
70
  # to get authenticated at the external provider's site.
70
- def login_url(params,session)
71
+ def login_url(params, session)
71
72
  req_token = self.get_request_token
72
73
  session[:request_token] = req_token.token
73
74
  session[:request_token_secret] = req_token.secret
@@ -35,7 +35,8 @@ module Sorcery
35
35
  :auth_path,
36
36
  :token_path,
37
37
  :site,
38
- :user_info_mapping
38
+ :user_info_mapping,
39
+ :state
39
40
  attr_reader :access_token
40
41
 
41
42
  include Protocols::Oauth2
@@ -37,7 +37,8 @@ module Sorcery
37
37
  :request_token_path,
38
38
  :access_token_path,
39
39
  :user_info_path,
40
- :user_info_mapping
40
+ :user_info_mapping,
41
+ :state
41
42
  attr_reader :access_token
42
43
 
43
44
  include Protocols::Oauth1
@@ -31,7 +31,7 @@ module Sorcery
31
31
 
32
32
  # Clears the cookie and clears the token from the db.
33
33
  def forget_me!
34
- @current_user.forget_me!
34
+ current_user.forget_me!
35
35
  cookies.delete(:remember_me_token, :domain => Config.cookie_domain)
36
36
  end
37
37
 
@@ -38,7 +38,7 @@ module Sorcery
38
38
  def validate_session
39
39
  session_to_use = Config.session_timeout_from_last_action ? session[:last_action_time] : session[:login_time]
40
40
  if session_to_use && (Time.now.in_time_zone - session_to_use > Config.session_timeout)
41
- reset_session
41
+ reset_sorcery_session
42
42
  @current_user = nil
43
43
  else
44
44
  session[:last_action_time] = Time.now.in_time_zone
@@ -104,10 +104,16 @@ module Sorcery
104
104
  # returns the user if success, nil otherwise.
105
105
  def authenticate(*credentials)
106
106
  raise ArgumentError, "at least 2 arguments required" if credentials.size < 2
107
- credentials[0].downcase! if @sorcery_config.downcase_username_before_authenticating
107
+
108
+ return false if credentials[0].blank?
109
+
110
+ if @sorcery_config.downcase_username_before_authenticating
111
+ credentials[0].downcase!
112
+ end
113
+
108
114
  user = find_by_credentials(credentials)
109
115
 
110
- set_encryption_attributes()
116
+ set_encryption_attributes
111
117
 
112
118
  _salt = user.send(@sorcery_config.salt_attribute_name) if user && !@sorcery_config.salt_attribute_name.nil? && !@sorcery_config.encryption_provider.nil?
113
119
  user if user && @sorcery_config.before_authenticate.all? {|c| user.send(c)} && credentials_match?(user.send(@sorcery_config.crypted_password_attribute_name),credentials[1],_salt)
@@ -230,7 +236,7 @@ module Sorcery
230
236
  def initialize
231
237
  @defaults = {
232
238
  :@submodules => [],
233
- :@username_attribute_names => [:username],
239
+ :@username_attribute_names => [:email],
234
240
  :@password_attribute_name => :password,
235
241
  :@downcase_username_before_authenticating => false,
236
242
  :@email_attribute_name => :email,
@@ -9,7 +9,7 @@ module Sorcery
9
9
 
10
10
  module InstanceMethods
11
11
  def increment(attr)
12
- self.inc(attr,1)
12
+ self.inc(attr, 1)
13
13
  end
14
14
 
15
15
  def update_many_attributes(attrs)
@@ -27,8 +27,8 @@ module Sorcery
27
27
 
28
28
  module ClassMethods
29
29
  def credential_regex(credential)
30
- return { :$regex => /^#{credential}$/i } if (@sorcery_config.downcase_username_before_authenticating)
31
- return credential
30
+ return { :$regex => /^#{credential}$/i } if (@sorcery_config.downcase_username_before_authenticating)
31
+ credential
32
32
  end
33
33
 
34
34
  def find_by_credentials(credentials)
@@ -82,8 +82,8 @@ module Sorcery
82
82
  def unlock!
83
83
  config = sorcery_config
84
84
  attributes = {config.lock_expires_at_attribute_name => nil,
85
- config.failed_logins_count_attribute_name => 0}
86
- attributes[config.unlock_token_attribute_name] = nil unless config.unlock_token_mailer_disabled or config.unlock_token_mailer.nil?
85
+ config.failed_logins_count_attribute_name => 0,
86
+ config.unlock_token_attribute_name => nil}
87
87
  self.update_many_attributes(attributes)
88
88
  end
89
89
 
@@ -91,14 +91,12 @@ module Sorcery
91
91
 
92
92
  def lock!
93
93
  config = sorcery_config
94
- attributes = {config.lock_expires_at_attribute_name => Time.now.in_time_zone + config.login_lock_time_period}
94
+ attributes = {config.lock_expires_at_attribute_name => Time.now.in_time_zone + config.login_lock_time_period,
95
+ config.unlock_token_attribute_name => TemporaryToken.generate_random_token}
96
+ self.update_many_attributes(attributes)
95
97
 
96
98
  unless config.unlock_token_mailer_disabled || config.unlock_token_mailer.nil?
97
- attributes[config.unlock_token_attribute_name] = TemporaryToken.generate_random_token
98
- self.update_many_attributes(attributes)
99
99
  send_unlock_token_email!
100
- else
101
- self.update_many_attributes(attributes)
102
100
  end
103
101
  end
104
102
 
@@ -108,7 +106,7 @@ module Sorcery
108
106
  end
109
107
 
110
108
  def send_unlock_token_email!
111
- generic_send_email(:unlock_token_email_method_name, :unlock_token_mailer) unless sorcery_config.unlock_token_email_method_name.nil? or sorcery_config.unlock_token_mailer_disabled == true
109
+ generic_send_email(:unlock_token_email_method_name, :unlock_token_mailer) unless sorcery_config.unlock_token_email_method_name.nil?
112
110
  end
113
111
 
114
112
  # Prevents a locked user from logging in, and unlocks users that expired their lock time.
@@ -101,7 +101,7 @@ module Sorcery
101
101
  attributes[config.reset_password_token_expires_at_attribute_name] = Time.now.in_time_zone + config.reset_password_expiration_period if config.reset_password_expiration_period
102
102
  self.class.transaction do
103
103
  self.update_many_attributes(attributes)
104
- generic_send_email(:reset_password_email_method_name, :reset_password_mailer) unless config.reset_password_mailer_disabled
104
+ send_reset_password_email! unless sorcery_config.reset_password_mailer_disabled
105
105
  end
106
106
  end
107
107
 
@@ -113,6 +113,10 @@ module Sorcery
113
113
  end
114
114
 
115
115
  protected
116
+
117
+ def send_reset_password_email!
118
+ generic_send_email(:reset_password_email_method_name, :reset_password_mailer)
119
+ end
116
120
 
117
121
  # Clears the token.
118
122
  def clear_reset_password_token
@@ -54,7 +54,7 @@ module Sorcery
54
54
  # don't setup activation if no password supplied - this user is created automatically
55
55
  before_create :setup_activation, :if => Proc.new { |user| user.send(sorcery_config.password_attribute_name).present? }
56
56
  # don't send activation needed email if no crypted password created - this user is external (OAuth etc.)
57
- after_create :send_activation_needed_email!, :if => Proc.new { |user| !user.external? }
57
+ after_create :send_activation_needed_email!, :if => :send_activation_needed_email?
58
58
  end
59
59
 
60
60
  base.sorcery_config.after_config << :validate_mailer_defined
@@ -111,7 +111,7 @@ module Sorcery
111
111
  config = sorcery_config
112
112
  self.send(:"#{config.activation_token_attribute_name}=", nil)
113
113
  self.send(:"#{config.activation_state_attribute_name}=", "active")
114
- send_activation_success_email! unless self.external?
114
+ send_activation_success_email! if send_activation_success_email?
115
115
  save!(:validate => false) # don't run validations
116
116
  end
117
117
 
@@ -127,11 +127,25 @@ module Sorcery
127
127
 
128
128
  # called automatically after user initial creation.
129
129
  def send_activation_needed_email!
130
- generic_send_email(:activation_needed_email_method_name, :user_activation_mailer) unless sorcery_config.activation_needed_email_method_name.nil? or sorcery_config.activation_mailer_disabled == true
130
+ generic_send_email(:activation_needed_email_method_name, :user_activation_mailer)
131
131
  end
132
132
 
133
133
  def send_activation_success_email!
134
- generic_send_email(:activation_success_email_method_name, :user_activation_mailer) unless sorcery_config.activation_success_email_method_name.nil? or sorcery_config.activation_mailer_disabled == true
134
+ generic_send_email(:activation_success_email_method_name, :user_activation_mailer)
135
+ end
136
+
137
+ def send_activation_success_email?
138
+ !external? && (
139
+ !(sorcery_config.activation_success_email_method_name.nil? ||
140
+ sorcery_config.activation_mailer_disabled == true)
141
+ )
142
+ end
143
+
144
+ def send_activation_needed_email?
145
+ !external? && (
146
+ !(sorcery_config.activation_needed_email_method_name.nil? ||
147
+ sorcery_config.activation_mailer_disabled == true)
148
+ )
135
149
  end
136
150
 
137
151
  def prevent_non_active_login
@@ -15,7 +15,7 @@ module Sorcery
15
15
  end
16
16
 
17
17
  # a patch to fix a bug in testing that happens when you 'destroy' a session twice.
18
- # After the first destroy, the session is an ordinary hash, and then when destroy
18
+ # After the first destroy, the session is an ordinary hash, and then when destroy
19
19
  # is called again there's an exception.
20
20
  class ::Hash
21
21
  def destroy
@@ -23,9 +23,13 @@ module Sorcery
23
23
  end
24
24
  end
25
25
 
26
- def create_new_user(attributes_hash = nil)
26
+ def build_new_user(attributes_hash = nil)
27
27
  user_attributes_hash = attributes_hash || {:username => 'gizmo', :email => "bla@bla.com", :password => 'secret'}
28
28
  @user = User.new(user_attributes_hash)
29
+ end
30
+
31
+ def create_new_user(attributes_hash = nil)
32
+ @user = build_new_user(attributes_hash)
29
33
  @user.save!
30
34
  @user
31
35
  end
@@ -38,6 +42,16 @@ module Sorcery
38
42
  @user
39
43
  end
40
44
 
45
+ def custom_create_new_external_user(provider, authentication_class, attributes_hash = nil)
46
+ authentication_association = authentication_class.name.underscore.pluralize
47
+
48
+ user_attributes_hash = attributes_hash || {:username => 'gizmo'}
49
+ @user = User.new(user_attributes_hash)
50
+ @user.save!
51
+ @user.send(authentication_association).create!({:provider => provider, :uid => 123})
52
+ @user
53
+ end
54
+
41
55
  def sorcery_model_property_set(property, *values)
42
56
  User.class_eval do
43
57
  sorcery_config.send(:"#{property}=", *values)
@@ -49,9 +63,12 @@ module Sorcery
49
63
  # reload user class between specs
50
64
  # so it will be possible to test the different submodules in isolation
51
65
  def reload_user_class
52
- Object.send(:remove_const,:User)
66
+ Object.send(:remove_const, "User")
53
67
  load 'user.rb'
68
+ if User.respond_to?(:reset_column_information)
69
+ User.reset_column_information
70
+ end
54
71
  end
55
72
  end
56
73
  end
57
- end
74
+ end
@@ -5,14 +5,14 @@ module Sorcery
5
5
  include ::Sorcery::TestHelpers::Rails
6
6
 
7
7
  SUBMODUELS_AUTO_ADDED_CONTROLLER_FILTERS = [
8
- :register_last_activity_time_to_db,
9
- :deny_banned_user,
8
+ :register_last_activity_time_to_db,
9
+ :deny_banned_user,
10
10
  :validate_session
11
11
  ]
12
12
 
13
13
  def sorcery_reload!(submodules = [], options = {})
14
14
  reload_user_class
15
-
15
+
16
16
  # return to no-module configuration
17
17
  ::Sorcery::Controller::Config.init!
18
18
  ::Sorcery::Controller::Config.reset!
@@ -20,7 +20,7 @@ module Sorcery
20
20
  # remove all plugin before_filters so they won't fail other tests.
21
21
  # I don't like this way, but I didn't find another.
22
22
  # hopefully it won't break until Rails 4.
23
- ApplicationController._process_action_callbacks.delete_if {|c| SUBMODUELS_AUTO_ADDED_CONTROLLER_FILTERS.include?(c.filter) }
23
+ SorceryController._process_action_callbacks.delete_if {|c| SUBMODUELS_AUTO_ADDED_CONTROLLER_FILTERS.include?(c.filter) }
24
24
 
25
25
  # configure
26
26
  ::Sorcery::Controller::Config.submodules = submodules
@@ -4,8 +4,8 @@ module Sorcery
4
4
  # logins a user and calls all callbacks
5
5
  def login_user(user = nil)
6
6
  user ||= @user
7
- @controller.send(:auto_login,user)
8
- @controller.send(:after_login!,user,[user.send(user.sorcery_config.username_attribute_names.first),'secret'])
7
+ @controller.send(:auto_login, user)
8
+ @controller.send(:after_login!, user, [user.send(user.sorcery_config.username_attribute_names.first), 'secret'])
9
9
  end
10
10
 
11
11
  def logout_user
@@ -1,372 +1,34 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
- # -*- encoding: utf-8 -*-
5
-
6
1
  Gem::Specification.new do |s|
7
2
  s.name = "sorcery"
8
- s.version = "0.8.4"
9
-
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Noam Ben Ari"]
12
- s.date = "2013-11-10"
13
- s.description = "Provides common authentication needs such as signing in/out, activating by email and resetting password."
3
+ s.version = "0.8.5"
4
+ s.authors = ["Noam Ben Ari", "Kir Shatrov"]
14
5
  s.email = "nbenari@gmail.com"
15
- s.extra_rdoc_files = [
16
- "LICENSE.txt",
17
- "README.rdoc"
18
- ]
19
- s.files = [
20
- ".document",
21
- ".rspec",
22
- ".travis.yml",
23
- "Gemfile",
24
- "Gemfile.lock",
25
- "LICENSE.txt",
26
- "README.rdoc",
27
- "Rakefile",
28
- "VERSION",
29
- "lib/generators/sorcery/USAGE",
30
- "lib/generators/sorcery/install_generator.rb",
31
- "lib/generators/sorcery/templates/initializer.rb",
32
- "lib/generators/sorcery/templates/migration/activity_logging.rb",
33
- "lib/generators/sorcery/templates/migration/brute_force_protection.rb",
34
- "lib/generators/sorcery/templates/migration/core.rb",
35
- "lib/generators/sorcery/templates/migration/external.rb",
36
- "lib/generators/sorcery/templates/migration/remember_me.rb",
37
- "lib/generators/sorcery/templates/migration/reset_password.rb",
38
- "lib/generators/sorcery/templates/migration/user_activation.rb",
39
- "lib/sorcery.rb",
40
- "lib/sorcery/controller.rb",
41
- "lib/sorcery/controller/submodules/activity_logging.rb",
42
- "lib/sorcery/controller/submodules/brute_force_protection.rb",
43
- "lib/sorcery/controller/submodules/external.rb",
44
- "lib/sorcery/controller/submodules/external/protocols/certs/ca-bundle.crt",
45
- "lib/sorcery/controller/submodules/external/protocols/oauth1.rb",
46
- "lib/sorcery/controller/submodules/external/protocols/oauth2.rb",
47
- "lib/sorcery/controller/submodules/external/providers/base.rb",
48
- "lib/sorcery/controller/submodules/external/providers/facebook.rb",
49
- "lib/sorcery/controller/submodules/external/providers/github.rb",
50
- "lib/sorcery/controller/submodules/external/providers/google.rb",
51
- "lib/sorcery/controller/submodules/external/providers/linkedin.rb",
52
- "lib/sorcery/controller/submodules/external/providers/liveid.rb",
53
- "lib/sorcery/controller/submodules/external/providers/twitter.rb",
54
- "lib/sorcery/controller/submodules/external/providers/vk.rb",
55
- "lib/sorcery/controller/submodules/external/providers/xing.rb",
56
- "lib/sorcery/controller/submodules/http_basic_auth.rb",
57
- "lib/sorcery/controller/submodules/remember_me.rb",
58
- "lib/sorcery/controller/submodules/session_timeout.rb",
59
- "lib/sorcery/crypto_providers/aes256.rb",
60
- "lib/sorcery/crypto_providers/bcrypt.rb",
61
- "lib/sorcery/crypto_providers/common.rb",
62
- "lib/sorcery/crypto_providers/md5.rb",
63
- "lib/sorcery/crypto_providers/sha1.rb",
64
- "lib/sorcery/crypto_providers/sha256.rb",
65
- "lib/sorcery/crypto_providers/sha512.rb",
66
- "lib/sorcery/engine.rb",
67
- "lib/sorcery/model.rb",
68
- "lib/sorcery/model/adapters/active_record.rb",
69
- "lib/sorcery/model/adapters/mongo_mapper.rb",
70
- "lib/sorcery/model/adapters/mongoid.rb",
71
- "lib/sorcery/model/submodules/activity_logging.rb",
72
- "lib/sorcery/model/submodules/brute_force_protection.rb",
73
- "lib/sorcery/model/submodules/external.rb",
74
- "lib/sorcery/model/submodules/remember_me.rb",
75
- "lib/sorcery/model/submodules/reset_password.rb",
76
- "lib/sorcery/model/submodules/user_activation.rb",
77
- "lib/sorcery/model/temporary_token.rb",
78
- "lib/sorcery/railties/tasks.rake",
79
- "lib/sorcery/test_helpers.rb",
80
- "lib/sorcery/test_helpers/internal.rb",
81
- "lib/sorcery/test_helpers/internal/rails.rb",
82
- "lib/sorcery/test_helpers/rails.rb",
83
- "sorcery.gemspec",
84
- "spec/Gemfile",
85
- "spec/Gemfile.lock",
86
- "spec/README.md",
87
- "spec/Rakefile",
88
- "spec/rails3/.gitignore",
89
- "spec/rails3/.rspec",
90
- "spec/rails3/Gemfile",
91
- "spec/rails3/Gemfile.lock",
92
- "spec/rails3/README",
93
- "spec/rails3/Rakefile",
94
- "spec/rails3/app/controllers/application_controller.rb",
95
- "spec/rails3/app/helpers/application_helper.rb",
96
- "spec/rails3/app/mailers/sorcery_mailer.rb",
97
- "spec/rails3/app/models/authentication.rb",
98
- "spec/rails3/app/models/user.rb",
99
- "spec/rails3/app/views/application/index.html.erb",
100
- "spec/rails3/app/views/layouts/application.html.erb",
101
- "spec/rails3/app/views/sorcery_mailer/activation_email.html.erb",
102
- "spec/rails3/app/views/sorcery_mailer/activation_email.text.erb",
103
- "spec/rails3/app/views/sorcery_mailer/activation_success_email.html.erb",
104
- "spec/rails3/app/views/sorcery_mailer/activation_success_email.text.erb",
105
- "spec/rails3/app/views/sorcery_mailer/reset_password_email.html.erb",
106
- "spec/rails3/app/views/sorcery_mailer/reset_password_email.text.erb",
107
- "spec/rails3/app/views/sorcery_mailer/send_unlock_token_email.text.erb",
108
- "spec/rails3/config.ru",
109
- "spec/rails3/config/application.rb",
110
- "spec/rails3/config/boot.rb",
111
- "spec/rails3/config/database.yml",
112
- "spec/rails3/config/environment.rb",
113
- "spec/rails3/config/environments/development.rb",
114
- "spec/rails3/config/environments/in_memory.rb",
115
- "spec/rails3/config/environments/production.rb",
116
- "spec/rails3/config/environments/test.rb",
117
- "spec/rails3/config/initializers/backtrace_silencers.rb",
118
- "spec/rails3/config/initializers/inflections.rb",
119
- "spec/rails3/config/initializers/mime_types.rb",
120
- "spec/rails3/config/initializers/secret_token.rb",
121
- "spec/rails3/config/initializers/session_store.rb",
122
- "spec/rails3/config/locales/en.yml",
123
- "spec/rails3/config/routes.rb",
124
- "spec/rails3/db/migrate/activation/20101224223622_add_activation_to_users.rb",
125
- "spec/rails3/db/migrate/activity_logging/20101224223624_add_activity_logging_to_users.rb",
126
- "spec/rails3/db/migrate/brute_force_protection/20101224223626_add_brute_force_protection_to_users.rb",
127
- "spec/rails3/db/migrate/core/20101224223620_create_users.rb",
128
- "spec/rails3/db/migrate/external/20101224223628_create_authentications.rb",
129
- "spec/rails3/db/migrate/remember_me/20101224223623_add_remember_me_token_to_users.rb",
130
- "spec/rails3/db/migrate/reset_password/20101224223622_add_reset_password_to_users.rb",
131
- "spec/rails3/db/schema.rb",
132
- "spec/rails3/db/seeds.rb",
133
- "spec/rails3/lib/tasks/.gitkeep",
134
- "spec/rails3/public/404.html",
135
- "spec/rails3/public/422.html",
136
- "spec/rails3/public/500.html",
137
- "spec/rails3/public/favicon.ico",
138
- "spec/rails3/public/images/rails.png",
139
- "spec/rails3/public/javascripts/application.js",
140
- "spec/rails3/public/javascripts/controls.js",
141
- "spec/rails3/public/javascripts/dragdrop.js",
142
- "spec/rails3/public/javascripts/effects.js",
143
- "spec/rails3/public/javascripts/prototype.js",
144
- "spec/rails3/public/javascripts/rails.js",
145
- "spec/rails3/public/robots.txt",
146
- "spec/rails3/public/stylesheets/.gitkeep",
147
- "spec/rails3/script/rails",
148
- "spec/rails3/spec/controller_activity_logging_spec.rb",
149
- "spec/rails3/spec/controller_brute_force_protection_spec.rb",
150
- "spec/rails3/spec/controller_http_basic_auth_spec.rb",
151
- "spec/rails3/spec/controller_oauth2_spec.rb",
152
- "spec/rails3/spec/controller_oauth_spec.rb",
153
- "spec/rails3/spec/controller_remember_me_spec.rb",
154
- "spec/rails3/spec/controller_session_timeout_spec.rb",
155
- "spec/rails3/spec/controller_spec.rb",
156
- "spec/rails3/spec/integration_spec.rb",
157
- "spec/rails3/spec/spec.opts",
158
- "spec/rails3/spec/spec_helper.orig.rb",
159
- "spec/rails3/spec/spec_helper.rb",
160
- "spec/rails3/spec/user_activation_spec.rb",
161
- "spec/rails3/spec/user_activity_logging_spec.rb",
162
- "spec/rails3/spec/user_brute_force_protection_spec.rb",
163
- "spec/rails3/spec/user_oauth_spec.rb",
164
- "spec/rails3/spec/user_remember_me_spec.rb",
165
- "spec/rails3/spec/user_reset_password_spec.rb",
166
- "spec/rails3/spec/user_spec.rb",
167
- "spec/rails3/vendor/plugins/.gitkeep",
168
- "spec/rails3_mongo_mapper/.gitignore",
169
- "spec/rails3_mongo_mapper/.rspec",
170
- "spec/rails3_mongo_mapper/Gemfile",
171
- "spec/rails3_mongo_mapper/Gemfile.lock",
172
- "spec/rails3_mongo_mapper/Rakefile",
173
- "spec/rails3_mongo_mapper/app/controllers/application_controller.rb",
174
- "spec/rails3_mongo_mapper/app/helpers/application_helper.rb",
175
- "spec/rails3_mongo_mapper/app/mailers/sorcery_mailer.rb",
176
- "spec/rails3_mongo_mapper/app/models/authentication.rb",
177
- "spec/rails3_mongo_mapper/app/models/user.rb",
178
- "spec/rails3_mongo_mapper/app/views/layouts/application.html.erb",
179
- "spec/rails3_mongo_mapper/app/views/sorcery_mailer/activation_email.html.erb",
180
- "spec/rails3_mongo_mapper/app/views/sorcery_mailer/activation_email.text.erb",
181
- "spec/rails3_mongo_mapper/app/views/sorcery_mailer/activation_success_email.html.erb",
182
- "spec/rails3_mongo_mapper/app/views/sorcery_mailer/activation_success_email.text.erb",
183
- "spec/rails3_mongo_mapper/app/views/sorcery_mailer/reset_password_email.html.erb",
184
- "spec/rails3_mongo_mapper/app/views/sorcery_mailer/reset_password_email.text.erb",
185
- "spec/rails3_mongo_mapper/config.ru",
186
- "spec/rails3_mongo_mapper/config/application.rb",
187
- "spec/rails3_mongo_mapper/config/boot.rb",
188
- "spec/rails3_mongo_mapper/config/environment.rb",
189
- "spec/rails3_mongo_mapper/config/environments/development.rb",
190
- "spec/rails3_mongo_mapper/config/environments/in_memory.rb",
191
- "spec/rails3_mongo_mapper/config/environments/production.rb",
192
- "spec/rails3_mongo_mapper/config/environments/test.rb",
193
- "spec/rails3_mongo_mapper/config/initializers/backtrace_silencers.rb",
194
- "spec/rails3_mongo_mapper/config/initializers/inflections.rb",
195
- "spec/rails3_mongo_mapper/config/initializers/mime_types.rb",
196
- "spec/rails3_mongo_mapper/config/initializers/mongo.rb",
197
- "spec/rails3_mongo_mapper/config/initializers/secret_token.rb",
198
- "spec/rails3_mongo_mapper/config/initializers/session_store.rb",
199
- "spec/rails3_mongo_mapper/config/locales/en.yml",
200
- "spec/rails3_mongo_mapper/config/routes.rb",
201
- "spec/rails3_mongo_mapper/db/schema.rb",
202
- "spec/rails3_mongo_mapper/db/seeds.rb",
203
- "spec/rails3_mongo_mapper/lib/tasks/.gitkeep",
204
- "spec/rails3_mongo_mapper/public/404.html",
205
- "spec/rails3_mongo_mapper/public/422.html",
206
- "spec/rails3_mongo_mapper/public/500.html",
207
- "spec/rails3_mongo_mapper/public/favicon.ico",
208
- "spec/rails3_mongo_mapper/public/images/rails.png",
209
- "spec/rails3_mongo_mapper/public/javascripts/application.js",
210
- "spec/rails3_mongo_mapper/public/javascripts/controls.js",
211
- "spec/rails3_mongo_mapper/public/javascripts/dragdrop.js",
212
- "spec/rails3_mongo_mapper/public/javascripts/effects.js",
213
- "spec/rails3_mongo_mapper/public/javascripts/prototype.js",
214
- "spec/rails3_mongo_mapper/public/javascripts/rails.js",
215
- "spec/rails3_mongo_mapper/public/robots.txt",
216
- "spec/rails3_mongo_mapper/public/stylesheets/.gitkeep",
217
- "spec/rails3_mongo_mapper/script/rails",
218
- "spec/rails3_mongo_mapper/spec/controller_spec.rb",
219
- "spec/rails3_mongo_mapper/spec/spec.opts",
220
- "spec/rails3_mongo_mapper/spec/spec_helper.orig.rb",
221
- "spec/rails3_mongo_mapper/spec/spec_helper.rb",
222
- "spec/rails3_mongo_mapper/spec/user_activation_spec.rb",
223
- "spec/rails3_mongo_mapper/spec/user_activity_logging_spec.rb",
224
- "spec/rails3_mongo_mapper/spec/user_brute_force_protection_spec.rb",
225
- "spec/rails3_mongo_mapper/spec/user_oauth_spec.rb",
226
- "spec/rails3_mongo_mapper/spec/user_remember_me_spec.rb",
227
- "spec/rails3_mongo_mapper/spec/user_reset_password_spec.rb",
228
- "spec/rails3_mongo_mapper/spec/user_spec.rb",
229
- "spec/rails3_mongo_mapper/vendor/plugins/.gitkeep",
230
- "spec/rails3_mongoid/.gitignore",
231
- "spec/rails3_mongoid/.rspec",
232
- "spec/rails3_mongoid/Gemfile",
233
- "spec/rails3_mongoid/Gemfile.lock",
234
- "spec/rails3_mongoid/Rakefile",
235
- "spec/rails3_mongoid/app/controllers/application_controller.rb",
236
- "spec/rails3_mongoid/app/helpers/application_helper.rb",
237
- "spec/rails3_mongoid/app/mailers/sorcery_mailer.rb",
238
- "spec/rails3_mongoid/app/models/authentication.rb",
239
- "spec/rails3_mongoid/app/models/user.rb",
240
- "spec/rails3_mongoid/app/views/layouts/application.html.erb",
241
- "spec/rails3_mongoid/app/views/sorcery_mailer/activation_email.html.erb",
242
- "spec/rails3_mongoid/app/views/sorcery_mailer/activation_email.text.erb",
243
- "spec/rails3_mongoid/app/views/sorcery_mailer/activation_success_email.html.erb",
244
- "spec/rails3_mongoid/app/views/sorcery_mailer/activation_success_email.text.erb",
245
- "spec/rails3_mongoid/app/views/sorcery_mailer/reset_password_email.html.erb",
246
- "spec/rails3_mongoid/app/views/sorcery_mailer/reset_password_email.text.erb",
247
- "spec/rails3_mongoid/config.ru",
248
- "spec/rails3_mongoid/config/application.rb",
249
- "spec/rails3_mongoid/config/boot.rb",
250
- "spec/rails3_mongoid/config/environment.rb",
251
- "spec/rails3_mongoid/config/environments/development.rb",
252
- "spec/rails3_mongoid/config/environments/in_memory.rb",
253
- "spec/rails3_mongoid/config/environments/production.rb",
254
- "spec/rails3_mongoid/config/environments/test.rb",
255
- "spec/rails3_mongoid/config/initializers/backtrace_silencers.rb",
256
- "spec/rails3_mongoid/config/initializers/inflections.rb",
257
- "spec/rails3_mongoid/config/initializers/mime_types.rb",
258
- "spec/rails3_mongoid/config/initializers/secret_token.rb",
259
- "spec/rails3_mongoid/config/initializers/session_store.rb",
260
- "spec/rails3_mongoid/config/locales/en.yml",
261
- "spec/rails3_mongoid/config/mongoid.yml",
262
- "spec/rails3_mongoid/config/routes.rb",
263
- "spec/rails3_mongoid/db/schema.rb",
264
- "spec/rails3_mongoid/db/seeds.rb",
265
- "spec/rails3_mongoid/lib/tasks/.gitkeep",
266
- "spec/rails3_mongoid/public/404.html",
267
- "spec/rails3_mongoid/public/422.html",
268
- "spec/rails3_mongoid/public/500.html",
269
- "spec/rails3_mongoid/public/favicon.ico",
270
- "spec/rails3_mongoid/public/images/rails.png",
271
- "spec/rails3_mongoid/public/javascripts/application.js",
272
- "spec/rails3_mongoid/public/javascripts/controls.js",
273
- "spec/rails3_mongoid/public/javascripts/dragdrop.js",
274
- "spec/rails3_mongoid/public/javascripts/effects.js",
275
- "spec/rails3_mongoid/public/javascripts/prototype.js",
276
- "spec/rails3_mongoid/public/javascripts/rails.js",
277
- "spec/rails3_mongoid/public/robots.txt",
278
- "spec/rails3_mongoid/public/stylesheets/.gitkeep",
279
- "spec/rails3_mongoid/script/rails",
280
- "spec/rails3_mongoid/spec/controller_activity_logging_spec.rb",
281
- "spec/rails3_mongoid/spec/controller_spec.rb",
282
- "spec/rails3_mongoid/spec/spec.opts",
283
- "spec/rails3_mongoid/spec/spec_helper.orig.rb",
284
- "spec/rails3_mongoid/spec/spec_helper.rb",
285
- "spec/rails3_mongoid/spec/user_activation_spec.rb",
286
- "spec/rails3_mongoid/spec/user_activity_logging_spec.rb",
287
- "spec/rails3_mongoid/spec/user_brute_force_protection_spec.rb",
288
- "spec/rails3_mongoid/spec/user_oauth_spec.rb",
289
- "spec/rails3_mongoid/spec/user_remember_me_spec.rb",
290
- "spec/rails3_mongoid/spec/user_reset_password_spec.rb",
291
- "spec/rails3_mongoid/spec/user_spec.rb",
292
- "spec/rails3_mongoid/vendor/plugins/.gitkeep",
293
- "spec/shared_examples/controller_oauth2_shared_examples.rb",
294
- "spec/shared_examples/controller_oauth_shared_examples.rb",
295
- "spec/shared_examples/user_activation_shared_examples.rb",
296
- "spec/shared_examples/user_activity_logging_shared_examples.rb",
297
- "spec/shared_examples/user_brute_force_protection_shared_examples.rb",
298
- "spec/shared_examples/user_oauth_shared_examples.rb",
299
- "spec/shared_examples/user_remember_me_shared_examples.rb",
300
- "spec/shared_examples/user_reset_password_shared_examples.rb",
301
- "spec/shared_examples/user_shared_examples.rb",
302
- "spec/sorcery_crypto_providers_spec.rb",
303
- "spec/spec.opts",
304
- "spec/spec_helper.rb"
305
- ]
6
+ s.description = "Provides common authentication needs such as signing in/out, activating by email and resetting password."
7
+ s.summary = "Magical authentication for Rails 3 applications"
306
8
  s.homepage = "http://github.com/NoamB/sorcery"
307
- s.licenses = ["MIT"]
9
+
10
+ s.files = `git ls-files`.split($/)
308
11
  s.require_paths = ["lib"]
309
- s.rubygems_version = "1.8.24"
310
- s.summary = "Magical authentication for Rails 3 applications"
311
12
 
312
- if s.respond_to? :specification_version then
313
- s.specification_version = 3
13
+ s.licenses = ["MIT"]
14
+
15
+ s.required_ruby_version = '>= 1.9.3'
16
+
17
+ s.add_dependency("oauth", "~> 0.4.4")
18
+ s.add_dependency("oauth2", ">= 0.8.0", "< 1.0.0")
19
+ s.add_dependency("bcrypt-ruby", ">= 3.0")
314
20
 
315
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
316
- s.add_runtime_dependency(%q<oauth>, ["~> 0.4.4"])
317
- s.add_runtime_dependency(%q<oauth2>, ["~> 0.8.0"])
318
- s.add_runtime_dependency(%q<bcrypt-ruby>, ["~> 3.0.0"])
319
- s.add_development_dependency(%q<abstract>, [">= 1.0.0"])
320
- s.add_development_dependency(%q<rails>, [">= 3.0.0"])
321
- s.add_development_dependency(%q<json>, [">= 1.7.7"])
322
- s.add_development_dependency(%q<rspec>, ["~> 2.5.0"])
323
- s.add_development_dependency(%q<rspec-rails>, ["~> 2.5.0"])
324
- s.add_development_dependency(%q<sqlite3>, [">= 0"])
325
- s.add_development_dependency(%q<yard>, ["~> 0.6.0"])
326
- s.add_development_dependency(%q<bundler>, [">= 1.1.0"])
327
- s.add_development_dependency(%q<jeweler>, ["~> 1.8.3"])
328
- s.add_development_dependency(%q<simplecov>, [">= 0.3.8"])
329
- s.add_development_dependency(%q<timecop>, [">= 0"])
330
- s.add_development_dependency(%q<capybara>, [">= 0"])
331
- s.add_development_dependency(%q<mongo_mapper>, [">= 0"])
332
- s.add_development_dependency(%q<mongoid>, ["~> 2.4.4"])
333
- else
334
- s.add_dependency(%q<oauth>, ["~> 0.4.4"])
335
- s.add_dependency(%q<oauth2>, ["~> 0.8.0"])
336
- s.add_dependency(%q<bcrypt-ruby>, ["~> 3.0.0"])
337
- s.add_dependency(%q<abstract>, [">= 1.0.0"])
338
- s.add_dependency(%q<rails>, [">= 3.0.0"])
339
- s.add_dependency(%q<json>, [">= 1.7.7"])
340
- s.add_dependency(%q<rspec>, ["~> 2.5.0"])
341
- s.add_dependency(%q<rspec-rails>, ["~> 2.5.0"])
342
- s.add_dependency(%q<sqlite3>, [">= 0"])
343
- s.add_dependency(%q<yard>, ["~> 0.6.0"])
344
- s.add_dependency(%q<bundler>, [">= 1.1.0"])
345
- s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
346
- s.add_dependency(%q<simplecov>, [">= 0.3.8"])
347
- s.add_dependency(%q<timecop>, [">= 0"])
348
- s.add_dependency(%q<capybara>, [">= 0"])
349
- s.add_dependency(%q<mongo_mapper>, [">= 0"])
350
- s.add_dependency(%q<mongoid>, ["~> 2.4.4"])
351
- end
352
- else
353
- s.add_dependency(%q<oauth>, ["~> 0.4.4"])
354
- s.add_dependency(%q<oauth2>, ["~> 0.8.0"])
355
- s.add_dependency(%q<bcrypt-ruby>, ["~> 3.0.0"])
356
- s.add_dependency(%q<abstract>, [">= 1.0.0"])
357
- s.add_dependency(%q<rails>, [">= 3.0.0"])
358
- s.add_dependency(%q<json>, [">= 1.7.7"])
359
- s.add_dependency(%q<rspec>, ["~> 2.5.0"])
360
- s.add_dependency(%q<rspec-rails>, ["~> 2.5.0"])
361
- s.add_dependency(%q<sqlite3>, [">= 0"])
362
- s.add_dependency(%q<yard>, ["~> 0.6.0"])
363
- s.add_dependency(%q<bundler>, [">= 1.1.0"])
364
- s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
365
- s.add_dependency(%q<simplecov>, [">= 0.3.8"])
366
- s.add_dependency(%q<timecop>, [">= 0"])
367
- s.add_dependency(%q<capybara>, [">= 0"])
368
- s.add_dependency(%q<mongo_mapper>, [">= 0"])
369
- s.add_dependency(%q<mongoid>, ["~> 2.4.4"])
370
- end
21
+ s.add_development_dependency("abstract", ">= 1.0.0")
22
+ s.add_development_dependency("rails", ">= 3.2.15")
23
+ s.add_development_dependency("json", ">= 1.7.7")
24
+ s.add_development_dependency("rspec", "~> 2.5.0")
25
+ s.add_development_dependency("rspec-rails", "~> 2.5.0")
26
+ s.add_development_dependency("sqlite3", ">= 0")
27
+ s.add_development_dependency("yard", "~> 0.6.0")
28
+ s.add_development_dependency("bundler", ">= 1.1.0")
29
+ s.add_development_dependency("simplecov", ">= 0.3.8")
30
+ s.add_development_dependency("timecop", ">= 0")
31
+ s.add_development_dependency("mongo_mapper", ">= 0")
32
+ s.add_development_dependency("mongoid", "~> 2.4.4")
371
33
  end
372
34