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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f2d091c4af06b65d0b8640aa1664cc03370f0859a0d37ccca2865813a41956ec
4
- data.tar.gz: c60ee8af595868a99ddced5363716f6593f494bb82e97a82d35769b4a1c223e4
3
+ metadata.gz: e28e735926cc783f48b5f8708fcdba63b66d20c54acb46197a633c3a2c27ed9f
4
+ data.tar.gz: c48a71718894e02b6d556143d7019b64698d938faf3d82cc97362314e5d821eb
5
5
  SHA512:
6
- metadata.gz: 24281e4ee0082665b792c467fbc9f7e70a6d3f26492a66de179248b6d3c97dcabf2aa3058e44239961ffa01645708883d22e097ac28dfc2b64e38ef2743a03c3
7
- data.tar.gz: 55c173b3a0ea39d8067bb26b737e57548fb67357c0969d1eb08290c8876294157f2ca7c17888874d208d88fe893840b4046bf3463c1ead9fa16c15358a9d5668
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
+ }
@@ -0,0 +1,4 @@
1
+ #!/bin/bash
2
+
3
+ bundle config set path vendor/bundle
4
+ bundle install --jobs=1
data/.gitignore CHANGED
@@ -10,6 +10,7 @@ doc
10
10
 
11
11
  # bundler
12
12
  .bundle
13
+ vendor
13
14
 
14
15
  # jeweler generated
15
16
  pkg
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
@@ -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 intitializer file (config.user_class = \'User\').'
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
@@ -131,6 +131,8 @@ module Sorcery
131
131
  end
132
132
 
133
133
  def change_password!(new_password)
134
+ raise ArgumentError, 'Blank password passed to change_password!' if new_password.blank?
135
+
134
136
  change_password(new_password, raise_on_failure: true)
135
137
  end
136
138
 
@@ -32,6 +32,7 @@ module Sorcery
32
32
  def build_client(options = {})
33
33
  defaults = {
34
34
  site: @site,
35
+ auth_scheme: :request_body,
35
36
  ssl: { ca_file: Sorcery::Controller::Config.ca_file }
36
37
  }
37
38
  ::OAuth2::Client.new(
@@ -1,3 +1,3 @@
1
1
  module Sorcery
2
- VERSION = '0.16.3'.freeze
2
+ VERSION = '0.16.5'.freeze
3
3
  end
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', '~> 0.5', '>= 0.5.5'
38
- s.add_dependency 'oauth2', '~> 1.0', '>= 0.8.0'
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.3
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: 2022-02-23 00:00:00.000000000 Z
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.5.5
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.5.5
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: '1.0'
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: '1.0'
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.3
385
+ rubygems_version: 3.2.33
395
386
  signing_key:
396
387
  specification_version: 4
397
388
  summary: Magical authentication for Rails applications