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.
- checksums.yaml +4 -4
- data/.gitignore +54 -0
- data/.travis.yml +13 -1
- data/CHANGELOG.md +234 -0
- data/Gemfile +17 -14
- data/Gemfile.rails4 +24 -0
- data/README.md +300 -0
- data/Rakefile +3 -79
- data/VERSION +1 -1
- data/lib/generators/sorcery/helpers.rb +40 -0
- data/lib/generators/sorcery/install_generator.rb +21 -17
- data/lib/generators/sorcery/templates/initializer.rb +1 -1
- data/lib/generators/sorcery/templates/migration/activity_logging.rb +2 -11
- data/lib/generators/sorcery/templates/migration/brute_force_protection.rb +1 -7
- data/lib/generators/sorcery/templates/migration/core.rb +5 -8
- data/lib/generators/sorcery/templates/migration/external.rb +1 -5
- data/lib/generators/sorcery/templates/migration/remember_me.rb +2 -9
- data/lib/generators/sorcery/templates/migration/reset_password.rb +2 -10
- data/lib/generators/sorcery/templates/migration/user_activation.rb +2 -10
- data/lib/sorcery/controller.rb +16 -4
- data/lib/sorcery/controller/submodules/external.rb +9 -8
- data/lib/sorcery/controller/submodules/external/protocols/oauth2.rb +2 -1
- data/lib/sorcery/controller/submodules/external/providers/facebook.rb +2 -1
- data/lib/sorcery/controller/submodules/external/providers/github.rb +2 -1
- data/lib/sorcery/controller/submodules/external/providers/google.rb +2 -1
- data/lib/sorcery/controller/submodules/external/providers/linkedin.rb +2 -1
- data/lib/sorcery/controller/submodules/external/providers/liveid.rb +2 -1
- data/lib/sorcery/controller/submodules/external/providers/twitter.rb +3 -2
- data/lib/sorcery/controller/submodules/external/providers/vk.rb +2 -1
- data/lib/sorcery/controller/submodules/external/providers/xing.rb +2 -1
- data/lib/sorcery/controller/submodules/remember_me.rb +1 -1
- data/lib/sorcery/controller/submodules/session_timeout.rb +1 -1
- data/lib/sorcery/model.rb +9 -3
- data/lib/sorcery/model/adapters/mongoid.rb +3 -3
- data/lib/sorcery/model/submodules/brute_force_protection.rb +6 -8
- data/lib/sorcery/model/submodules/reset_password.rb +5 -1
- data/lib/sorcery/model/submodules/user_activation.rb +18 -4
- data/lib/sorcery/test_helpers/internal.rb +21 -4
- data/lib/sorcery/test_helpers/internal/rails.rb +4 -4
- data/lib/sorcery/test_helpers/rails.rb +2 -2
- data/sorcery.gemspec +25 -363
- data/spec/{rails3/spec → active_record}/controller_activity_logging_spec.rb +29 -19
- data/spec/active_record/controller_brute_force_protection_spec.rb +136 -0
- data/spec/{rails3/spec → active_record}/controller_http_basic_auth_spec.rb +26 -17
- data/spec/{rails3/spec → active_record}/controller_oauth2_spec.rb +93 -56
- data/spec/{rails3/spec → active_record}/controller_oauth_spec.rb +35 -29
- data/spec/{rails3/spec → active_record}/controller_remember_me_spec.rb +28 -28
- data/spec/{rails3/spec → active_record}/controller_session_timeout_spec.rb +11 -11
- data/spec/{rails3/spec → active_record}/controller_spec.rb +19 -19
- data/spec/{rails3/spec → active_record}/integration_spec.rb +2 -2
- data/spec/{rails3/spec → active_record}/user_activation_spec.rb +8 -6
- data/spec/active_record/user_activity_logging_spec.rb +8 -0
- data/spec/{rails3/spec → active_record}/user_brute_force_protection_spec.rb +5 -4
- data/spec/{rails3/spec → active_record}/user_oauth_spec.rb +5 -4
- data/spec/{rails3/spec → active_record}/user_remember_me_spec.rb +4 -3
- data/spec/{rails3/spec → active_record}/user_reset_password_spec.rb +6 -6
- data/spec/{rails3/spec → active_record}/user_spec.rb +12 -10
- data/spec/{rails3_mongo_mapper/spec → mongo_mapper}/controller_spec.rb +15 -15
- data/spec/mongo_mapper/user_activation_spec.rb +10 -0
- data/spec/mongo_mapper/user_activity_logging_spec.rb +8 -0
- data/spec/mongo_mapper/user_brute_force_protection_spec.rb +8 -0
- data/spec/mongo_mapper/user_oauth_spec.rb +8 -0
- data/spec/mongo_mapper/user_remember_me_spec.rb +8 -0
- data/spec/mongo_mapper/user_reset_password_spec.rb +8 -0
- data/spec/{rails3_mongo_mapper/spec → mongo_mapper}/user_spec.rb +9 -8
- data/spec/{rails3_mongoid/spec → mongoid}/controller_activity_logging_spec.rb +8 -8
- data/spec/{rails3_mongoid/spec → mongoid}/controller_spec.rb +14 -14
- data/spec/mongoid/user_activation_spec.rb +10 -0
- data/spec/mongoid/user_activity_logging_spec.rb +9 -0
- data/spec/mongoid/user_brute_force_protection_spec.rb +9 -0
- data/spec/mongoid/user_oauth_spec.rb +9 -0
- data/spec/mongoid/user_remember_me_spec.rb +9 -0
- data/spec/mongoid/user_reset_password_spec.rb +9 -0
- data/spec/{rails3_mongoid/spec → mongoid}/user_spec.rb +10 -9
- data/spec/orm/active_record.rb +7 -0
- data/spec/orm/mongo_mapper.rb +10 -0
- data/spec/orm/mongoid.rb +17 -0
- data/spec/{rails3/app/models → rails_app/app/active_record}/authentication.rb +0 -0
- data/spec/{rails3/app/models → rails_app/app/active_record}/user.rb +1 -2
- data/spec/rails_app/app/active_record/user_provider.rb +3 -0
- data/spec/{rails3/app/controllers/application_controller.rb → rails_app/app/controllers/sorcery_controller.rb} +26 -15
- data/spec/{rails3 → rails_app}/app/helpers/application_helper.rb +0 -0
- data/spec/{rails3 → rails_app}/app/mailers/sorcery_mailer.rb +0 -0
- data/spec/{rails3_mongo_mapper/app/models → rails_app/app/mongo_mapper}/authentication.rb +0 -0
- data/spec/{rails3_mongo_mapper/app/models → rails_app/app/mongo_mapper}/user.rb +0 -0
- data/spec/{rails3_mongoid/app/models → rails_app/app/mongoid}/authentication.rb +0 -0
- data/spec/{rails3_mongoid/app/models → rails_app/app/mongoid}/user.rb +2 -0
- data/spec/{rails3 → rails_app}/app/views/application/index.html.erb +0 -0
- data/spec/{rails3 → rails_app}/app/views/layouts/application.html.erb +0 -0
- data/spec/{rails3 → rails_app}/app/views/sorcery_mailer/activation_email.html.erb +0 -0
- data/spec/{rails3 → rails_app}/app/views/sorcery_mailer/activation_email.text.erb +0 -0
- 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
- data/spec/{rails3_mongo_mapper → rails_app}/app/views/sorcery_mailer/activation_success_email.html.erb +0 -0
- data/spec/{rails3 → rails_app}/app/views/sorcery_mailer/activation_success_email.text.erb +0 -0
- data/spec/{rails3 → rails_app}/app/views/sorcery_mailer/reset_password_email.html.erb +0 -0
- data/spec/{rails3 → rails_app}/app/views/sorcery_mailer/reset_password_email.text.erb +0 -0
- data/spec/{rails3 → rails_app}/app/views/sorcery_mailer/send_unlock_token_email.text.erb +0 -0
- data/spec/{rails3_mongo_mapper → rails_app}/config.ru +1 -1
- data/spec/{rails3_mongoid → rails_app}/config/application.rb +13 -8
- data/spec/rails_app/config/boot.rb +4 -0
- data/spec/rails_app/config/database.yml +22 -0
- data/spec/{rails3 → rails_app}/config/environment.rb +0 -0
- data/spec/{rails3_mongo_mapper → rails_app}/config/environments/test.rb +2 -0
- data/spec/{rails3 → rails_app}/config/initializers/backtrace_silencers.rb +0 -0
- data/spec/{rails3 → rails_app}/config/initializers/inflections.rb +0 -0
- data/spec/{rails3 → rails_app}/config/initializers/mime_types.rb +0 -0
- data/spec/{rails3 → rails_app}/config/initializers/secret_token.rb +0 -0
- data/spec/{rails3 → rails_app}/config/initializers/session_store.rb +4 -0
- data/spec/{rails3 → rails_app}/config/locales/en.yml +0 -0
- data/spec/rails_app/config/routes.rb +37 -0
- data/spec/{rails3 → rails_app}/db/migrate/activation/20101224223622_add_activation_to_users.rb +3 -3
- data/spec/{rails3 → rails_app}/db/migrate/activity_logging/20101224223624_add_activity_logging_to_users.rb +0 -0
- data/spec/{rails3 → rails_app}/db/migrate/brute_force_protection/20101224223626_add_brute_force_protection_to_users.rb +0 -0
- data/spec/{rails3 → rails_app}/db/migrate/core/20101224223620_create_users.rb +0 -0
- data/spec/rails_app/db/migrate/external/20101224223628_create_authentications_and_user_providers.rb +22 -0
- data/spec/{rails3 → rails_app}/db/migrate/remember_me/20101224223623_add_remember_me_token_to_users.rb +0 -0
- data/spec/{rails3 → rails_app}/db/migrate/reset_password/20101224223622_add_reset_password_to_users.rb +0 -0
- data/spec/{rails3 → rails_app}/db/schema.rb +0 -0
- data/spec/{rails3 → rails_app}/db/seeds.rb +0 -0
- data/spec/{rails3 → rails_app}/public/404.html +0 -0
- data/spec/{rails3 → rails_app}/public/422.html +0 -0
- data/spec/{rails3 → rails_app}/public/500.html +0 -0
- data/spec/{rails3 → rails_app}/public/favicon.ico +0 -0
- data/spec/{rails3 → rails_app}/public/images/rails.png +0 -0
- data/spec/{rails3 → rails_app}/public/javascripts/application.js +0 -0
- data/spec/{rails3 → rails_app}/public/javascripts/controls.js +0 -0
- data/spec/{rails3 → rails_app}/public/javascripts/dragdrop.js +0 -0
- data/spec/{rails3 → rails_app}/public/javascripts/effects.js +0 -0
- data/spec/{rails3 → rails_app}/public/javascripts/prototype.js +0 -0
- data/spec/{rails3 → rails_app}/public/javascripts/rails.js +0 -0
- data/spec/{rails3 → rails_app}/public/robots.txt +0 -0
- data/spec/{rails3/lib/tasks → rails_app/public/stylesheets}/.gitkeep +0 -0
- data/spec/shared_examples/controller_oauth_shared_examples.rb +22 -8
- data/spec/shared_examples/user_activation_shared_examples.rb +49 -27
- data/spec/shared_examples/user_reset_password_shared_examples.rb +33 -21
- data/spec/shared_examples/user_shared_examples.rb +65 -50
- data/spec/sorcery_crypto_providers_spec.rb +47 -45
- data/spec/spec_helper.rb +38 -4
- metadata +117 -254
- data/Gemfile.lock +0 -175
- data/README.rdoc +0 -261
- data/spec/Gemfile +0 -12
- data/spec/Gemfile.lock +0 -129
- data/spec/README.md +0 -31
- data/spec/Rakefile +0 -12
- data/spec/rails3/.gitignore +0 -4
- data/spec/rails3/.rspec +0 -1
- data/spec/rails3/Gemfile +0 -15
- data/spec/rails3/Gemfile.lock +0 -162
- data/spec/rails3/README +0 -256
- data/spec/rails3/Rakefile +0 -11
- data/spec/rails3/config.ru +0 -4
- data/spec/rails3/config/application.rb +0 -46
- data/spec/rails3/config/boot.rb +0 -13
- data/spec/rails3/config/database.yml +0 -27
- data/spec/rails3/config/environments/development.rb +0 -26
- data/spec/rails3/config/environments/in_memory.rb +0 -35
- data/spec/rails3/config/environments/production.rb +0 -49
- data/spec/rails3/config/environments/test.rb +0 -35
- data/spec/rails3/config/routes.rb +0 -59
- data/spec/rails3/db/migrate/external/20101224223628_create_authentications.rb +0 -14
- data/spec/rails3/public/stylesheets/.gitkeep +0 -0
- data/spec/rails3/script/rails +0 -6
- data/spec/rails3/spec/controller_brute_force_protection_spec.rb +0 -96
- data/spec/rails3/spec/spec.opts +0 -2
- data/spec/rails3/spec/spec_helper.orig.rb +0 -27
- data/spec/rails3/spec/spec_helper.rb +0 -71
- data/spec/rails3/spec/user_activity_logging_spec.rb +0 -8
- data/spec/rails3/vendor/plugins/.gitkeep +0 -0
- data/spec/rails3_mongo_mapper/.gitignore +0 -4
- data/spec/rails3_mongo_mapper/.rspec +0 -1
- data/spec/rails3_mongo_mapper/Gemfile +0 -16
- data/spec/rails3_mongo_mapper/Gemfile.lock +0 -156
- data/spec/rails3_mongo_mapper/Rakefile +0 -11
- data/spec/rails3_mongo_mapper/app/controllers/application_controller.rb +0 -122
- data/spec/rails3_mongo_mapper/app/helpers/application_helper.rb +0 -2
- data/spec/rails3_mongo_mapper/app/mailers/sorcery_mailer.rb +0 -25
- data/spec/rails3_mongo_mapper/app/views/layouts/application.html.erb +0 -14
- data/spec/rails3_mongo_mapper/app/views/sorcery_mailer/activation_email.html.erb +0 -17
- data/spec/rails3_mongo_mapper/app/views/sorcery_mailer/activation_email.text.erb +0 -9
- data/spec/rails3_mongo_mapper/app/views/sorcery_mailer/activation_success_email.text.erb +0 -9
- data/spec/rails3_mongo_mapper/app/views/sorcery_mailer/reset_password_email.html.erb +0 -16
- data/spec/rails3_mongo_mapper/app/views/sorcery_mailer/reset_password_email.text.erb +0 -8
- data/spec/rails3_mongo_mapper/config/application.rb +0 -51
- data/spec/rails3_mongo_mapper/config/boot.rb +0 -13
- data/spec/rails3_mongo_mapper/config/environment.rb +0 -5
- data/spec/rails3_mongo_mapper/config/environments/development.rb +0 -30
- data/spec/rails3_mongo_mapper/config/environments/in_memory.rb +0 -0
- data/spec/rails3_mongo_mapper/config/environments/production.rb +0 -49
- data/spec/rails3_mongo_mapper/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/rails3_mongo_mapper/config/initializers/inflections.rb +0 -10
- data/spec/rails3_mongo_mapper/config/initializers/mime_types.rb +0 -5
- data/spec/rails3_mongo_mapper/config/initializers/mongo.rb +0 -2
- data/spec/rails3_mongo_mapper/config/initializers/secret_token.rb +0 -7
- data/spec/rails3_mongo_mapper/config/initializers/session_store.rb +0 -8
- data/spec/rails3_mongo_mapper/config/locales/en.yml +0 -5
- data/spec/rails3_mongo_mapper/config/routes.rb +0 -59
- data/spec/rails3_mongo_mapper/db/schema.rb +0 -23
- data/spec/rails3_mongo_mapper/db/seeds.rb +0 -7
- data/spec/rails3_mongo_mapper/lib/tasks/.gitkeep +0 -0
- data/spec/rails3_mongo_mapper/public/404.html +0 -26
- data/spec/rails3_mongo_mapper/public/422.html +0 -26
- data/spec/rails3_mongo_mapper/public/500.html +0 -26
- data/spec/rails3_mongo_mapper/public/favicon.ico +0 -0
- data/spec/rails3_mongo_mapper/public/images/rails.png +0 -0
- data/spec/rails3_mongo_mapper/public/javascripts/application.js +0 -2
- data/spec/rails3_mongo_mapper/public/javascripts/controls.js +0 -965
- data/spec/rails3_mongo_mapper/public/javascripts/dragdrop.js +0 -974
- data/spec/rails3_mongo_mapper/public/javascripts/effects.js +0 -1123
- data/spec/rails3_mongo_mapper/public/javascripts/prototype.js +0 -6001
- data/spec/rails3_mongo_mapper/public/javascripts/rails.js +0 -175
- data/spec/rails3_mongo_mapper/public/robots.txt +0 -5
- data/spec/rails3_mongo_mapper/public/stylesheets/.gitkeep +0 -0
- data/spec/rails3_mongo_mapper/script/rails +0 -6
- data/spec/rails3_mongo_mapper/spec/spec.opts +0 -2
- data/spec/rails3_mongo_mapper/spec/spec_helper.orig.rb +0 -27
- data/spec/rails3_mongo_mapper/spec/spec_helper.rb +0 -55
- data/spec/rails3_mongo_mapper/spec/user_activation_spec.rb +0 -9
- data/spec/rails3_mongo_mapper/spec/user_activity_logging_spec.rb +0 -8
- data/spec/rails3_mongo_mapper/spec/user_brute_force_protection_spec.rb +0 -8
- data/spec/rails3_mongo_mapper/spec/user_oauth_spec.rb +0 -8
- data/spec/rails3_mongo_mapper/spec/user_remember_me_spec.rb +0 -8
- data/spec/rails3_mongo_mapper/spec/user_reset_password_spec.rb +0 -8
- data/spec/rails3_mongo_mapper/vendor/plugins/.gitkeep +0 -0
- data/spec/rails3_mongoid/.gitignore +0 -4
- data/spec/rails3_mongoid/.rspec +0 -1
- data/spec/rails3_mongoid/Gemfile +0 -15
- data/spec/rails3_mongoid/Gemfile.lock +0 -146
- data/spec/rails3_mongoid/Rakefile +0 -11
- data/spec/rails3_mongoid/app/controllers/application_controller.rb +0 -127
- data/spec/rails3_mongoid/app/helpers/application_helper.rb +0 -2
- data/spec/rails3_mongoid/app/mailers/sorcery_mailer.rb +0 -25
- data/spec/rails3_mongoid/app/views/layouts/application.html.erb +0 -14
- data/spec/rails3_mongoid/app/views/sorcery_mailer/activation_email.html.erb +0 -17
- data/spec/rails3_mongoid/app/views/sorcery_mailer/activation_email.text.erb +0 -9
- data/spec/rails3_mongoid/app/views/sorcery_mailer/activation_success_email.html.erb +0 -17
- data/spec/rails3_mongoid/app/views/sorcery_mailer/activation_success_email.text.erb +0 -9
- data/spec/rails3_mongoid/app/views/sorcery_mailer/reset_password_email.html.erb +0 -16
- data/spec/rails3_mongoid/app/views/sorcery_mailer/reset_password_email.text.erb +0 -8
- data/spec/rails3_mongoid/config.ru +0 -4
- data/spec/rails3_mongoid/config/boot.rb +0 -13
- data/spec/rails3_mongoid/config/environment.rb +0 -5
- data/spec/rails3_mongoid/config/environments/development.rb +0 -26
- data/spec/rails3_mongoid/config/environments/in_memory.rb +0 -0
- data/spec/rails3_mongoid/config/environments/production.rb +0 -49
- data/spec/rails3_mongoid/config/environments/test.rb +0 -35
- data/spec/rails3_mongoid/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/rails3_mongoid/config/initializers/inflections.rb +0 -10
- data/spec/rails3_mongoid/config/initializers/mime_types.rb +0 -5
- data/spec/rails3_mongoid/config/initializers/secret_token.rb +0 -7
- data/spec/rails3_mongoid/config/initializers/session_store.rb +0 -8
- data/spec/rails3_mongoid/config/locales/en.yml +0 -5
- data/spec/rails3_mongoid/config/mongoid.yml +0 -7
- data/spec/rails3_mongoid/config/routes.rb +0 -59
- data/spec/rails3_mongoid/db/schema.rb +0 -23
- data/spec/rails3_mongoid/db/seeds.rb +0 -7
- data/spec/rails3_mongoid/lib/tasks/.gitkeep +0 -0
- data/spec/rails3_mongoid/public/404.html +0 -26
- data/spec/rails3_mongoid/public/422.html +0 -26
- data/spec/rails3_mongoid/public/500.html +0 -26
- data/spec/rails3_mongoid/public/favicon.ico +0 -0
- data/spec/rails3_mongoid/public/images/rails.png +0 -0
- data/spec/rails3_mongoid/public/javascripts/application.js +0 -2
- data/spec/rails3_mongoid/public/javascripts/controls.js +0 -965
- data/spec/rails3_mongoid/public/javascripts/dragdrop.js +0 -974
- data/spec/rails3_mongoid/public/javascripts/effects.js +0 -1123
- data/spec/rails3_mongoid/public/javascripts/prototype.js +0 -6001
- data/spec/rails3_mongoid/public/javascripts/rails.js +0 -175
- data/spec/rails3_mongoid/public/robots.txt +0 -5
- data/spec/rails3_mongoid/public/stylesheets/.gitkeep +0 -0
- data/spec/rails3_mongoid/script/rails +0 -6
- data/spec/rails3_mongoid/spec/spec.opts +0 -2
- data/spec/rails3_mongoid/spec/spec_helper.orig.rb +0 -27
- data/spec/rails3_mongoid/spec/spec_helper.rb +0 -55
- data/spec/rails3_mongoid/spec/user_activation_spec.rb +0 -9
- data/spec/rails3_mongoid/spec/user_activity_logging_spec.rb +0 -8
- data/spec/rails3_mongoid/spec/user_brute_force_protection_spec.rb +0 -8
- data/spec/rails3_mongoid/spec/user_oauth_spec.rb +0 -8
- data/spec/rails3_mongoid/spec/user_remember_me_spec.rb +0 -8
- data/spec/rails3_mongoid/spec/user_reset_password_spec.rb +0 -8
- data/spec/rails3_mongoid/vendor/plugins/.gitkeep +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ece0272de9fa2ea03bbc1be9b2f9aa3b80e0f870
|
4
|
+
data.tar.gz: 5369015b55c79aab6aeeeae13328624a8e20b7c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a45a1696ebbcf7e4e8e248918389a38ea4555c263f12e290b1fdfd92c4e413d9713c29bbe98aa909ab9cb8642ff3e872a15405e6db9398afdf4f940521f68d5
|
7
|
+
data.tar.gz: aed312b559bbdecd335535df0814989b906d4768fe56382ae18a029f534fb0d9904e8540913e2c6dccc51de9d5e8d2096212a3dbf7f6b787df647987aa72076a
|
data/.gitignore
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
# rcov generated
|
2
|
+
coverage
|
3
|
+
|
4
|
+
# rdoc generated
|
5
|
+
rdoc
|
6
|
+
|
7
|
+
# yard generated
|
8
|
+
doc
|
9
|
+
.yardoc
|
10
|
+
|
11
|
+
# bundler
|
12
|
+
.bundle
|
13
|
+
|
14
|
+
# jeweler generated
|
15
|
+
pkg
|
16
|
+
|
17
|
+
# for RVM
|
18
|
+
.rvmrc
|
19
|
+
|
20
|
+
# for RubyMine
|
21
|
+
.idea
|
22
|
+
|
23
|
+
# Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
|
24
|
+
#
|
25
|
+
# * Create a file at ~/.gitignore
|
26
|
+
# * Include files you want ignored
|
27
|
+
# * Run: git config --global core.excludesfile ~/.gitignore
|
28
|
+
#
|
29
|
+
# After doing this, these files will be ignored in all your git projects,
|
30
|
+
# saving you from having to 'pollute' every project you touch with them
|
31
|
+
#
|
32
|
+
# Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line)
|
33
|
+
#
|
34
|
+
# For MacOS:
|
35
|
+
#
|
36
|
+
#.DS_Store
|
37
|
+
#
|
38
|
+
# For TextMate
|
39
|
+
#*.tmproj
|
40
|
+
tmtags
|
41
|
+
#
|
42
|
+
# For emacs:
|
43
|
+
#*~
|
44
|
+
#\#*
|
45
|
+
#.\#*
|
46
|
+
#
|
47
|
+
# For vim:
|
48
|
+
#*.swp
|
49
|
+
#
|
50
|
+
spec/rails_app/log/*
|
51
|
+
*.log
|
52
|
+
*.sqlite3
|
53
|
+
Gemfile*.lock
|
54
|
+
.ruby-version
|
data/.travis.yml
CHANGED
@@ -1,3 +1,15 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
|
-
- 1.9.
|
3
|
+
- 1.9.3
|
4
|
+
- 2.0.0
|
5
|
+
|
6
|
+
services: mongodb
|
7
|
+
|
8
|
+
gemfile:
|
9
|
+
- Gemfile
|
10
|
+
- Gemfile.rails4
|
11
|
+
|
12
|
+
script:
|
13
|
+
- "SORCERY_ORM=active_record bundle exec rake spec SPEC=spec/active_record"
|
14
|
+
- "SORCERY_ORM=mongoid bundle exec rake spec SPEC=spec/mongoid"
|
15
|
+
- "SORCERY_ORM=mongo_mapper bundle exec rake spec SPEC=spec/mongo_mapper"
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,234 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
## 0.8.5 (not released)
|
4
|
+
* Fixed add_provider_to_user with CamelCased authentications_class model (#382)
|
5
|
+
* Fixed unlock_token_mailer_disabled to only disable automatic mailing (#467)
|
6
|
+
* Make send_email_* methods easier to overwrite (#473)
|
7
|
+
* Don't add `:username` field for User. Config option `username_attribute_names` is now `:email` by default instead of `:username`.
|
8
|
+
|
9
|
+
If you're using `username` as main field for users to login, you'll need to tune your Sorcery config:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
config.user_config do |user|
|
13
|
+
# ...
|
14
|
+
user.username_attribute_names = [:username]
|
15
|
+
end
|
16
|
+
```
|
17
|
+
* `rails generate sorcery:install` now works inside Rails engine
|
18
|
+
|
19
|
+
## 0.8.4
|
20
|
+
|
21
|
+
* Few security fixes in `external` module
|
22
|
+
|
23
|
+
## 0.8.3 (yanked because of bad Jeweler release)
|
24
|
+
|
25
|
+
## 0.8.2
|
26
|
+
|
27
|
+
* Activity logging feature has a new column called `last_login_from_ip_address` (string type). If you use ActiveRecord, you will have to add this column to DB ([#465](https://github.com/NoamB/sorcery/issues/465))
|
28
|
+
|
29
|
+
## 0.8.1
|
30
|
+
<!-- TO BE WRITTEN -->
|
31
|
+
|
32
|
+
## 0.8.0
|
33
|
+
<!-- TO BE WRITTEN -->
|
34
|
+
|
35
|
+
## 0.7.13
|
36
|
+
<!-- TO BE WRITTEN -->
|
37
|
+
|
38
|
+
## 0.7.12
|
39
|
+
<!-- TO BE WRITTEN -->
|
40
|
+
|
41
|
+
## 0.7.11
|
42
|
+
<!-- TO BE WRITTEN -->
|
43
|
+
|
44
|
+
## 0.7.10
|
45
|
+
<!-- TO BE WRITTEN -->
|
46
|
+
|
47
|
+
## 0.7.9
|
48
|
+
<!-- TO BE WRITTEN -->
|
49
|
+
|
50
|
+
## 0.7.8
|
51
|
+
<!-- TO BE WRITTEN -->
|
52
|
+
|
53
|
+
## 0.7.7
|
54
|
+
<!-- TO BE WRITTEN -->
|
55
|
+
|
56
|
+
## 0.7.6
|
57
|
+
<!-- TO BE WRITTEN -->
|
58
|
+
|
59
|
+
## 0.7.5
|
60
|
+
<!-- TO BE WRITTEN -->
|
61
|
+
|
62
|
+
## 0.7.1-0.7.4
|
63
|
+
|
64
|
+
* Fixed a bug in the new generator
|
65
|
+
* Many bugfixes
|
66
|
+
* MongoMapper added to supported ORMs list, thanks @kbighorse
|
67
|
+
* Sinatra support discontinued!
|
68
|
+
* New generator contributed by @ahazem
|
69
|
+
* Cookie domain setting contributed by @Highcode
|
70
|
+
|
71
|
+
|
72
|
+
## 0.7.0
|
73
|
+
|
74
|
+
* Many bugfixes
|
75
|
+
* Added default SSL certificate for oauth2
|
76
|
+
* Added multi-username ability
|
77
|
+
* Security fixes (CSRF, cookie digesting)
|
78
|
+
* Added auto_login(user) to the API
|
79
|
+
* Updated gem versions of oauth(1/2)
|
80
|
+
* Added logged_in? as a view helper
|
81
|
+
* Github provider added to external submodule
|
82
|
+
|
83
|
+
|
84
|
+
## 0.6.1
|
85
|
+
|
86
|
+
Gemfile versions updated due to public demand.
|
87
|
+
(bcrypt 3.0.0 and oauth2 0.4.1)
|
88
|
+
|
89
|
+
|
90
|
+
## 0.6.0
|
91
|
+
|
92
|
+
Fixes issues with external user_hash not including some fields, and an issue with User model not loaded when user_class is called. Now config.user_class should be a string or a symbol.
|
93
|
+
|
94
|
+
Improved specs.
|
95
|
+
|
96
|
+
## 0.5.3
|
97
|
+
|
98
|
+
Fixed #9
|
99
|
+
Fixed hardcoded method names in remember_me submodule.
|
100
|
+
Improved specs.
|
101
|
+
|
102
|
+
## 0.5.21
|
103
|
+
|
104
|
+
Fixed typo in initializer - MUST be "config.user_class = User"
|
105
|
+
|
106
|
+
## 0.5.2
|
107
|
+
|
108
|
+
Fixed #3 and #4 - Modular Sinatra apps work now, and User model isn't cached in development mode.
|
109
|
+
|
110
|
+
## 0.5.1
|
111
|
+
|
112
|
+
Fixed bug in reset_password - after reset can't login due to bad salt creation. Affected only Mongoid.
|
113
|
+
|
114
|
+
## 0.5.0
|
115
|
+
|
116
|
+
Added support for Mongoid! (still buggy and not recommended for serious use)
|
117
|
+
|
118
|
+
'reset_password!(:password => new_password)' changed into 'change_password!(new_password)'
|
119
|
+
|
120
|
+
## 0.4.2
|
121
|
+
|
122
|
+
Added test helpers for Rails 3 & Sinatra.
|
123
|
+
|
124
|
+
## 0.4.1
|
125
|
+
|
126
|
+
Fixing Rails app name in initializer.
|
127
|
+
|
128
|
+
## 0.4.0
|
129
|
+
|
130
|
+
Changed the way Sorcery is configured.
|
131
|
+
Now inside the model only add:
|
132
|
+
|
133
|
+
```
|
134
|
+
authenticates_with_sorcery!
|
135
|
+
```
|
136
|
+
|
137
|
+
In the controller no code is needed! All configuration is done in an initializer.
|
138
|
+
Added a rake task to create it.
|
139
|
+
|
140
|
+
```
|
141
|
+
rake sorcery:bootstrap
|
142
|
+
```
|
143
|
+
|
144
|
+
## 0.3.1
|
145
|
+
|
146
|
+
Renamed "oauth" module to "external" and made API prettier.
|
147
|
+
```
|
148
|
+
auth_at_provider(provider) => login_at(provider)
|
149
|
+
login_from_access_token(provider) => login_from(provider)
|
150
|
+
create_from_provider!(provider) => create_from(provider)
|
151
|
+
```
|
152
|
+
|
153
|
+
## 0.3.0
|
154
|
+
|
155
|
+
Added Sinatra support!
|
156
|
+
|
157
|
+
|
158
|
+
Added Rails 3 generator for migrations
|
159
|
+
|
160
|
+
|
161
|
+
## 0.2.1
|
162
|
+
|
163
|
+
Fixed bug with OAuth submodule - oauth gems were not required properly in gem.
|
164
|
+
|
165
|
+
|
166
|
+
Fixed bug with OAuth submodule - Authentications class was not passed between model and controller in all cases resulting in Nil exception.
|
167
|
+
|
168
|
+
|
169
|
+
## 0.2.0
|
170
|
+
|
171
|
+
Added OAuth submodule.
|
172
|
+
|
173
|
+
### OAuth:
|
174
|
+
* OAuth1 and OAuth2 support (currently twitter & facebook)
|
175
|
+
* configurable db field names and authentications table.
|
176
|
+
|
177
|
+
Some bug fixes: 'return_to' feature, brute force permanent ban.
|
178
|
+
|
179
|
+
|
180
|
+
## 0.1.4
|
181
|
+
|
182
|
+
Added activity logging submodule.
|
183
|
+
|
184
|
+
|
185
|
+
### Activity Logging:
|
186
|
+
* automatic logging of last login, last logout and last activity time.
|
187
|
+
* an easy method of collecting the list of currently logged in users.
|
188
|
+
* configurable timeout by which to decide whether to include a user in the list of logged in users.
|
189
|
+
|
190
|
+
|
191
|
+
Fixed bug in basic_auth - it didn't set the session[:user_id] on successful login and tried to relogin from basic_auth on every action.
|
192
|
+
|
193
|
+
|
194
|
+
Added Reset Password hammering protection and updated the API.
|
195
|
+
|
196
|
+
|
197
|
+
Totally rewritten Brute Force Protection submodule.
|
198
|
+
|
199
|
+
|
200
|
+
## 0.1.3
|
201
|
+
|
202
|
+
Added support for Basic HTTP Auth.
|
203
|
+
|
204
|
+
## 0.1.2
|
205
|
+
|
206
|
+
Separated mailers between user_activation and password_reset and updated readme.
|
207
|
+
|
208
|
+
## 0.1.1
|
209
|
+
|
210
|
+
Fixed bug with BCrypt not being used properly by the lib and thus not working for authentication.
|
211
|
+
|
212
|
+
## 0.1.0
|
213
|
+
|
214
|
+
### Core Features:
|
215
|
+
* login/logout, optional redirect on login to where the user tried to reach before, configurable redirect for non-logged-in users.
|
216
|
+
* password encryption, algorithms: bcrypt(default), md5, sha1, sha256, sha512, aes256, custom(yours!), none. Configurable stretches and salt.
|
217
|
+
* configurable attribute names for username, password and email.
|
218
|
+
### User Activation:
|
219
|
+
* User activation by email with optional success email.
|
220
|
+
* configurable attribute names.
|
221
|
+
* configurable mailer.
|
222
|
+
* Optionally prevent active users to login.
|
223
|
+
### Password Reset:
|
224
|
+
* Reset password with email verification.
|
225
|
+
* configurable mailer, method name, and attribute name.
|
226
|
+
### Remember Me:
|
227
|
+
* Remember me with configurable expiration.
|
228
|
+
* configurable attribute names.
|
229
|
+
## Session Timeout:
|
230
|
+
* Configurable session timeout.
|
231
|
+
* Optionally session timeout will be calculated from last user action.
|
232
|
+
### Brute Force Protection:
|
233
|
+
* Brute force login hammering protection.
|
234
|
+
* configurable logins before ban, logins within time period before ban, ban time and ban action.
|
data/Gemfile
CHANGED
@@ -8,20 +8,23 @@ gem 'bcrypt-ruby', "~> 3.0.0"
|
|
8
8
|
|
9
9
|
# Add dependencies to develop your gem here.
|
10
10
|
# Include everything needed to run rake, tests, features, etc.
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
gem 'capybara'
|
11
|
+
|
12
|
+
gem 'abstract', '>= 1.0.0'
|
13
|
+
gem "rails", "~> 3.2.15"
|
14
|
+
gem 'json', ">= 1.7.7"
|
15
|
+
gem "rspec", "~> 2.14.0"
|
16
|
+
gem 'rspec-rails', "~> 2.14.0"
|
17
|
+
gem 'sqlite3'
|
18
|
+
gem "yard", "~> 0.6.0"
|
19
|
+
gem "bundler", ">= 1.1.0"
|
20
|
+
gem 'simplecov', '>= 0.3.8', :require => false # Will install simplecov-html as a dependency
|
21
|
+
gem 'timecop'
|
22
|
+
|
23
|
+
group :mongomapper do
|
25
24
|
gem 'mongo_mapper'
|
25
|
+
end
|
26
|
+
|
27
|
+
group :mongoid do
|
26
28
|
gem 'mongoid', "~> 2.4.4"
|
29
|
+
gem 'bson_ext'
|
27
30
|
end
|
data/Gemfile.rails4
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
gem 'oauth', "~> 0.4.4"
|
4
|
+
gem 'oauth2', "~> 0.8.0"
|
5
|
+
gem 'bcrypt-ruby', "~> 3.0.0"
|
6
|
+
|
7
|
+
gem "rspec", "~> 2.14.0"
|
8
|
+
gem 'rspec-rails', "~> 2.14.0"
|
9
|
+
#gem 'ruby-debug19'
|
10
|
+
gem 'sqlite3'
|
11
|
+
gem "yard", "~> 0.6.0"
|
12
|
+
gem "bundler", ">= 1.1.0"
|
13
|
+
gem 'timecop'
|
14
|
+
|
15
|
+
group :mongomapper do
|
16
|
+
gem 'mongo_mapper', github: 'jnunemaker/mongomapper'
|
17
|
+
end
|
18
|
+
|
19
|
+
group :mongoid do
|
20
|
+
gem 'mongoid', github: 'mongoid/mongoid', ref: 'f91feef0a0c6b83a1b878e154f1014536aa1c298'
|
21
|
+
gem 'bson_ext'
|
22
|
+
end
|
23
|
+
|
24
|
+
gem 'rails', '~> 4.0.1'
|
data/README.md
ADDED
@@ -0,0 +1,300 @@
|
|
1
|
+
[<img src="https://secure.travis-ci.org/NoamB/sorcery.png"
|
2
|
+
/>](http://travis-ci.org/NoamB/sorcery) [<img
|
3
|
+
src="https://codeclimate.com/github/NoamB/sorcery.png"
|
4
|
+
/>](https://codeclimate.com/github/NoamB/sorcery)
|
5
|
+
|
6
|
+
# sorcery
|
7
|
+
Magical Authentication for Rails 3 and 4. Supports ActiveRecord, Mongoid and
|
8
|
+
MongoMapper.
|
9
|
+
|
10
|
+
Inspired by restful_authentication, Authlogic and Devise. Crypto code taken
|
11
|
+
almost unchanged from Authlogic. OAuth code inspired by OmniAuth and Ryan
|
12
|
+
Bates's railscasts about it.
|
13
|
+
|
14
|
+
**Rails 4 status:** basicly it works without issues, except
|
15
|
+
[the issue with protect_from_forgery](https://github.com/NoamB/sorcery/issues/464).
|
16
|
+
We will release new version soon, which will be updated for Rails 4.
|
17
|
+
|
18
|
+
https://github.com/NoamB/sorcery/wiki/Simple-Password-Authentication
|
19
|
+
|
20
|
+
## Philosophy
|
21
|
+
|
22
|
+
Sorcery is a stripped-down, bare-bones authentication library, with which you
|
23
|
+
can write your own authentication flow. It was built with a few goals in mind:
|
24
|
+
|
25
|
+
* Less is more - less than 20 public methods to remember for the entire
|
26
|
+
feature-set make the lib easy to 'get'.
|
27
|
+
* No built-in or generated code - use the library's methods inside *your
|
28
|
+
own* MVC structures, and don't fight to fix someone else's.
|
29
|
+
* Magic yes, Voodoo no - the lib should be easy to hack for most developers.
|
30
|
+
* Configuration over Confusion - Centralized (1 file), Simple & short
|
31
|
+
configuration as possible, not drowning in syntactic sugar.
|
32
|
+
* Keep MVC cleanly separated - DB is for models, sessions are for
|
33
|
+
controllers. Models stay unaware of sessions.
|
34
|
+
|
35
|
+
|
36
|
+
Hopefully, I've achieved this. If not, let me know.
|
37
|
+
|
38
|
+
## Useful Links:
|
39
|
+
|
40
|
+
Railscast: http://railscasts.com/episodes/283-authentication-with-sorcery
|
41
|
+
|
42
|
+
Example Rails 3 app using sorcery:
|
43
|
+
https://github.com/NoamB/sorcery-example-app
|
44
|
+
|
45
|
+
Documentation: http://rubydoc.info/gems/sorcery
|
46
|
+
|
47
|
+
Check out the tutorials in the github wiki!
|
48
|
+
|
49
|
+
## API Summary
|
50
|
+
|
51
|
+
Below is a summary of the library methods. Most method names are self
|
52
|
+
explaining and the rest are commented:
|
53
|
+
|
54
|
+
# core
|
55
|
+
require_login # this is a before filter
|
56
|
+
login(email, password, remember_me = false)
|
57
|
+
auto_login(user)# login without credentials
|
58
|
+
logout
|
59
|
+
logged_in? # available to view
|
60
|
+
current_user # available to view
|
61
|
+
redirect_back_or_to # used when a user tries to access a page while logged out, is asked to login, and we want to return him back to the page he originally wanted.
|
62
|
+
@user.external? # external users, such as facebook/twitter etc.
|
63
|
+
User.authenticates_with_sorcery!
|
64
|
+
|
65
|
+
# activity logging
|
66
|
+
current_users
|
67
|
+
|
68
|
+
# http basic auth
|
69
|
+
require_login_from_http_basic # this is a before filter
|
70
|
+
|
71
|
+
# external
|
72
|
+
login_at(provider) # sends the user to an external service (twitter etc.) to authenticate.
|
73
|
+
login_from(provider) # tries to login from the external provider's callback.
|
74
|
+
create_from(provider) # create the user in the local app db.
|
75
|
+
|
76
|
+
# remember me
|
77
|
+
auto_login(user, should_remember=false) # login without credentials, optional remember_me
|
78
|
+
remember_me!
|
79
|
+
forget_me!
|
80
|
+
|
81
|
+
# reset password
|
82
|
+
User.load_from_reset_password_token(token)
|
83
|
+
@user.deliver_reset_password_instructions!
|
84
|
+
@user.change_password!(new_password)
|
85
|
+
|
86
|
+
# user activation
|
87
|
+
User.load_from_activation_token(token)
|
88
|
+
@user.activate!
|
89
|
+
|
90
|
+
Please see the tutorials in the github wiki for detailed usage information.
|
91
|
+
|
92
|
+
## Installation:
|
93
|
+
|
94
|
+
If using bundler, first add 'sorcery' to your Gemfile:
|
95
|
+
|
96
|
+
gem "sorcery"
|
97
|
+
|
98
|
+
And run
|
99
|
+
|
100
|
+
bundle install
|
101
|
+
|
102
|
+
Otherwise simply
|
103
|
+
|
104
|
+
gem install sorcery
|
105
|
+
|
106
|
+
## Rails configuration:
|
107
|
+
|
108
|
+
rails generate sorcery:install
|
109
|
+
|
110
|
+
This will generate the core migration file, the initializer file and the
|
111
|
+
'User' model class.
|
112
|
+
|
113
|
+
rails generate sorcery:install remember_me reset_password
|
114
|
+
|
115
|
+
This will generate the migrations files for remember_me and reset_password
|
116
|
+
submodules and will create the initializer file (and add submodules to it),
|
117
|
+
and create the 'User' model class.
|
118
|
+
|
119
|
+
rails generate sorcery:install --model Person
|
120
|
+
|
121
|
+
This will generate the core migration file, the initializer and change the
|
122
|
+
model class (in the initializer and migration files) to the class 'Person'
|
123
|
+
(and its pluralized version, 'people')
|
124
|
+
|
125
|
+
rails generate sorcery:install http_basic_auth external remember_me --migrations
|
126
|
+
|
127
|
+
This will generate only the migration files for the specified submodules and
|
128
|
+
will add them to the initializer file.
|
129
|
+
|
130
|
+
Inside the initializer, the comments will tell you what each setting does.
|
131
|
+
|
132
|
+
## DelayedJob Integration
|
133
|
+
|
134
|
+
By default emails are sent synchronously. You can send them asynchronously by
|
135
|
+
using the [delayed_job gem](https://github.com/collectiveidea/delayed_job).
|
136
|
+
|
137
|
+
After implementing the `delayed_job` into your project add the code below at
|
138
|
+
the end of the `config/initializers/sorcery.rb` file. After that all emails
|
139
|
+
will be sent asynchronously.
|
140
|
+
|
141
|
+
module Sorcery
|
142
|
+
module Model
|
143
|
+
module InstanceMethods
|
144
|
+
def generic_send_email(method, mailer)
|
145
|
+
config = sorcery_config
|
146
|
+
mail = config.send(mailer).delay.send(config.send(method), self)
|
147
|
+
end
|
148
|
+
end
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
Sidekiq and Resque integrations are coming soon.
|
153
|
+
|
154
|
+
## Single Table Inheritance (STI) Support
|
155
|
+
STI is supported via a single setting in config/initializers/sorcery.rb.
|
156
|
+
|
157
|
+
## Full Features List by module:
|
158
|
+
|
159
|
+
Core (see lib/sorcery/model.rb and lib/sorcery/controller.rb):
|
160
|
+
* login/logout, optional return user to requested url on login, configurable
|
161
|
+
redirect for non-logged-in users.
|
162
|
+
* password encryption, algorithms: bcrypt(default), md5, sha1, sha256,
|
163
|
+
sha512, aes256, custom(yours!), none. Configurable stretches and salt.
|
164
|
+
* configurable attribute names for username, password and email.
|
165
|
+
* allow multiple fields to serve as username.
|
166
|
+
|
167
|
+
|
168
|
+
User Activation (see lib/sorcery/model/submodules/user_activation.rb):
|
169
|
+
* User activation by email with optional success email.
|
170
|
+
* configurable attribute names.
|
171
|
+
* configurable mailer, method name, and attribute name.
|
172
|
+
* configurable temporary token expiration.
|
173
|
+
* Optionally prevent non-active users to login.
|
174
|
+
|
175
|
+
|
176
|
+
Reset Password (see lib/sorcery/model/submodules/reset_password.rb):
|
177
|
+
* Reset password with email verification.
|
178
|
+
* configurable mailer, method name, and attribute name.
|
179
|
+
* configurable temporary token expiration.
|
180
|
+
* configurable time between emails (hammering protection).
|
181
|
+
|
182
|
+
|
183
|
+
Remember Me (see lib/sorcery/model/submodules/remember_me.rb):
|
184
|
+
* Remember me with configurable expiration.
|
185
|
+
* configurable attribute names.
|
186
|
+
|
187
|
+
|
188
|
+
Session Timeout (see lib/sorcery/controller/submodules/session_timeout.rb):
|
189
|
+
* Configurable session timeout.
|
190
|
+
* Optionally session timeout will be calculated from last user action.
|
191
|
+
|
192
|
+
|
193
|
+
Brute Force Protection (see
|
194
|
+
lib/sorcery/model/submodules/brute_force_protection.rb):
|
195
|
+
* Brute force login hammering protection.
|
196
|
+
* configurable logins before lock and lock duration.
|
197
|
+
|
198
|
+
|
199
|
+
Basic HTTP Authentication (see
|
200
|
+
lib/sorcery/controller/submodules/http_basic_auth.rb):
|
201
|
+
* A before filter for requesting authentication with HTTP Basic.
|
202
|
+
* automatic login from HTTP Basic.
|
203
|
+
* automatic login is disabled if session key changed.
|
204
|
+
|
205
|
+
|
206
|
+
Activity Logging (see lib/sorcery/model/submodules/activity_logging.rb):
|
207
|
+
* automatic logging of last login, last logout, last activity time and IP
|
208
|
+
address for last login.
|
209
|
+
* an easy method of collecting the list of currently logged in users.
|
210
|
+
* configurable timeout by which to decide whether to include a user in the
|
211
|
+
list of logged in users.
|
212
|
+
|
213
|
+
|
214
|
+
External (see lib/sorcery/controller/submodules/external.rb):
|
215
|
+
* OAuth1 and OAuth2 support (currently twitter & facebook)
|
216
|
+
* configurable db field names and authentications table.
|
217
|
+
|
218
|
+
|
219
|
+
## Next Planned Features:
|
220
|
+
|
221
|
+
I've got some thoughts which include (unordered):
|
222
|
+
* Passing a block to encrypt, allowing the developer to define his own mix
|
223
|
+
of salting and encrypting
|
224
|
+
* Forgot username, maybe as part of the reset_password module
|
225
|
+
* Scoping logins (to a subdomain or another arbitrary field)
|
226
|
+
* Allowing storing the salt and crypted password in the same DB field for
|
227
|
+
extra security
|
228
|
+
* Other reset password strategies (security questions?)
|
229
|
+
* Other brute force protection strategies (captcha)
|
230
|
+
|
231
|
+
|
232
|
+
Have an idea? Let me know, and it might get into the gem!
|
233
|
+
|
234
|
+
## Backward compatibility
|
235
|
+
|
236
|
+
While the lib is young and evolving fast I'm breaking backward compatibility
|
237
|
+
quite often. I'm constantly finding better ways to do things and throwing away
|
238
|
+
old ways. To let you know when things are changing in a non-compatible way,
|
239
|
+
I'm bumping the minor version of the gem. The patch version changes are
|
240
|
+
backward compatible.
|
241
|
+
|
242
|
+
In short, an app that works with x.3.1 should be able to upgrade to x.3.2 with
|
243
|
+
no code changes. The same cannot be said about upgrading to x.4.0 and above,
|
244
|
+
however.
|
245
|
+
|
246
|
+
## Upgrading
|
247
|
+
|
248
|
+
Important notes while upgrading:
|
249
|
+
|
250
|
+
* If are upgrading to **0.8.2** and use activity_logging feature with
|
251
|
+
ActiveRecord, you will have to add a new column
|
252
|
+
`last_login_from_ip_address`
|
253
|
+
[#465](https://github.com/NoamB/sorcery/issues/465)
|
254
|
+
* Sinatra support existed until **v0.7.0** (including), but was dropped
|
255
|
+
later due to being a maintenance nightmare.
|
256
|
+
* If upgrading from <= **0.6.1 to >= <b>0.7.0** you need to change
|
257
|
+
'username_attribute_name' to 'username_attribute_names' in initializer.
|
258
|
+
* If upgrading from <= **v0.5.1** to >= **v0.5.2** you need to explicitly
|
259
|
+
set your user_class model in the initializer file.
|
260
|
+
|
261
|
+
# This line must come after the 'user config' block.
|
262
|
+
config.user_class = User
|
263
|
+
|
264
|
+
|
265
|
+
## Contributing to sorcery
|
266
|
+
|
267
|
+
Your feedback is very welcome and will make this gem much much better for you,
|
268
|
+
me and everyone else. Besides feedback on code, features, suggestions and bug
|
269
|
+
reports, you may want to actually make an impact on the code. For this:
|
270
|
+
|
271
|
+
* Fork it.
|
272
|
+
* Fix it.
|
273
|
+
* Test it.
|
274
|
+
* Commit it.
|
275
|
+
* Send me a pull request so I'll... Pull it.
|
276
|
+
|
277
|
+
|
278
|
+
If you feel sorcery has made your life easier, and you would like to express
|
279
|
+
your thanks via a donation, my paypal email is in the contact details.
|
280
|
+
|
281
|
+
## Contact
|
282
|
+
|
283
|
+
Feel free to ask questions using these contact details:
|
284
|
+
|
285
|
+
#### Noam Ben-Ari
|
286
|
+
|
287
|
+
email: nbenari@gmail.com ( also for paypal )
|
288
|
+
|
289
|
+
twitter: @nbenari
|
290
|
+
|
291
|
+
#### Kir Shatrov
|
292
|
+
|
293
|
+
email: shatrov@me.com
|
294
|
+
|
295
|
+
twitter: @Kiiiir
|
296
|
+
|
297
|
+
## Copyright
|
298
|
+
|
299
|
+
Copyright (c) 2010 Noam Ben Ari (nbenari@gmail.com). See LICENSE.txt for
|
300
|
+
further details.
|