sorcery 0.11.0 → 0.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.github/ISSUE_TEMPLATE.md +20 -0
- data/.rubocop.yml +55 -0
- data/.rubocop_todo.yml +145 -0
- data/.travis.yml +3 -52
- data/CHANGELOG.md +69 -0
- data/Gemfile +3 -3
- data/{LICENSE.txt → LICENSE.md} +1 -1
- data/README.md +34 -7
- data/lib/generators/sorcery/USAGE +1 -1
- data/lib/generators/sorcery/install_generator.rb +21 -21
- data/lib/generators/sorcery/templates/initializer.rb +164 -69
- data/lib/generators/sorcery/templates/migration/activity_logging.rb +4 -4
- data/lib/generators/sorcery/templates/migration/brute_force_protection.rb +3 -3
- data/lib/generators/sorcery/templates/migration/core.rb +2 -2
- data/lib/generators/sorcery/templates/migration/external.rb +3 -3
- data/lib/generators/sorcery/templates/migration/magic_login.rb +9 -0
- data/lib/generators/sorcery/templates/migration/remember_me.rb +2 -2
- data/lib/generators/sorcery/templates/migration/reset_password.rb +4 -3
- data/lib/generators/sorcery/templates/migration/user_activation.rb +3 -3
- data/lib/sorcery.rb +2 -0
- data/lib/sorcery/adapters/active_record_adapter.rb +3 -2
- data/lib/sorcery/adapters/mongoid_adapter.rb +23 -11
- data/lib/sorcery/controller.rb +26 -15
- data/lib/sorcery/controller/config.rb +2 -0
- data/lib/sorcery/controller/submodules/activity_logging.rb +14 -3
- data/lib/sorcery/controller/submodules/brute_force_protection.rb +7 -3
- data/lib/sorcery/controller/submodules/external.rb +48 -33
- data/lib/sorcery/controller/submodules/http_basic_auth.rb +5 -1
- data/lib/sorcery/controller/submodules/remember_me.rb +9 -10
- data/lib/sorcery/controller/submodules/session_timeout.rb +32 -6
- data/lib/sorcery/crypto_providers/aes256.rb +2 -1
- data/lib/sorcery/crypto_providers/bcrypt.rb +8 -2
- data/lib/sorcery/engine.rb +16 -3
- data/lib/sorcery/model.rb +14 -10
- data/lib/sorcery/model/config.rb +12 -4
- data/lib/sorcery/model/submodules/brute_force_protection.rb +6 -7
- data/lib/sorcery/model/submodules/external.rb +19 -3
- data/lib/sorcery/model/submodules/magic_login.rb +130 -0
- data/lib/sorcery/model/submodules/reset_password.rb +25 -2
- data/lib/sorcery/model/submodules/user_activation.rb +1 -1
- data/lib/sorcery/model/temporary_token.rb +3 -1
- data/lib/sorcery/protocols/oauth.rb +1 -0
- data/lib/sorcery/providers/auth0.rb +46 -0
- data/lib/sorcery/providers/discord.rb +52 -0
- data/lib/sorcery/providers/heroku.rb +1 -0
- data/lib/sorcery/providers/instagram.rb +73 -0
- data/lib/sorcery/providers/line.rb +47 -0
- data/lib/sorcery/providers/linkedin.rb +45 -36
- data/lib/sorcery/providers/vk.rb +5 -4
- data/lib/sorcery/providers/wechat.rb +8 -6
- data/lib/sorcery/test_helpers/internal.rb +5 -4
- data/lib/sorcery/test_helpers/internal/rails.rb +11 -11
- data/lib/sorcery/test_helpers/rails/request.rb +20 -0
- data/lib/sorcery/version.rb +1 -1
- data/sorcery.gemspec +28 -11
- data/spec/active_record/user_activation_spec.rb +2 -2
- data/spec/active_record/user_activity_logging_spec.rb +2 -2
- data/spec/active_record/user_brute_force_protection_spec.rb +2 -2
- data/spec/active_record/user_magic_login_spec.rb +15 -0
- data/spec/active_record/user_oauth_spec.rb +2 -2
- data/spec/active_record/user_remember_me_spec.rb +2 -2
- data/spec/active_record/user_reset_password_spec.rb +2 -2
- data/spec/active_record/user_spec.rb +0 -10
- data/spec/controllers/controller_http_basic_auth_spec.rb +1 -1
- data/spec/controllers/controller_oauth2_spec.rb +212 -123
- data/spec/controllers/controller_oauth_spec.rb +7 -7
- data/spec/controllers/controller_remember_me_spec.rb +16 -8
- data/spec/controllers/controller_session_timeout_spec.rb +90 -3
- data/spec/controllers/controller_spec.rb +13 -3
- data/spec/orm/active_record.rb +2 -2
- data/spec/providers/example_provider_spec.rb +17 -0
- data/spec/providers/example_spec.rb +17 -0
- data/spec/providers/vk_spec.rb +42 -0
- data/spec/rails_app/app/assets/config/manifest.js +1 -0
- data/spec/rails_app/app/controllers/sorcery_controller.rb +131 -32
- data/spec/rails_app/app/mailers/sorcery_mailer.rb +7 -0
- data/spec/rails_app/app/views/sorcery_mailer/magic_login_email.html.erb +13 -0
- data/spec/rails_app/app/views/sorcery_mailer/magic_login_email.text.erb +6 -0
- data/spec/rails_app/config/application.rb +8 -3
- data/spec/rails_app/config/boot.rb +1 -1
- data/spec/rails_app/config/environment.rb +1 -1
- data/spec/rails_app/config/routes.rb +14 -0
- data/spec/rails_app/config/secrets.yml +4 -0
- data/spec/rails_app/db/migrate/activity_logging/20101224223624_add_activity_logging_to_users.rb +2 -2
- data/spec/rails_app/db/migrate/invalidate_active_sessions/20180221093235_add_invalidate_active_sessions_before_to_users.rb +9 -0
- data/spec/rails_app/db/migrate/magic_login/20170924151831_add_magic_login_to_users.rb +17 -0
- data/spec/rails_app/db/migrate/reset_password/20101224223622_add_reset_password_to_users.rb +2 -0
- data/spec/rails_app/db/schema.rb +7 -9
- data/spec/shared_examples/user_magic_login_shared_examples.rb +150 -0
- data/spec/shared_examples/user_oauth_shared_examples.rb +1 -1
- data/spec/shared_examples/user_remember_me_shared_examples.rb +1 -1
- data/spec/shared_examples/user_reset_password_shared_examples.rb +37 -5
- data/spec/shared_examples/user_shared_examples.rb +104 -43
- data/spec/sorcery_crypto_providers_spec.rb +61 -1
- data/spec/sorcery_temporary_token_spec.rb +27 -0
- data/spec/spec.opts +1 -1
- data/spec/spec_helper.rb +2 -2
- data/spec/support/migration_helper.rb +19 -0
- data/spec/support/providers/example.rb +11 -0
- data/spec/support/providers/example_provider.rb +11 -0
- metadata +89 -33
- data/gemfiles/active_record-rails40.gemfile +0 -7
- data/gemfiles/active_record-rails41.gemfile +0 -7
- data/gemfiles/active_record-rails42.gemfile +0 -7
- data/spec/rails_app/config/initializers/secret_token.rb +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: b37df18790461644fdba1a9c1e960b21304a37d993432da9fe6468675f6c952b
|
4
|
+
data.tar.gz: 64745f0bab25339445a18a79e3f4bd0b75744dead50f4f019992514345900689
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8374546082aefa223105d535b7be46106df05aba3619785650ac0f52e3d84b0dc3eefa41c95678e9eef7ba0058bb01daf416661591fa0d794d503ffc23cc09e
|
7
|
+
data.tar.gz: 703e0811017208689ecdecb2588973583e5dc167e420559b8e96731b764d2076aa4c4ab9a2df9186c09d18ddb259de3b4a52b29baf0fa8cfbdeb860b5799224e
|
@@ -0,0 +1,20 @@
|
|
1
|
+
Please complete all sections.
|
2
|
+
|
3
|
+
### Configuration
|
4
|
+
|
5
|
+
- Sorcery Version: ``
|
6
|
+
- Ruby Version: ``
|
7
|
+
- Framework: ``
|
8
|
+
- Platform: ``
|
9
|
+
|
10
|
+
### Expected Behavior
|
11
|
+
|
12
|
+
Tell us what should happen.
|
13
|
+
|
14
|
+
### Actual Behavior
|
15
|
+
|
16
|
+
Tell us what happens instead.
|
17
|
+
|
18
|
+
### Steps to Reproduce
|
19
|
+
|
20
|
+
Please list all steps to reproduce the issue.
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
inherit_from: .rubocop_todo.yml
|
2
|
+
|
3
|
+
AllCops:
|
4
|
+
Exclude:
|
5
|
+
- 'lib/generators/sorcery/templates/**/*'
|
6
|
+
TargetRubyVersion: 2.6
|
7
|
+
|
8
|
+
# See: https://github.com/rubocop-hq/rubocop/issues/3344
|
9
|
+
Style/DoubleNegation:
|
10
|
+
Enabled: false
|
11
|
+
|
12
|
+
####################
|
13
|
+
## Pre-1.0.0 Code ##
|
14
|
+
####################
|
15
|
+
|
16
|
+
Metrics/AbcSize:
|
17
|
+
Exclude:
|
18
|
+
- 'lib/**/*'
|
19
|
+
- 'spec/**/*'
|
20
|
+
Metrics/BlockLength:
|
21
|
+
Exclude:
|
22
|
+
- 'lib/**/*'
|
23
|
+
- 'spec/**/*'
|
24
|
+
Layout/LineLength:
|
25
|
+
Exclude:
|
26
|
+
- 'lib/**/*'
|
27
|
+
- 'spec/**/*'
|
28
|
+
Metrics/ClassLength:
|
29
|
+
Exclude:
|
30
|
+
- 'lib/**/*'
|
31
|
+
- 'spec/**/*'
|
32
|
+
Metrics/CyclomaticComplexity:
|
33
|
+
Exclude:
|
34
|
+
- 'lib/**/*'
|
35
|
+
- 'spec/**/*'
|
36
|
+
Metrics/MethodLength:
|
37
|
+
Exclude:
|
38
|
+
- 'lib/**/*'
|
39
|
+
- 'spec/**/*'
|
40
|
+
Metrics/PerceivedComplexity:
|
41
|
+
Exclude:
|
42
|
+
- 'lib/**/*'
|
43
|
+
- 'spec/**/*'
|
44
|
+
Naming/AccessorMethodName:
|
45
|
+
Exclude:
|
46
|
+
- 'lib/**/*'
|
47
|
+
- 'spec/**/*'
|
48
|
+
Naming/PredicateName:
|
49
|
+
Exclude:
|
50
|
+
- 'lib/**/*'
|
51
|
+
- 'spec/**/*'
|
52
|
+
Style/Documentation:
|
53
|
+
Exclude:
|
54
|
+
- 'lib/**/*'
|
55
|
+
- 'spec/**/*'
|
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,145 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config`
|
3
|
+
# on 2019-12-18 16:18:24 -0800 using RuboCop version 0.78.0.
|
4
|
+
# The point is for the user to remove these configuration records
|
5
|
+
# one by one as the offenses are removed from the code base.
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
8
|
+
|
9
|
+
# Offense count: 1
|
10
|
+
# Configuration parameters: Include.
|
11
|
+
# Include: **/*.gemspec
|
12
|
+
Gemspec/RequiredRubyVersion:
|
13
|
+
Exclude:
|
14
|
+
- 'sorcery.gemspec'
|
15
|
+
|
16
|
+
# Offense count: 1
|
17
|
+
# Cop supports --auto-correct.
|
18
|
+
# Configuration parameters: AllowAdjacentOneLineDefs, NumberOfEmptyLines.
|
19
|
+
Layout/EmptyLineBetweenDefs:
|
20
|
+
Exclude:
|
21
|
+
- 'lib/sorcery/providers/line.rb'
|
22
|
+
|
23
|
+
# Offense count: 83
|
24
|
+
# Cop supports --auto-correct.
|
25
|
+
# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
|
26
|
+
# SupportedHashRocketStyles: key, separator, table
|
27
|
+
# SupportedColonStyles: key, separator, table
|
28
|
+
# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
|
29
|
+
Layout/HashAlignment:
|
30
|
+
Enabled: false
|
31
|
+
|
32
|
+
# Offense count: 2
|
33
|
+
# Configuration parameters: AllowSafeAssignment.
|
34
|
+
Lint/AssignmentInCondition:
|
35
|
+
Exclude:
|
36
|
+
- 'spec/rails_app/app/controllers/sorcery_controller.rb'
|
37
|
+
|
38
|
+
# Offense count: 1
|
39
|
+
# Cop supports --auto-correct.
|
40
|
+
Lint/NonDeterministicRequireOrder:
|
41
|
+
Exclude:
|
42
|
+
- 'spec/spec_helper.rb'
|
43
|
+
|
44
|
+
# Offense count: 4
|
45
|
+
# Cop supports --auto-correct.
|
46
|
+
Lint/RedundantCopDisableDirective:
|
47
|
+
Exclude:
|
48
|
+
- 'lib/sorcery/controller.rb'
|
49
|
+
- 'lib/sorcery/model.rb'
|
50
|
+
- 'spec/rails_app/config/application.rb'
|
51
|
+
- 'spec/shared_examples/user_shared_examples.rb'
|
52
|
+
|
53
|
+
# Offense count: 4
|
54
|
+
# Cop supports --auto-correct.
|
55
|
+
Lint/SendWithMixinArgument:
|
56
|
+
Exclude:
|
57
|
+
- 'lib/sorcery.rb'
|
58
|
+
- 'lib/sorcery/engine.rb'
|
59
|
+
- 'lib/sorcery/test_helpers/internal/rails.rb'
|
60
|
+
|
61
|
+
# Offense count: 4
|
62
|
+
# Configuration parameters: AllowComments.
|
63
|
+
Lint/SuppressedException:
|
64
|
+
Exclude:
|
65
|
+
- 'lib/sorcery/controller.rb'
|
66
|
+
- 'lib/sorcery/model.rb'
|
67
|
+
- 'spec/rails_app/config/application.rb'
|
68
|
+
- 'spec/shared_examples/user_shared_examples.rb'
|
69
|
+
|
70
|
+
# Offense count: 2
|
71
|
+
# Cop supports --auto-correct.
|
72
|
+
# Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments.
|
73
|
+
Lint/UnusedBlockArgument:
|
74
|
+
Exclude:
|
75
|
+
- 'spec/shared_examples/user_shared_examples.rb'
|
76
|
+
|
77
|
+
# Offense count: 1
|
78
|
+
# Configuration parameters: EnforcedStyle.
|
79
|
+
# SupportedStyles: annotated, template, unannotated
|
80
|
+
Style/FormatStringToken:
|
81
|
+
Exclude:
|
82
|
+
- 'lib/generators/sorcery/install_generator.rb'
|
83
|
+
|
84
|
+
# Offense count: 121
|
85
|
+
# Cop supports --auto-correct.
|
86
|
+
# Configuration parameters: EnforcedStyle.
|
87
|
+
# SupportedStyles: always, never
|
88
|
+
Style/FrozenStringLiteralComment:
|
89
|
+
Enabled: false
|
90
|
+
|
91
|
+
# Offense count: 3
|
92
|
+
# Configuration parameters: MinBodyLength.
|
93
|
+
Style/GuardClause:
|
94
|
+
Exclude:
|
95
|
+
- 'lib/sorcery/controller/submodules/brute_force_protection.rb'
|
96
|
+
- 'lib/sorcery/controller/submodules/http_basic_auth.rb'
|
97
|
+
- 'lib/sorcery/controller/submodules/remember_me.rb'
|
98
|
+
|
99
|
+
# Offense count: 3
|
100
|
+
# Cop supports --auto-correct.
|
101
|
+
# Configuration parameters: EnforcedStyle, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
|
102
|
+
# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
|
103
|
+
Style/HashSyntax:
|
104
|
+
Exclude:
|
105
|
+
- 'lib/sorcery/adapters/active_record_adapter.rb'
|
106
|
+
- 'lib/sorcery/test_helpers/rails/integration.rb'
|
107
|
+
|
108
|
+
# Offense count: 49
|
109
|
+
# Cop supports --auto-correct.
|
110
|
+
Style/IfUnlessModifier:
|
111
|
+
Enabled: false
|
112
|
+
|
113
|
+
# Offense count: 2
|
114
|
+
# Cop supports --auto-correct.
|
115
|
+
Style/RedundantBegin:
|
116
|
+
Exclude:
|
117
|
+
- 'lib/sorcery/controller.rb'
|
118
|
+
- 'lib/sorcery/model.rb'
|
119
|
+
|
120
|
+
# Offense count: 4
|
121
|
+
# Cop supports --auto-correct.
|
122
|
+
# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods.
|
123
|
+
# AllowedMethods: present?, blank?, presence, try, try!
|
124
|
+
Style/SafeNavigation:
|
125
|
+
Exclude:
|
126
|
+
- 'lib/sorcery/controller/config.rb'
|
127
|
+
- 'lib/sorcery/controller/submodules/brute_force_protection.rb'
|
128
|
+
- 'lib/sorcery/controller/submodules/remember_me.rb'
|
129
|
+
- 'lib/sorcery/model.rb'
|
130
|
+
|
131
|
+
# Offense count: 7
|
132
|
+
# Cop supports --auto-correct.
|
133
|
+
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
|
134
|
+
# SupportedStyles: single_quotes, double_quotes
|
135
|
+
Style/StringLiterals:
|
136
|
+
Exclude:
|
137
|
+
- 'spec/controllers/controller_oauth2_spec.rb'
|
138
|
+
- 'spec/sorcery_crypto_providers_spec.rb'
|
139
|
+
|
140
|
+
# Offense count: 2
|
141
|
+
# Cop supports --auto-correct.
|
142
|
+
Style/UnpackFirst:
|
143
|
+
Exclude:
|
144
|
+
- 'lib/sorcery/crypto_providers/aes256.rb'
|
145
|
+
- 'spec/sorcery_crypto_providers_spec.rb'
|
data/.travis.yml
CHANGED
@@ -1,57 +1,8 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
|
-
-
|
4
|
-
- 2.
|
5
|
-
- 2.
|
6
|
-
- 2.2.6
|
7
|
-
- 2.3.3
|
8
|
-
- 2.4.0
|
9
|
-
|
10
|
-
env:
|
11
|
-
global:
|
12
|
-
- JRUBY_OPTS="--2.0"
|
3
|
+
- 2.4.9
|
4
|
+
- 2.5.7
|
5
|
+
- 2.6.5
|
13
6
|
|
14
7
|
gemfile:
|
15
8
|
- Gemfile
|
16
|
-
- gemfiles/active_record-rails40.gemfile
|
17
|
-
- gemfiles/active_record-rails41.gemfile
|
18
|
-
- gemfiles/active_record-rails42.gemfile
|
19
|
-
|
20
|
-
before_script:
|
21
|
-
- mysql -e 'create database sorcery_test;'
|
22
|
-
|
23
|
-
before_install:
|
24
|
-
- rvm get stable --auto-dotfiles
|
25
|
-
- gem update bundler
|
26
|
-
|
27
|
-
matrix:
|
28
|
-
allow_failures:
|
29
|
-
- rvm: jruby
|
30
|
-
|
31
|
-
exclude:
|
32
|
-
- rvm: 2.0.0
|
33
|
-
gemfile: gemfiles/active_record-rails42.gemfile
|
34
|
-
|
35
|
-
- rvm: 2.0.0
|
36
|
-
gemfile: Gemfile
|
37
|
-
|
38
|
-
- rvm: 2.1.10
|
39
|
-
gemfile: Gemfile
|
40
|
-
|
41
|
-
- rvm: 2.2.6
|
42
|
-
gemfile: gemfiles/active_record-rails40.gemfile
|
43
|
-
|
44
|
-
- rvm: 2.3.3
|
45
|
-
gemfile: gemfiles/active_record-rails40.gemfile
|
46
|
-
|
47
|
-
- rvm: 2.4.0
|
48
|
-
gemfile: gemfiles/active_record-rails40.gemfile
|
49
|
-
|
50
|
-
- rvm: 2.4.0
|
51
|
-
gemfile: gemfiles/active_record-rails41.gemfile
|
52
|
-
|
53
|
-
- rvm: 2.4.0
|
54
|
-
gemfile: gemfiles/active_record-rails42.gemfile
|
55
|
-
|
56
|
-
- rvm: jruby
|
57
|
-
gemfile: Gemfile
|
data/CHANGELOG.md
CHANGED
@@ -1,11 +1,80 @@
|
|
1
1
|
# Changelog
|
2
2
|
## HEAD
|
3
3
|
|
4
|
+
## 0.15.1
|
5
|
+
|
6
|
+
* Update `oauth` dependency per CVE-2016-11086
|
7
|
+
|
8
|
+
## 0.15.0
|
9
|
+
|
10
|
+
* Fix brute force vuln due to callbacks no being ran [#235](https://github.com/Sorcery/sorcery/pull/235)
|
11
|
+
* Revert on_load change due to breaking existing applications [#234](https://github.com/Sorcery/sorcery/pull/234)
|
12
|
+
* Add forget_me! and force_forget_me! test cases [#216](https://github.com/Sorcery/sorcery/pull/216)
|
13
|
+
* In `generic_send_email`, check responds_to [#211](https://github.com/Sorcery/sorcery/pull/211)
|
14
|
+
* Fix typo [#219](https://github.com/Sorcery/sorcery/pull/219)
|
15
|
+
* Fix deprecation warnings in Rails 6 [#209](https://github.com/Sorcery/sorcery/pull/209)
|
16
|
+
* Add ruby 2.6.5 to the travis build [#215](https://github.com/Sorcery/sorcery/pull/215)
|
17
|
+
* Add discord provider [#185](https://github.com/Sorcery/sorcery/pull/185)
|
18
|
+
* Remove MySQL database creation call [#214](https://github.com/Sorcery/sorcery/pull/214)
|
19
|
+
* Use id instead of uid for VK provider [#199](https://github.com/Sorcery/sorcery/pull/199)
|
20
|
+
* Don't :return_t JSON requests after login [#197](https://github.com/Sorcery/sorcery/pull/197)
|
21
|
+
* Fix email scope for LinkedIn Provider [#191](https://github.com/Sorcery/sorcery/pull/191)
|
22
|
+
* Ignore cookies when undefined cookies [#187](https://github.com/Sorcery/sorcery/pull/187)
|
23
|
+
* Allow for custom providers with multi-word class names. [#190](https://github.com/Sorcery/sorcery/pull/190)
|
24
|
+
|
25
|
+
## 0.14.0
|
26
|
+
|
27
|
+
* Update LinkedIn to use OAuth 2 [#189](https://github.com/Sorcery/sorcery/pull/189)
|
28
|
+
* Support the LINE login auth [#80](https://github.com/Sorcery/sorcery/pull/80)
|
29
|
+
* Allow BCrypt to have app-specific secret token [#173](https://github.com/Sorcery/sorcery/pull/173)
|
30
|
+
* Add #change_password method to reset_password module. [#165](https://github.com/Sorcery/sorcery/pull/165)
|
31
|
+
* Clean up initializer comments [#153](https://github.com/Sorcery/sorcery/pull/153)
|
32
|
+
* Allow load_from_magic_login_token to accept a block [#152](https://github.com/Sorcery/sorcery/pull/152)
|
33
|
+
* Fix CipherError class name [#142](https://github.com/Sorcery/sorcery/pull/142)
|
34
|
+
* Fix `update_failed_logins_count` being called twice when login failed [#163](https://github.com/Sorcery/sorcery/pull/163)
|
35
|
+
* Update migration templates to use new hash syntax [#170](https://github.com/Sorcery/sorcery/pull/170)
|
36
|
+
* Support for Rails 4.2 and lower soft-dropped [#171](https://github.com/Sorcery/sorcery/pull/171)
|
37
|
+
|
38
|
+
## 0.13.0
|
39
|
+
|
40
|
+
* Add support for Rails 5.2 / Ruby 2.5 [#129](https://github.com/Sorcery/sorcery/pull/129)
|
41
|
+
* Fix migration files not being generated [#128](https://github.com/Sorcery/sorcery/pull/128)
|
42
|
+
* Add support for ActionController::API [#133](https://github.com/Sorcery/sorcery/pull/133), [#150](https://github.com/Sorcery/sorcery/pull/150), [#159](https://github.com/Sorcery/sorcery/pull/159)
|
43
|
+
* Update activation email to use after_commit callback [#130](https://github.com/Sorcery/sorcery/pull/130)
|
44
|
+
* Add opt-in `invalidate_active_sessions!` method [#110](https://github.com/Sorcery/sorcery/pull/110)
|
45
|
+
* Pass along `remember_me` to `#auto_login` [#136](https://github.com/Sorcery/sorcery/pull/136)
|
46
|
+
* Respect SessionTimeout on login via RememberMe [#102](https://github.com/Sorcery/sorcery/pull/102)
|
47
|
+
* Added `demodulize` on authentication class name association name fetch [#147](https://github.com/Sorcery/sorcery/pull/147)
|
48
|
+
* Remove Gemnasium badge [#140](https://github.com/Sorcery/sorcery/pull/140)
|
49
|
+
* Add Instragram provider [#51](https://github.com/Sorcery/sorcery/pull/51)
|
50
|
+
* Remove `publish_actions` permission for facebook [#139](https://github.com/Sorcery/sorcery/pull/139)
|
51
|
+
* Prepare for 1.0.0 [#157](https://github.com/Sorcery/sorcery/pull/157)
|
52
|
+
* Add Auth0 provider [#160](https://github.com/Sorcery/sorcery/pull/160)
|
53
|
+
|
54
|
+
## 0.12.0
|
55
|
+
|
56
|
+
* Fix magic_login not inheriting from migration_class_name [#99](https://github.com/Sorcery/sorcery/pull/99)
|
57
|
+
* Update YARD dependency [#100](https://github.com/Sorcery/sorcery/pull/100)
|
58
|
+
* Make `#update_attributes` behave like `#update` [#98](https://github.com/Sorcery/sorcery/pull/98)
|
59
|
+
* Add tests to the magic login submodule [#95](https://github.com/Sorcery/sorcery/pull/95)
|
60
|
+
* Set user.stretches to 1 in test env by default [#81](https://github.com/Sorcery/sorcery/pull/81)
|
61
|
+
* Allow user to be loaded from other source when session expires. fix #89 [#94](https://github.com/Sorcery/sorcery/pull/94)
|
62
|
+
* Added a new ArgumentError for not defined user_class in config [#82](https://github.com/Sorcery/sorcery/pull/82)
|
63
|
+
* Updated Required Ruby version to 2.2 [#85](https://github.com/Sorcery/sorcery/pull/85)
|
64
|
+
* Add configuration for token randomness [#67](https://github.com/Sorcery/sorcery/pull/67)
|
65
|
+
* Add facebook user_info_path option to initializer.rb [#63](https://github.com/Sorcery/sorcery/pull/63)
|
66
|
+
* Add new function: `build_from` (allows building a user instance from OAuth without saving) [#54](https://github.com/Sorcery/sorcery/pull/54)
|
67
|
+
* Add rubocop configuration and TODO list [#107](https://github.com/Sorcery/sorcery/pull/107)
|
68
|
+
* Add support for VK OAuth (thanks to @Hirurg103) [#109](https://github.com/Sorcery/sorcery/pull/109)
|
69
|
+
* Fix token leak via referrer header [#56](https://github.com/Sorcery/sorcery/pull/56)
|
70
|
+
* Add `login_user` helper for request specs [#57](https://github.com/Sorcery/sorcery/pull/57)
|
71
|
+
|
4
72
|
## 0.11.0
|
5
73
|
|
6
74
|
* Refer to User before calling remove_const to avoid NameError [#58](https://github.com/Sorcery/sorcery/pull/58)
|
7
75
|
* Resurrect block authentication, showing auth failure reason. [#41](https://github.com/Sorcery/sorcery/pull/41)
|
8
76
|
* Add github scope option to initializer.rb [#50](https://github.com/Sorcery/sorcery/pull/50)
|
77
|
+
* Fix Facebook being broken due to API deprecation [#53](https://github.com/Sorcery/sorcery/pull/53)
|
9
78
|
|
10
79
|
## 0.10.3
|
11
80
|
|
data/Gemfile
CHANGED
data/{LICENSE.txt → LICENSE.md}
RENAMED
data/README.md
CHANGED
@@ -3,7 +3,6 @@
|
|
3
3
|
[](https://rubygems.org/gems/sorcery)
|
4
4
|
[](https://rubygems.org/gems/sorcery)
|
5
5
|
[](https://travis-ci.org/Sorcery/sorcery)
|
6
|
-
[](https://gemnasium.com/github.com/Sorcery/sorcery)
|
7
6
|
[](https://codeclimate.com/github/Sorcery/sorcery)
|
8
7
|
[](http://inch-ci.org/github/Sorcery/sorcery)
|
9
8
|
[](https://gitter.im/Sorcery/sorcery?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
@@ -22,6 +21,18 @@ Sorcery is a stripped-down, bare-bones authentication library, with which you ca
|
|
22
21
|
- Configuration over Confusion - Centralized (1 file), Simple & short configuration as possible, not drowning in syntactic sugar.
|
23
22
|
- Keep MVC cleanly separated - DB is for models, sessions are for controllers. Models stay unaware of sessions.
|
24
23
|
|
24
|
+
## Table of Contents
|
25
|
+
|
26
|
+
1. [Useful Links](#useful-links)
|
27
|
+
2. [API Summary](#api-summary)
|
28
|
+
3. [Installation](#installation)
|
29
|
+
4. [Configuration](#configuration)
|
30
|
+
5. [Full Features List by Module](#full-features-list-by-module)
|
31
|
+
6. [Planned Features](#planned-features)
|
32
|
+
7. [Contributing](#contributing)
|
33
|
+
8. [Contact](#contact)
|
34
|
+
9. [License](#license)
|
35
|
+
|
25
36
|
## Useful Links
|
26
37
|
|
27
38
|
- [Documentation](http://rubydoc.info/gems/sorcery)
|
@@ -70,6 +81,7 @@ require_login_from_http_basic # This is a before action
|
|
70
81
|
login_at(provider) # Sends the user to an external service (Facebook, Twitter, etc.) to authenticate
|
71
82
|
login_from(provider) # Tries to login from the external provider's callback
|
72
83
|
create_from(provider) # Create the user in the local app database
|
84
|
+
build_from(provider) # Build user instance using user_info_mappings
|
73
85
|
```
|
74
86
|
|
75
87
|
### Remember Me
|
@@ -87,7 +99,14 @@ force_forget_me! # Forgets all sessions by clearing the token, even if remember_
|
|
87
99
|
User.load_from_reset_password_token(token)
|
88
100
|
@user.generate_reset_password_token! # Use if you want to send the email by yourself
|
89
101
|
@user.deliver_reset_password_instructions! # Generates the token and sends the email
|
90
|
-
@user.change_password
|
102
|
+
@user.change_password(new_password)
|
103
|
+
@user.change_password!(new_password) # Same as change_password but raises exception on save
|
104
|
+
```
|
105
|
+
|
106
|
+
### Session Timeout
|
107
|
+
|
108
|
+
```ruby
|
109
|
+
invalidate_active_sessions! #Invalidate all sessions with a login_time or last_action_time before the current time. Must Opt-in
|
91
110
|
```
|
92
111
|
|
93
112
|
### User Activation
|
@@ -171,6 +190,7 @@ Inside the initializer, the comments will tell you what each setting does.
|
|
171
190
|
|
172
191
|
- Configurable session timeout
|
173
192
|
- Optionally session timeout will be calculated from last user action
|
193
|
+
- Optionally enable a method to clear all active sessions, expects an `invalidate_sessions_before` datetime attribute.
|
174
194
|
|
175
195
|
**Brute Force Protection** (see [lib/sorcery/model/submodules/brute_force_protection.rb](https://github.com/Sorcery/sorcery/blob/master/lib/sorcery/model/submodules/brute_force_protection.rb)):
|
176
196
|
|
@@ -209,16 +229,23 @@ Have an idea? Let us know, and it might get into the gem!
|
|
209
229
|
|
210
230
|
Bug reports and pull requests are welcome on GitHub at https://github.com/Sorcery/sorcery.
|
211
231
|
|
212
|
-
|
213
|
-
|
232
|
+
- [Git Workflow](https://github.com/Sorcery/sorcery/wiki/Git-Workflow)
|
233
|
+
- [Running the specs](https://github.com/Sorcery/sorcery/wiki/Running-the-specs)
|
214
234
|
|
215
235
|
## Contact
|
216
236
|
|
217
237
|
Feel free to ask questions using these contact details:
|
218
238
|
|
219
|
-
|
220
|
-
|
221
|
-
-
|
239
|
+
**Current Maintainers:**
|
240
|
+
|
241
|
+
- Chase Gilliam ([@Ch4s3](https://github.com/Ch4s3)) | [Email](mailto:chase.gilliam@gmail.com)
|
242
|
+
- Josh Buker ([@athix](https://github.com/athix)) | [Email](mailto:jbuker@aeonsplice.com)
|
243
|
+
|
244
|
+
**Past Maintainers:**
|
245
|
+
|
246
|
+
- Noam Ben-Ari ([@NoamB](https://github.com/NoamB)) | [Email](mailto:nbenari@gmail.com) | [Twitter](https://twitter.com/nbenari)
|
247
|
+
- Kir Shatrov ([@kirs](https://github.com/kirs)) | [Email](mailto:shatrov@me.com) | [Twitter](https://twitter.com/Kiiiir)
|
248
|
+
- Grzegorz Witek ([@arnvald](https://github.com/arnvald)) | [Email](mailto:arnvald.to@gmail.com) | [Twitter](https://twitter.com/arnvald)
|
222
249
|
|
223
250
|
## License
|
224
251
|
|