sorcery 0.16.2 → 0.16.4
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 +4 -4
- data/.github/ISSUE_TEMPLATE.md +8 -4
- data/.github/PULL_REQUEST_TEMPLATE.md +2 -0
- data/.github/workflows/ruby.yml +24 -3
- data/CHANGELOG.md +10 -0
- data/MAINTAINING.md +64 -0
- data/gemfiles/rails_61.gemfile +7 -0
- data/gemfiles/rails_70.gemfile +7 -0
- data/lib/sorcery/controller/submodules/external.rb +2 -2
- data/lib/sorcery/controller.rb +1 -1
- data/lib/sorcery/version.rb +1 -1
- data/sorcery.gemspec +1 -1
- data/spec/providers/examples_spec.rb +17 -0
- data/spec/support/providers/examples.rb +11 -0
- metadata +10 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ebeaecab44b52bef2e5f573c2fbf08e4e03d2f50ef96f3ce27a70002e145f50b
|
4
|
+
data.tar.gz: 5c9fb4fb3792b3a0b2700fd438c730328d769b4223daccd6f4fea36bdaad68c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fed510d0cb545bb01bd1f9cdb7d6a79f129e977019355d41a1656d3f02f3130880d177e302b63a57f5e13ca1f15764bb3189f9e5df1aa20a9db58c4dd98dc551
|
7
|
+
data.tar.gz: 525e7f3f4ec290b71bfc7a39d2fa82a0213c7aaf99ce0005794eef266643a3db0dc105cb0580a766c7387375ff1633e26bb1506fd8389ed852c7f39451614dbc
|
data/.github/ISSUE_TEMPLATE.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Please complete all sections.
|
1
|
+
<!-- Please complete all sections. -->
|
2
2
|
|
3
3
|
### Configuration
|
4
4
|
|
@@ -9,12 +9,16 @@ Please complete all sections.
|
|
9
9
|
|
10
10
|
### Expected Behavior
|
11
11
|
|
12
|
-
Tell us what should happen.
|
12
|
+
<!-- Tell us what should happen. -->
|
13
13
|
|
14
14
|
### Actual Behavior
|
15
15
|
|
16
|
-
Tell us what happens instead.
|
16
|
+
<!-- Tell us what happens instead. -->
|
17
17
|
|
18
18
|
### Steps to Reproduce
|
19
19
|
|
20
|
-
Please list all steps to reproduce the issue.
|
20
|
+
<!-- Please list all steps to reproduce the issue. -->
|
21
|
+
|
22
|
+
1.
|
23
|
+
2.
|
24
|
+
3.
|
@@ -3,3 +3,5 @@ Please ensure your pull request includes the following:
|
|
3
3
|
- [ ] Description of changes
|
4
4
|
- [ ] Update to CHANGELOG.md with short description and link to pull request
|
5
5
|
- [ ] Changes have related RSpec tests that ensure functionality does not break
|
6
|
+
|
7
|
+
<!-- For the changelog, please add your entry to the HEAD section. Do not create a new release header. -->
|
data/.github/workflows/ruby.yml
CHANGED
@@ -1,7 +1,11 @@
|
|
1
1
|
name: Test Suite
|
2
2
|
|
3
3
|
# Run against all commits and pull requests.
|
4
|
-
on:
|
4
|
+
on:
|
5
|
+
schedule:
|
6
|
+
- cron: '0 0 * * *'
|
7
|
+
push:
|
8
|
+
pull_request:
|
5
9
|
|
6
10
|
jobs:
|
7
11
|
test_matrix:
|
@@ -16,17 +20,34 @@ jobs:
|
|
16
20
|
- 2.5
|
17
21
|
- 2.6
|
18
22
|
- 2.7
|
19
|
-
- 3.0
|
23
|
+
- 3.0.0
|
24
|
+
# - 3.1
|
20
25
|
|
21
26
|
rails:
|
22
27
|
- '52'
|
23
28
|
- '60'
|
29
|
+
- '61'
|
30
|
+
# - '70'
|
24
31
|
|
25
32
|
exclude:
|
26
33
|
- ruby: 2.4
|
27
34
|
rails: '60'
|
28
|
-
- ruby:
|
35
|
+
- ruby: 2.4
|
36
|
+
rails: '61'
|
37
|
+
# - ruby: 2.4
|
38
|
+
# rails: '70'
|
39
|
+
# - ruby: 2.5
|
40
|
+
# rails: '70'
|
41
|
+
# - ruby: 2.6
|
42
|
+
# rails: '70'
|
43
|
+
- ruby: 3.0.0
|
29
44
|
rails: '52'
|
45
|
+
# - ruby: 3.1
|
46
|
+
# rails: '52'
|
47
|
+
# - ruby: 3.1
|
48
|
+
# rails: '60'
|
49
|
+
# - ruby: 3.1
|
50
|
+
# rails: '61'
|
30
51
|
|
31
52
|
env:
|
32
53
|
BUNDLE_GEMFILE: gemfiles/rails_${{ matrix.rails }}.gemfile
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,16 @@
|
|
1
1
|
# Changelog
|
2
2
|
## HEAD
|
3
3
|
|
4
|
+
## 0.16.4
|
5
|
+
|
6
|
+
* Adapt to open request protection strategy of rails 7.0 [#318](https://github.com/Sorcery/sorcery/pull/318)
|
7
|
+
* Update OAuth2 gem to v2 per v1 deprecation [#323](https://github.com/Sorcery/sorcery/pull/323)
|
8
|
+
* Fixed typo in error message [#310](https://github.com/Sorcery/sorcery/pull/310)
|
9
|
+
|
10
|
+
## 0.16.3
|
11
|
+
|
12
|
+
* Fix provider instantiation for plural provider names (eg. okta) [#305](https://github.com/Sorcery/sorcery/pull/305)
|
13
|
+
|
4
14
|
## 0.16.2
|
5
15
|
|
6
16
|
* Inline core migration index definition [#281](https://github.com/Sorcery/sorcery/pull/281)
|
data/MAINTAINING.md
ADDED
@@ -0,0 +1,64 @@
|
|
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
|
@@ -40,7 +40,7 @@ module Sorcery
|
|
40
40
|
providers.each do |name|
|
41
41
|
class_eval <<-RUBY, __FILE__, __LINE__ + 1
|
42
42
|
def self.#{name}
|
43
|
-
@#{name} ||= Sorcery::Providers.const_get('#{name}'.to_s.
|
43
|
+
@#{name} ||= Sorcery::Providers.const_get('#{name}'.to_s.camelcase).new
|
44
44
|
end
|
45
45
|
RUBY
|
46
46
|
end
|
@@ -118,7 +118,7 @@ module Sorcery
|
|
118
118
|
# sends user to authenticate at the provider's website.
|
119
119
|
# after authentication the user is redirected to the callback defined in the provider config
|
120
120
|
def login_at(provider_name, args = {})
|
121
|
-
redirect_to sorcery_login_url(provider_name, args)
|
121
|
+
redirect_to sorcery_login_url(provider_name, args), allow_other_host: true
|
122
122
|
end
|
123
123
|
|
124
124
|
# tries to login the user from provider's callback
|
data/lib/sorcery/controller.rb
CHANGED
@@ -165,7 +165,7 @@ module Sorcery
|
|
165
165
|
def user_class
|
166
166
|
@user_class ||= Config.user_class.to_s.constantize
|
167
167
|
rescue NameError
|
168
|
-
raise ArgumentError, 'You have incorrectly defined user_class or have forgotten to define it in
|
168
|
+
raise ArgumentError, 'You have incorrectly defined user_class or have forgotten to define it in the initializer file (config.user_class = \'User\').'
|
169
169
|
end
|
170
170
|
end
|
171
171
|
end
|
data/lib/sorcery/version.rb
CHANGED
data/sorcery.gemspec
CHANGED
@@ -35,7 +35,7 @@ Gem::Specification.new do |s|
|
|
35
35
|
|
36
36
|
s.add_dependency 'bcrypt', '~> 3.1'
|
37
37
|
s.add_dependency 'oauth', '~> 0.5', '>= 0.5.5'
|
38
|
-
s.add_dependency 'oauth2', '~>
|
38
|
+
s.add_dependency 'oauth2', '~> 2.0'
|
39
39
|
|
40
40
|
s.add_development_dependency 'byebug', '~> 10.0.0'
|
41
41
|
s.add_development_dependency 'rspec-rails', '~> 3.7.0'
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
require 'sorcery/providers/base'
|
5
|
+
|
6
|
+
describe Sorcery::Providers::Examples do
|
7
|
+
before(:all) do
|
8
|
+
sorcery_reload!([:external])
|
9
|
+
sorcery_controller_property_set(:external_providers, [:examples])
|
10
|
+
end
|
11
|
+
|
12
|
+
context 'fetching a plural custom provider' do
|
13
|
+
it 'returns the provider' do
|
14
|
+
expect(Sorcery::Controller::Config.examples).to be_a(Sorcery::Providers::Examples)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sorcery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.16.
|
4
|
+
version: 0.16.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Noam Ben Ari
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date:
|
15
|
+
date: 2022-10-04 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: bcrypt
|
@@ -54,20 +54,14 @@ dependencies:
|
|
54
54
|
requirements:
|
55
55
|
- - "~>"
|
56
56
|
- !ruby/object:Gem::Version
|
57
|
-
version: '
|
58
|
-
- - ">="
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
version: 0.8.0
|
57
|
+
version: '2.0'
|
61
58
|
type: :runtime
|
62
59
|
prerelease: false
|
63
60
|
version_requirements: !ruby/object:Gem::Requirement
|
64
61
|
requirements:
|
65
62
|
- - "~>"
|
66
63
|
- !ruby/object:Gem::Version
|
67
|
-
version: '
|
68
|
-
- - ">="
|
69
|
-
- !ruby/object:Gem::Version
|
70
|
-
version: 0.8.0
|
64
|
+
version: '2.0'
|
71
65
|
- !ruby/object:Gem::Dependency
|
72
66
|
name: byebug
|
73
67
|
requirement: !ruby/object:Gem::Requirement
|
@@ -207,11 +201,14 @@ files:
|
|
207
201
|
- CODE_OF_CONDUCT.md
|
208
202
|
- Gemfile
|
209
203
|
- LICENSE.md
|
204
|
+
- MAINTAINING.md
|
210
205
|
- README.md
|
211
206
|
- Rakefile
|
212
207
|
- SECURITY.md
|
213
208
|
- gemfiles/rails_52.gemfile
|
214
209
|
- gemfiles/rails_60.gemfile
|
210
|
+
- gemfiles/rails_61.gemfile
|
211
|
+
- gemfiles/rails_70.gemfile
|
215
212
|
- lib/generators/sorcery/USAGE
|
216
213
|
- lib/generators/sorcery/helpers.rb
|
217
214
|
- lib/generators/sorcery/install_generator.rb
|
@@ -304,6 +301,7 @@ files:
|
|
304
301
|
- spec/orm/active_record.rb
|
305
302
|
- spec/providers/example_provider_spec.rb
|
306
303
|
- spec/providers/example_spec.rb
|
304
|
+
- spec/providers/examples_spec.rb
|
307
305
|
- spec/providers/vk_spec.rb
|
308
306
|
- spec/rails_app/app/active_record/authentication.rb
|
309
307
|
- spec/rails_app/app/active_record/user.rb
|
@@ -365,6 +363,7 @@ files:
|
|
365
363
|
- spec/support/migration_helper.rb
|
366
364
|
- spec/support/providers/example.rb
|
367
365
|
- spec/support/providers/example_provider.rb
|
366
|
+
- spec/support/providers/examples.rb
|
368
367
|
homepage: https://github.com/Sorcery/sorcery
|
369
368
|
licenses:
|
370
369
|
- MIT
|
@@ -386,7 +385,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
386
385
|
- !ruby/object:Gem::Version
|
387
386
|
version: '0'
|
388
387
|
requirements: []
|
389
|
-
rubygems_version: 3.
|
388
|
+
rubygems_version: 3.1.4
|
390
389
|
signing_key:
|
391
390
|
specification_version: 4
|
392
391
|
summary: Magical authentication for Rails applications
|