sorcery 0.17.0 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -1
  3. data/README.md +8 -5
  4. data/lib/generators/sorcery/helpers.rb +1 -1
  5. data/lib/generators/sorcery/install_generator.rb +9 -18
  6. data/lib/generators/sorcery/templates/initializer.rb +24 -10
  7. data/lib/sorcery/adapters/active_record_adapter.rb +12 -14
  8. data/lib/sorcery/adapters/mongoid_adapter.rb +6 -8
  9. data/lib/sorcery/controller/config.rb +27 -29
  10. data/lib/sorcery/controller/submodules/activity_logging.rb +4 -7
  11. data/lib/sorcery/controller/submodules/brute_force_protection.rb +4 -1
  12. data/lib/sorcery/controller/submodules/external.rb +11 -11
  13. data/lib/sorcery/controller/submodules/http_basic_auth.rb +7 -2
  14. data/lib/sorcery/controller/submodules/remember_me.rb +2 -1
  15. data/lib/sorcery/controller/submodules/session_timeout.rb +2 -2
  16. data/lib/sorcery/controller.rb +36 -18
  17. data/lib/sorcery/crypto_providers/aes256.rb +4 -2
  18. data/lib/sorcery/crypto_providers/bcrypt.rb +2 -1
  19. data/lib/sorcery/crypto_providers/md5.rb +1 -0
  20. data/lib/sorcery/crypto_providers/sha1.rb +1 -0
  21. data/lib/sorcery/crypto_providers/sha256.rb +1 -0
  22. data/lib/sorcery/crypto_providers/sha512.rb +1 -0
  23. data/lib/sorcery/engine.rb +6 -4
  24. data/lib/sorcery/errors.rb +10 -0
  25. data/lib/sorcery/model/config.rb +20 -31
  26. data/lib/sorcery/model/submodules/activity_logging.rb +8 -6
  27. data/lib/sorcery/model/submodules/brute_force_protection.rb +16 -14
  28. data/lib/sorcery/model/submodules/external.rb +8 -10
  29. data/lib/sorcery/model/submodules/magic_login.rb +8 -4
  30. data/lib/sorcery/model/submodules/remember_me.rb +3 -3
  31. data/lib/sorcery/model/submodules/reset_password.rb +21 -13
  32. data/lib/sorcery/model/submodules/user_activation.rb +19 -17
  33. data/lib/sorcery/model/temporary_token.rb +5 -5
  34. data/lib/sorcery/model.rb +21 -25
  35. data/lib/sorcery/providers/base.rb +1 -1
  36. data/lib/sorcery/providers/facebook.rb +2 -2
  37. data/lib/sorcery/providers/github.rb +3 -3
  38. data/lib/sorcery/providers/heroku.rb +1 -2
  39. data/lib/sorcery/providers/jira.rb +3 -2
  40. data/lib/sorcery/providers/line.rb +2 -4
  41. data/lib/sorcery/providers/microsoft.rb +1 -1
  42. data/lib/sorcery/providers/twitter.rb +2 -2
  43. data/lib/sorcery/providers/vk.rb +4 -4
  44. data/lib/sorcery/providers/xing.rb +3 -2
  45. data/lib/sorcery/test_helpers/internal/rails.rb +5 -22
  46. data/lib/sorcery/test_helpers/internal.rb +4 -6
  47. data/lib/sorcery/test_helpers/rails/integration.rb +1 -1
  48. data/lib/sorcery/test_helpers/rails/request.rb +1 -1
  49. data/lib/sorcery/version.rb +1 -1
  50. data/lib/sorcery.rb +6 -1
  51. metadata +21 -150
  52. data/.devcontainer/Dockerfile +0 -10
  53. data/.devcontainer/devcontainer.json +0 -29
  54. data/.devcontainer/postcreate.sh +0 -4
  55. data/.document +0 -5
  56. data/.github/FUNDING.yml +0 -1
  57. data/.github/ISSUE_TEMPLATE.md +0 -24
  58. data/.github/PULL_REQUEST_TEMPLATE.md +0 -7
  59. data/.github/workflows/ruby.yml +0 -54
  60. data/.gitignore +0 -60
  61. data/.rspec +0 -1
  62. data/.rubocop.yml +0 -55
  63. data/.rubocop_todo.yml +0 -163
  64. data/CODE_OF_CONDUCT.md +0 -14
  65. data/Gemfile +0 -8
  66. data/MAINTAINING.md +0 -64
  67. data/Rakefile +0 -8
  68. data/SECURITY.md +0 -19
  69. data/gemfiles/rails_61.gemfile +0 -7
  70. data/gemfiles/rails_70.gemfile +0 -7
  71. data/gemfiles/rails_71.gemfile +0 -7
  72. data/sorcery.gemspec +0 -49
  73. data/spec/active_record/user_activation_spec.rb +0 -17
  74. data/spec/active_record/user_activity_logging_spec.rb +0 -15
  75. data/spec/active_record/user_brute_force_protection_spec.rb +0 -15
  76. data/spec/active_record/user_magic_login_spec.rb +0 -15
  77. data/spec/active_record/user_oauth_spec.rb +0 -15
  78. data/spec/active_record/user_remember_me_spec.rb +0 -15
  79. data/spec/active_record/user_reset_password_spec.rb +0 -15
  80. data/spec/active_record/user_spec.rb +0 -27
  81. data/spec/controllers/controller_activity_logging_spec.rb +0 -113
  82. data/spec/controllers/controller_brute_force_protection_spec.rb +0 -41
  83. data/spec/controllers/controller_http_basic_auth_spec.rb +0 -67
  84. data/spec/controllers/controller_oauth2_spec.rb +0 -568
  85. data/spec/controllers/controller_oauth_spec.rb +0 -266
  86. data/spec/controllers/controller_remember_me_spec.rb +0 -130
  87. data/spec/controllers/controller_session_timeout_spec.rb +0 -168
  88. data/spec/controllers/controller_spec.rb +0 -200
  89. data/spec/orm/active_record.rb +0 -21
  90. data/spec/providers/example_provider_spec.rb +0 -17
  91. data/spec/providers/example_spec.rb +0 -17
  92. data/spec/providers/examples_spec.rb +0 -17
  93. data/spec/providers/vk_spec.rb +0 -42
  94. data/spec/rails_app/app/active_record/authentication.rb +0 -3
  95. data/spec/rails_app/app/active_record/user.rb +0 -5
  96. data/spec/rails_app/app/active_record/user_provider.rb +0 -3
  97. data/spec/rails_app/app/assets/config/manifest.js +0 -1
  98. data/spec/rails_app/app/controllers/application_controller.rb +0 -2
  99. data/spec/rails_app/app/controllers/sorcery_controller.rb +0 -489
  100. data/spec/rails_app/app/helpers/application_helper.rb +0 -2
  101. data/spec/rails_app/app/mailers/sorcery_mailer.rb +0 -38
  102. data/spec/rails_app/app/views/application/index.html.erb +0 -17
  103. data/spec/rails_app/app/views/layouts/application.html.erb +0 -14
  104. data/spec/rails_app/app/views/sorcery_mailer/activation_email.html.erb +0 -17
  105. data/spec/rails_app/app/views/sorcery_mailer/activation_email.text.erb +0 -9
  106. data/spec/rails_app/app/views/sorcery_mailer/activation_needed_email.html.erb +0 -17
  107. data/spec/rails_app/app/views/sorcery_mailer/activation_success_email.html.erb +0 -17
  108. data/spec/rails_app/app/views/sorcery_mailer/activation_success_email.text.erb +0 -9
  109. data/spec/rails_app/app/views/sorcery_mailer/magic_login_email.html.erb +0 -13
  110. data/spec/rails_app/app/views/sorcery_mailer/magic_login_email.text.erb +0 -6
  111. data/spec/rails_app/app/views/sorcery_mailer/reset_password_email.html.erb +0 -16
  112. data/spec/rails_app/app/views/sorcery_mailer/reset_password_email.text.erb +0 -8
  113. data/spec/rails_app/app/views/sorcery_mailer/send_unlock_token_email.text.erb +0 -1
  114. data/spec/rails_app/config/application.rb +0 -61
  115. data/spec/rails_app/config/boot.rb +0 -4
  116. data/spec/rails_app/config/database.yml +0 -22
  117. data/spec/rails_app/config/environment.rb +0 -5
  118. data/spec/rails_app/config/environments/test.rb +0 -37
  119. data/spec/rails_app/config/initializers/backtrace_silencers.rb +0 -7
  120. data/spec/rails_app/config/initializers/compatible_legacy_migration.rb +0 -11
  121. data/spec/rails_app/config/initializers/inflections.rb +0 -10
  122. data/spec/rails_app/config/initializers/mime_types.rb +0 -5
  123. data/spec/rails_app/config/initializers/session_store.rb +0 -12
  124. data/spec/rails_app/config/locales/en.yml +0 -5
  125. data/spec/rails_app/config/routes.rb +0 -81
  126. data/spec/rails_app/config/secrets.yml +0 -4
  127. data/spec/rails_app/config.ru +0 -4
  128. data/spec/rails_app/db/migrate/activation/20101224223622_add_activation_to_users.rb +0 -17
  129. data/spec/rails_app/db/migrate/activity_logging/20101224223624_add_activity_logging_to_users.rb +0 -19
  130. data/spec/rails_app/db/migrate/brute_force_protection/20101224223626_add_brute_force_protection_to_users.rb +0 -13
  131. data/spec/rails_app/db/migrate/core/20101224223620_create_users.rb +0 -16
  132. data/spec/rails_app/db/migrate/external/20101224223628_create_authentications_and_user_providers.rb +0 -22
  133. data/spec/rails_app/db/migrate/invalidate_active_sessions/20180221093235_add_invalidate_active_sessions_before_to_users.rb +0 -9
  134. data/spec/rails_app/db/migrate/magic_login/20170924151831_add_magic_login_to_users.rb +0 -17
  135. data/spec/rails_app/db/migrate/remember_me/20101224223623_add_remember_me_token_to_users.rb +0 -15
  136. data/spec/rails_app/db/migrate/reset_password/20101224223622_add_reset_password_to_users.rb +0 -15
  137. data/spec/rails_app/db/schema.rb +0 -21
  138. data/spec/rails_app/db/seeds.rb +0 -7
  139. data/spec/shared_examples/user_activation_shared_examples.rb +0 -361
  140. data/spec/shared_examples/user_activity_logging_shared_examples.rb +0 -106
  141. data/spec/shared_examples/user_brute_force_protection_shared_examples.rb +0 -151
  142. data/spec/shared_examples/user_magic_login_shared_examples.rb +0 -150
  143. data/spec/shared_examples/user_oauth_shared_examples.rb +0 -33
  144. data/spec/shared_examples/user_remember_me_shared_examples.rb +0 -129
  145. data/spec/shared_examples/user_reset_password_shared_examples.rb +0 -370
  146. data/spec/shared_examples/user_shared_examples.rb +0 -678
  147. data/spec/sorcery_crypto_providers_spec.rb +0 -245
  148. data/spec/sorcery_temporary_token_spec.rb +0 -27
  149. data/spec/spec.opts +0 -2
  150. data/spec/spec_helper.rb +0 -50
  151. data/spec/support/migration_helper.rb +0 -29
  152. data/spec/support/providers/example.rb +0 -11
  153. data/spec/support/providers/example_provider.rb +0 -11
  154. data/spec/support/providers/examples.rb +0 -11
@@ -1,54 +0,0 @@
1
- name: Test Suite
2
-
3
- # Run against all commits and pull requests.
4
- on:
5
- schedule:
6
- - cron: '0 0 * * *'
7
- push:
8
- pull_request:
9
-
10
- jobs:
11
- test_matrix:
12
-
13
- runs-on: ubuntu-latest
14
-
15
- strategy:
16
- fail-fast: false
17
- matrix:
18
- ruby:
19
- - '3.0'
20
- - '3.1'
21
- - '3.2'
22
- - '3.3'
23
-
24
- rails:
25
- - '61'
26
- - '70'
27
- - '71'
28
-
29
- exclude:
30
- - ruby: '3.3'
31
- rails: '70'
32
- - ruby: '3.3'
33
- rails: '61'
34
- - ruby: '3.2'
35
- rails: '61'
36
- env:
37
- BUNDLE_GEMFILE: gemfiles/rails_${{ matrix.rails }}.gemfile
38
-
39
- steps:
40
- - uses: actions/checkout@v4
41
- - name: Set up Ruby
42
- uses: ruby/setup-ruby@v1
43
- with:
44
- ruby-version: ${{ matrix.ruby }}
45
- bundler-cache: true
46
- - name: Run tests
47
- run: bundle exec rake spec
48
-
49
- finish:
50
- runs-on: ubuntu-latest
51
- needs: [ test_matrix ]
52
- steps:
53
- - name: Wait for status checks
54
- run: echo "All Green!"
data/.gitignore DELETED
@@ -1,60 +0,0 @@
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
- vendor
14
-
15
- # jeweler generated
16
- pkg
17
-
18
- # byebug generated
19
- .byebug_history
20
-
21
- # for RVM
22
- .rvmrc
23
-
24
- # for RubyMine
25
- .idea
26
-
27
- # Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
28
- #
29
- # * Create a file at ~/.gitignore
30
- # * Include files you want ignored
31
- # * Run: git config --global core.excludesfile ~/.gitignore
32
- #
33
- # After doing this, these files will be ignored in all your git projects,
34
- # saving you from having to 'pollute' every project you touch with them
35
- #
36
- # 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)
37
- #
38
- # For MacOS:
39
- #
40
- #.DS_Store
41
- #
42
- # For TextMate
43
- #*.tmproj
44
- tmtags
45
- #
46
- # For emacs:
47
- #*~
48
- #\#*
49
- #.\#*
50
- #
51
- # For vim:
52
- #*.swp
53
- #
54
- spec/rails_app/log/*
55
- *.log
56
- *.sqlite3*
57
- Gemfile*.lock
58
- gemfiles/*.lock
59
- .ruby-version
60
- tags
data/.rspec DELETED
@@ -1 +0,0 @@
1
- --color
data/.rubocop.yml DELETED
@@ -1,55 +0,0 @@
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 DELETED
@@ -1,163 +0,0 @@
1
- # This configuration was generated by
2
- # `rubocop --auto-gen-config`
3
- # on 2021-04-04 05:00:11 UTC using RuboCop version 0.88.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: 2
17
- # Cop supports --auto-correct.
18
- # Configuration parameters: IndentationWidth.
19
- # SupportedStyles: special_inside_parentheses, consistent, align_braces
20
- Layout/FirstHashElementIndentation:
21
- EnforcedStyle: consistent
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: 3
33
- # Cop supports --auto-correct.
34
- # Configuration parameters: AllowInHeredoc.
35
- Layout/TrailingWhitespace:
36
- Exclude:
37
- - 'lib/sorcery/controller/submodules/external.rb'
38
-
39
- # Offense count: 2
40
- # Configuration parameters: AllowSafeAssignment.
41
- Lint/AssignmentInCondition:
42
- Exclude:
43
- - 'spec/rails_app/app/controllers/sorcery_controller.rb'
44
-
45
- # Offense count: 1
46
- # Cop supports --auto-correct.
47
- Lint/NonDeterministicRequireOrder:
48
- Exclude:
49
- - 'spec/spec_helper.rb'
50
-
51
- # Offense count: 4
52
- # Cop supports --auto-correct.
53
- Lint/RedundantCopDisableDirective:
54
- Exclude:
55
- - 'lib/sorcery/controller.rb'
56
- - 'lib/sorcery/model.rb'
57
- - 'spec/rails_app/config/application.rb'
58
- - 'spec/shared_examples/user_shared_examples.rb'
59
-
60
- # Offense count: 4
61
- # Cop supports --auto-correct.
62
- Lint/SendWithMixinArgument:
63
- Exclude:
64
- - 'lib/sorcery.rb'
65
- - 'lib/sorcery/engine.rb'
66
- - 'lib/sorcery/test_helpers/internal/rails.rb'
67
-
68
- # Offense count: 2
69
- # Cop supports --auto-correct.
70
- # Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments.
71
- Lint/UnusedBlockArgument:
72
- Exclude:
73
- - 'spec/shared_examples/user_shared_examples.rb'
74
-
75
- # Offense count: 1
76
- # Cop supports --auto-correct.
77
- # Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions.
78
- # SupportedStyles: assign_to_condition, assign_inside_condition
79
- Style/ConditionalAssignment:
80
- Exclude:
81
- - 'lib/sorcery/adapters/active_record_adapter.rb'
82
-
83
- # Offense count: 1
84
- # Cop supports --auto-correct.
85
- Style/ExpandPathArguments:
86
- Exclude:
87
- - 'spec/rails_app/config.ru'
88
-
89
- # Offense count: 1
90
- # Configuration parameters: EnforcedStyle.
91
- # SupportedStyles: annotated, template, unannotated
92
- Style/FormatStringToken:
93
- Exclude:
94
- - 'lib/generators/sorcery/install_generator.rb'
95
-
96
- # Offense count: 125
97
- # Cop supports --auto-correct.
98
- # Configuration parameters: EnforcedStyle.
99
- # SupportedStyles: always, always_true, never
100
- Style/FrozenStringLiteralComment:
101
- Enabled: false
102
-
103
- # Offense count: 3
104
- # Cop supports --auto-correct.
105
- # Configuration parameters: EnforcedStyle, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
106
- # SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
107
- Style/HashSyntax:
108
- Exclude:
109
- - 'lib/sorcery/adapters/active_record_adapter.rb'
110
- - 'lib/sorcery/test_helpers/rails/integration.rb'
111
-
112
- # Offense count: 34
113
- # Cop supports --auto-correct.
114
- Style/IfUnlessModifier:
115
- Enabled: false
116
-
117
- # Offense count: 1
118
- # Cop supports --auto-correct.
119
- Style/MultilineIfModifier:
120
- Exclude:
121
- - 'lib/sorcery/providers/line.rb'
122
-
123
- # Offense count: 2
124
- # Cop supports --auto-correct.
125
- Style/RedundantBegin:
126
- Exclude:
127
- - 'lib/sorcery/controller.rb'
128
- - 'lib/sorcery/model.rb'
129
-
130
- # Offense count: 4
131
- # Cop supports --auto-correct.
132
- # Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods.
133
- # AllowedMethods: present?, blank?, presence, try, try!
134
- Style/SafeNavigation:
135
- Exclude:
136
- - 'lib/sorcery/controller/config.rb'
137
- - 'lib/sorcery/controller/submodules/brute_force_protection.rb'
138
- - 'lib/sorcery/controller/submodules/remember_me.rb'
139
- - 'lib/sorcery/model.rb'
140
-
141
- # Offense count: 7
142
- # Cop supports --auto-correct.
143
- # Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
144
- # SupportedStyles: single_quotes, double_quotes
145
- Style/StringLiterals:
146
- Exclude:
147
- - 'spec/controllers/controller_oauth2_spec.rb'
148
- - 'spec/sorcery_crypto_providers_spec.rb'
149
-
150
- # Offense count: 1
151
- # Cop supports --auto-correct.
152
- # Configuration parameters: EnforcedStyle, MinSize.
153
- # SupportedStyles: percent, brackets
154
- Style/SymbolArray:
155
- Exclude:
156
- - 'Rakefile'
157
-
158
- # Offense count: 2
159
- # Cop supports --auto-correct.
160
- Style/UnpackFirst:
161
- Exclude:
162
- - 'lib/sorcery/crypto_providers/aes256.rb'
163
- - 'spec/sorcery_crypto_providers_spec.rb'
data/CODE_OF_CONDUCT.md DELETED
@@ -1,14 +0,0 @@
1
- # The Sorcery Community Code of Conduct
2
-
3
- This document provides a few simple community guidelines for a safe, respectful,
4
- productive, and collaborative place for any person who is willing to contribute
5
- to the Sorcery community. It applies to all "collaborative spaces", which are
6
- defined as community communications channels (such as mailing lists, submitted
7
- patches, commit comments, etc.).
8
-
9
- * Participants will be tolerant of opposing views.
10
- * Participants must ensure that their language and actions are free of personal
11
- attacks and disparaging personal remarks.
12
- * When interpreting the words and actions of others, participants should always
13
- assume good intentions.
14
- * Behaviour which can be reasonably considered harassment will not be tolerated.
data/Gemfile DELETED
@@ -1,8 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gem 'pry'
4
- gem 'rails'
5
- gem 'rails-controller-testing'
6
- gem 'sqlite3'
7
-
8
- gemspec
data/MAINTAINING.md DELETED
@@ -1,64 +0,0 @@
1
- # Maintaining Sorcery
2
-
3
- This will eventually be fleshed out so that anyone should be able to pick up and
4
- maintain Sorcery by following this guide. It will provide step-by-step guides
5
- for common tasks such as releasing new versions, as well as explain how to
6
- triage issues and keep the CHANGELOG up-to-date.
7
-
8
- ## Table of Contents
9
-
10
- 1. [Merging Pull Requests](#merging-pull-requests)
11
- 1. [Versioning](#versioning)
12
- 1. [Version Naming](#version-naming)
13
- 1. [Releasing a New Version](#releasing-a-new-version)
14
-
15
- ## Merging Pull Requests
16
-
17
- TODO
18
-
19
- ## Versioning
20
-
21
- ### Version Naming
22
-
23
- Sorcery uses semantic versioning which can be found at: https://semver.org/
24
-
25
- All versions of Sorcery should follow this format: `MAJOR.MINOR.PATCH`
26
-
27
- Where:
28
-
29
- * MAJOR - Includes backwards **incompatible** changes.
30
- * MINOR - Introduces new functionality but is fully backwards compatible.
31
- * PATCH - Fixes errors in existing functionality (must be backwards compatible).
32
-
33
- The changelog and git tags should use `vMAJOR.MINOR.PATCH` to indicate that the
34
- number represents a version of Sorcery. For example, `1.0.0` would become
35
- `v1.0.0`.
36
-
37
- ### Releasing a New Version
38
-
39
- When it's time to release a new version, you'll want to ensure all the changes
40
- you need are on the master branch and that there is a passing build. Then follow
41
- this checklist and prepare a release commit:
42
-
43
- NOTE: `X.Y.Z` and `vX.Y.Z` are given as examples, and should be replaced with
44
- whatever version you are releasing. See: [Version Naming](#version-naming)
45
-
46
- 1. Update CHANGELOG.md
47
- 1. Check for any changes that have been included since the last release that
48
- are not reflected in the changelog. Add any missing entries to the `HEAD`
49
- section.
50
- 1. Check the changes in `HEAD` to determine what version increment is
51
- appropriate. See [Version Naming](#version-naming) if unsure.
52
- 1. Replace `## HEAD` with `## vX.Y.Z` and create a new `## HEAD` section
53
- above the latest version.
54
- 1. Update Gem Version
55
- 1. Update `./lib/sorcery/version.rb` to 'X.Y.Z'
56
- 1. Stage your changes and create a commit
57
- 1. `git add -A`
58
- 1. `git commit -m "Release vX.Y.Z"`
59
- 1. TODO: Gem Release (WIP)
60
- 1. `cd <dir>`
61
- 1. `gem build`
62
- 1. `gem push <filename>`
63
- 1. TODO: Version tagging
64
- 1. Release new version via github interface
data/Rakefile DELETED
@@ -1,8 +0,0 @@
1
- require 'bundler/gem_tasks'
2
-
3
- require 'rspec/core/rake_task'
4
- require 'rubocop/rake_task'
5
- RSpec::Core::RakeTask.new(:spec)
6
- RuboCop::RakeTask.new
7
-
8
- task default: [:rubocop, :spec]
data/SECURITY.md DELETED
@@ -1,19 +0,0 @@
1
- # Security Policy
2
-
3
- ## Supported Versions
4
-
5
- | Version | Supported |
6
- | --------- | ------------------ |
7
- | ~> 0.16.0 | :white_check_mark: |
8
- | ~> 0.15.0 | :white_check_mark: |
9
- | < 0.15.0 | :x: |
10
-
11
- ## Reporting a Vulnerability
12
-
13
- Email the current maintainer(s) with a description of the vulnerability. You
14
- should expect a response within 48 hours. If the vulnerability is accepted, a
15
- Github advisory will be created and eventually released with a CVE corresponding
16
- to the issue found.
17
-
18
- A list of the current maintainers can be found on the README under the contact
19
- section. See: [README.md](https://github.com/Sorcery/sorcery#contact)
@@ -1,7 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gem 'rails', '~> 6.1.0'
4
- gem 'rails-controller-testing'
5
- gem 'sqlite3', '~> 1.4'
6
- gem 'rspec-rails', '>= 5.0'
7
- gemspec path: '..'
@@ -1,7 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gem 'rails', '~> 7.0.0'
4
- gem 'rails-controller-testing'
5
- gem 'sqlite3', '~> 1.4'
6
- gem 'rspec-rails', '>= 6.0'
7
- gemspec path: '..'
@@ -1,7 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gem 'rails', '~> 7.1.0'
4
- gem 'rails-controller-testing'
5
- gem 'sqlite3', '~> 1.4'
6
- gem 'rspec-rails', '>= 6.1'
7
- gemspec path: '..'
data/sorcery.gemspec DELETED
@@ -1,49 +0,0 @@
1
- lib = File.expand_path('lib', __dir__)
2
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
- require 'sorcery/version'
4
-
5
- # rubocop:disable Metrics/BlockLength
6
- Gem::Specification.new do |s|
7
- s.name = 'sorcery'
8
- s.version = Sorcery::VERSION
9
- s.authors = [
10
- 'Noam Ben Ari',
11
- 'Kir Shatrov',
12
- 'Grzegorz Witek',
13
- 'Chase Gilliam',
14
- 'Josh Buker'
15
- ]
16
- s.email = [
17
- 'crypto@joshbuker.com'
18
- ]
19
-
20
- # TODO: Cleanup formatting.
21
- # rubocop:disable Layout/LineLength
22
- s.description = 'Provides common authentication needs such as signing in/out, activating by email and resetting password.'
23
- s.summary = 'Magical authentication for Rails applications'
24
- s.homepage = 'https://github.com/Sorcery/sorcery'
25
- s.post_install_message = "As of version 1.0 oauth/oauth2 won't be automatically bundled so you may need to add those dependencies to your Gemfile.\n"
26
- s.post_install_message += 'You may need oauth2 if you use external providers such as any of these: https://github.com/Sorcery/sorcery/tree/master/lib/sorcery/providers'
27
- # rubocop:enable Layout/LineLength
28
-
29
- s.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
30
- s.require_paths = ['lib']
31
-
32
- s.licenses = ['MIT']
33
-
34
- s.required_ruby_version = '>= 2.4.9'
35
-
36
- s.add_dependency 'bcrypt', '~> 3.1'
37
- s.add_dependency 'oauth', '>= 0.6'
38
- s.add_dependency 'oauth2', '~> 2.0'
39
-
40
- s.add_development_dependency 'byebug', '~> 10.0.0'
41
- s.add_development_dependency 'rspec-rails'
42
- s.add_development_dependency 'rubocop'
43
- s.add_development_dependency 'simplecov', '>= 0.3.8'
44
- s.add_development_dependency 'test-unit', '~> 3.2.0'
45
- s.add_development_dependency 'timecop'
46
- s.add_development_dependency 'webmock', '~> 3.3.0'
47
- s.add_development_dependency 'yard', '~> 0.9.0', '>= 0.9.12'
48
- end
49
- # rubocop:enable Metrics/BlockLength
@@ -1,17 +0,0 @@
1
- require 'spec_helper'
2
-
3
- require 'rails_app/app/mailers/sorcery_mailer'
4
- require 'shared_examples/user_activation_shared_examples'
5
-
6
- describe User, 'with activation submodule', active_record: true do
7
- before(:all) do
8
- MigrationHelper.migrate("#{Rails.root}/db/migrate/activation")
9
- User.reset_column_information
10
- end
11
-
12
- after(:all) do
13
- MigrationHelper.rollback("#{Rails.root}/db/migrate/activation")
14
- end
15
-
16
- it_behaves_like 'rails_3_activation_model'
17
- end
@@ -1,15 +0,0 @@
1
- require 'spec_helper'
2
- require 'shared_examples/user_activity_logging_shared_examples'
3
-
4
- describe User, 'with activity logging submodule', active_record: true do
5
- before(:all) do
6
- MigrationHelper.migrate("#{Rails.root}/db/migrate/activity_logging")
7
- User.reset_column_information
8
- end
9
-
10
- after(:all) do
11
- MigrationHelper.rollback("#{Rails.root}/db/migrate/activity_logging")
12
- end
13
-
14
- it_behaves_like 'rails_3_activity_logging_model'
15
- end
@@ -1,15 +0,0 @@
1
- require 'spec_helper'
2
- require 'shared_examples/user_brute_force_protection_shared_examples'
3
-
4
- describe User, 'with brute_force_protection submodule', active_record: true do
5
- before(:all) do
6
- MigrationHelper.migrate("#{Rails.root}/db/migrate/brute_force_protection")
7
- User.reset_column_information
8
- end
9
-
10
- after(:all) do
11
- MigrationHelper.rollback("#{Rails.root}/db/migrate/brute_force_protection")
12
- end
13
-
14
- it_behaves_like 'rails_3_brute_force_protection_model'
15
- end
@@ -1,15 +0,0 @@
1
- require 'spec_helper'
2
- require 'shared_examples/user_magic_login_shared_examples'
3
-
4
- describe User, 'with magic_login submodule', active_record: true do
5
- before(:all) do
6
- MigrationHelper.migrate("#{Rails.root}/db/migrate/magic_login")
7
- User.reset_column_information
8
- end
9
-
10
- after(:all) do
11
- MigrationHelper.rollback("#{Rails.root}/db/migrate/magic_login")
12
- end
13
-
14
- it_behaves_like 'magic_login_model'
15
- end
@@ -1,15 +0,0 @@
1
- require 'spec_helper'
2
- require 'shared_examples/user_oauth_shared_examples'
3
-
4
- describe User, 'with oauth submodule', active_record: true do
5
- before(:all) do
6
- MigrationHelper.migrate("#{Rails.root}/db/migrate/external")
7
- User.reset_column_information
8
- end
9
-
10
- after(:all) do
11
- MigrationHelper.rollback("#{Rails.root}/db/migrate/external")
12
- end
13
-
14
- it_behaves_like 'rails_3_oauth_model'
15
- end
@@ -1,15 +0,0 @@
1
- require 'spec_helper'
2
- require 'shared_examples/user_remember_me_shared_examples'
3
-
4
- describe User, 'with remember_me submodule', active_record: true do
5
- before(:all) do
6
- MigrationHelper.migrate("#{Rails.root}/db/migrate/remember_me")
7
- User.reset_column_information
8
- end
9
-
10
- after(:all) do
11
- MigrationHelper.rollback("#{Rails.root}/db/migrate/remember_me")
12
- end
13
-
14
- it_behaves_like 'rails_3_remember_me_model'
15
- end
@@ -1,15 +0,0 @@
1
- require 'spec_helper'
2
- require 'shared_examples/user_reset_password_shared_examples'
3
-
4
- describe User, 'with reset_password submodule', active_record: true do
5
- before(:all) do
6
- MigrationHelper.migrate("#{Rails.root}/db/migrate/reset_password")
7
- User.reset_column_information
8
- end
9
-
10
- after(:all) do
11
- MigrationHelper.rollback("#{Rails.root}/db/migrate/reset_password")
12
- end
13
-
14
- it_behaves_like 'rails_3_reset_password_model'
15
- end
@@ -1,27 +0,0 @@
1
- require 'spec_helper'
2
- require 'rails_app/app/mailers/sorcery_mailer'
3
- require 'shared_examples/user_shared_examples'
4
-
5
- describe User, 'with no submodules (core)', active_record: true do
6
- before(:all) do
7
- sorcery_reload!
8
- end
9
-
10
- context 'when app has plugin loaded' do
11
- it 'responds to the plugin activation class method' do
12
- expect(ActiveRecord::Base).to respond_to :authenticates_with_sorcery!
13
- end
14
-
15
- it 'User responds to .authenticates_with_sorcery!' do
16
- expect(User).to respond_to :authenticates_with_sorcery!
17
- end
18
- end
19
-
20
- # ----------------- PLUGIN CONFIGURATION -----------------------
21
-
22
- it_should_behave_like 'rails_3_core_model'
23
-
24
- describe 'external users' do
25
- it_should_behave_like 'external_user'
26
- end
27
- end