sorcery 0.16.3 → 0.16.5
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/.devcontainer/Dockerfile +10 -0
- data/.devcontainer/devcontainer.json +29 -0
- data/.devcontainer/postcreate.sh +4 -0
- data/.gitignore +1 -0
- data/CHANGELOG.md +11 -0
- data/lib/sorcery/controller/submodules/external.rb +1 -1
- data/lib/sorcery/controller.rb +1 -1
- data/lib/sorcery/model/submodules/reset_password.rb +2 -0
- data/lib/sorcery/protocols/oauth2.rb +1 -0
- data/lib/sorcery/version.rb +1 -1
- data/sorcery.gemspec +2 -2
- data/spec/shared_examples/user_reset_password_shared_examples.rb +12 -0
- metadata +10 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e28e735926cc783f48b5f8708fcdba63b66d20c54acb46197a633c3a2c27ed9f
|
4
|
+
data.tar.gz: c48a71718894e02b6d556143d7019b64698d938faf3d82cc97362314e5d821eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94876b13d7838ab273e7cf01489914dfce2cdf9f27259f2f3dcb98d62dfe126b65daf3dde018c6423e4a6fbe9b526339c85dfa978dcdf61698ce77b42f722a4d
|
7
|
+
data.tar.gz: 4defd2381f95ab3b89c859430a68fe9c0bb5068d09276100c80996b196448c1289057b3f8059c2d1188199bd0ae3852c6bd5c33a0701c61cd27c1acd7b692ac1
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# Which Ruby version to use. You may need to use a more restrictive version,
|
2
|
+
# e.g. `3.0`
|
3
|
+
ARG VARIANT=3.0
|
4
|
+
|
5
|
+
# Pull Microsoft's ruby devcontainer base image
|
6
|
+
FROM mcr.microsoft.com/devcontainers/ruby:${VARIANT}
|
7
|
+
|
8
|
+
# Ensure we're running the latest bundler, as what ships with the Ruby image may
|
9
|
+
# not be current, and bundler will auto-downgrade to match the Gemfile.lock
|
10
|
+
RUN gem install bundler
|
@@ -0,0 +1,29 @@
|
|
1
|
+
{
|
2
|
+
"name": "Ruby",
|
3
|
+
"build": {
|
4
|
+
"dockerfile": "Dockerfile"
|
5
|
+
},
|
6
|
+
|
7
|
+
// Configure tool-specific properties.
|
8
|
+
"customizations": {
|
9
|
+
// Configure properties specific to VS Code.
|
10
|
+
"vscode": {
|
11
|
+
// Add the IDs of extensions you want installed when the container is created.
|
12
|
+
"extensions": [
|
13
|
+
"rebornix.Ruby"
|
14
|
+
]
|
15
|
+
}
|
16
|
+
},
|
17
|
+
|
18
|
+
// Set the environment variables
|
19
|
+
// "runArgs": ["--env-file",".env"],
|
20
|
+
|
21
|
+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
22
|
+
// "forwardPorts": [],
|
23
|
+
|
24
|
+
// Use 'postCreateCommand' to run commands after the container is created.
|
25
|
+
"postCreateCommand": "bash .devcontainer/postcreate.sh",
|
26
|
+
|
27
|
+
// Set `remoteUser` to `root` to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
|
28
|
+
"remoteUser": "vscode"
|
29
|
+
}
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,17 @@
|
|
1
1
|
# Changelog
|
2
2
|
## HEAD
|
3
3
|
|
4
|
+
## 0.16.5
|
5
|
+
|
6
|
+
* Raise ArgumentError when calling change_password! with blank password [#333](https://github.com/Sorcery/sorcery/pull/333)
|
7
|
+
* Update auth_scheme to oauth2 v1 defaults per v2 breaking changes [#341](https://github.com/Sorcery/sorcery/pull/341)
|
8
|
+
|
9
|
+
## 0.16.4
|
10
|
+
|
11
|
+
* Adapt to open request protection strategy of rails 7.0 [#318](https://github.com/Sorcery/sorcery/pull/318)
|
12
|
+
* Update OAuth2 gem to v2 per v1 deprecation [#323](https://github.com/Sorcery/sorcery/pull/323)
|
13
|
+
* Fixed typo in error message [#310](https://github.com/Sorcery/sorcery/pull/310)
|
14
|
+
|
4
15
|
## 0.16.3
|
5
16
|
|
6
17
|
* Fix provider instantiation for plural provider names (eg. okta) [#305](https://github.com/Sorcery/sorcery/pull/305)
|
@@ -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
@@ -34,8 +34,8 @@ Gem::Specification.new do |s|
|
|
34
34
|
s.required_ruby_version = '>= 2.4.9'
|
35
35
|
|
36
36
|
s.add_dependency 'bcrypt', '~> 3.1'
|
37
|
-
s.add_dependency 'oauth', '
|
38
|
-
s.add_dependency 'oauth2', '~>
|
37
|
+
s.add_dependency 'oauth', '>= 0.6'
|
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'
|
@@ -328,6 +328,18 @@ shared_examples_for 'rails_3_reset_password_model' do
|
|
328
328
|
expect(user.reset_password_token).to be_nil
|
329
329
|
end
|
330
330
|
|
331
|
+
it 'when change_password! is called with empty argument, raise an exception' do
|
332
|
+
expect {
|
333
|
+
user.change_password!('')
|
334
|
+
}.to raise_error(ArgumentError, 'Blank password passed to change_password!')
|
335
|
+
end
|
336
|
+
|
337
|
+
it 'when change_password! is called with nil argument, raise an exception' do
|
338
|
+
expect {
|
339
|
+
user.change_password!(nil)
|
340
|
+
}.to raise_error(ArgumentError, 'Blank password passed to change_password!')
|
341
|
+
end
|
342
|
+
|
331
343
|
it 'when change_password is called, deletes reset_password_token and calls #save' do
|
332
344
|
new_password = 'blabulsdf'
|
333
345
|
|
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.5
|
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: 2023-04-11 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: bcrypt
|
@@ -32,42 +32,30 @@ dependencies:
|
|
32
32
|
name: oauth
|
33
33
|
requirement: !ruby/object:Gem::Requirement
|
34
34
|
requirements:
|
35
|
-
- - "~>"
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
version: '0.5'
|
38
35
|
- - ">="
|
39
36
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
37
|
+
version: '0.6'
|
41
38
|
type: :runtime
|
42
39
|
prerelease: false
|
43
40
|
version_requirements: !ruby/object:Gem::Requirement
|
44
41
|
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0.5'
|
48
42
|
- - ">="
|
49
43
|
- !ruby/object:Gem::Version
|
50
|
-
version: 0.
|
44
|
+
version: '0.6'
|
51
45
|
- !ruby/object:Gem::Dependency
|
52
46
|
name: oauth2
|
53
47
|
requirement: !ruby/object:Gem::Requirement
|
54
48
|
requirements:
|
55
49
|
- - "~>"
|
56
50
|
- !ruby/object:Gem::Version
|
57
|
-
version: '
|
58
|
-
- - ">="
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
version: 0.8.0
|
51
|
+
version: '2.0'
|
61
52
|
type: :runtime
|
62
53
|
prerelease: false
|
63
54
|
version_requirements: !ruby/object:Gem::Requirement
|
64
55
|
requirements:
|
65
56
|
- - "~>"
|
66
57
|
- !ruby/object:Gem::Version
|
67
|
-
version: '
|
68
|
-
- - ">="
|
69
|
-
- !ruby/object:Gem::Version
|
70
|
-
version: 0.8.0
|
58
|
+
version: '2.0'
|
71
59
|
- !ruby/object:Gem::Dependency
|
72
60
|
name: byebug
|
73
61
|
requirement: !ruby/object:Gem::Requirement
|
@@ -194,6 +182,9 @@ executables: []
|
|
194
182
|
extensions: []
|
195
183
|
extra_rdoc_files: []
|
196
184
|
files:
|
185
|
+
- ".devcontainer/Dockerfile"
|
186
|
+
- ".devcontainer/devcontainer.json"
|
187
|
+
- ".devcontainer/postcreate.sh"
|
197
188
|
- ".document"
|
198
189
|
- ".github/FUNDING.yml"
|
199
190
|
- ".github/ISSUE_TEMPLATE.md"
|
@@ -391,7 +382,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
391
382
|
- !ruby/object:Gem::Version
|
392
383
|
version: '0'
|
393
384
|
requirements: []
|
394
|
-
rubygems_version: 3.2.
|
385
|
+
rubygems_version: 3.2.33
|
395
386
|
signing_key:
|
396
387
|
specification_version: 4
|
397
388
|
summary: Magical authentication for Rails applications
|