sorcery 0.16.4 → 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: ebeaecab44b52bef2e5f573c2fbf08e4e03d2f50ef96f3ce27a70002e145f50b
4
- data.tar.gz: 5c9fb4fb3792b3a0b2700fd438c730328d769b4223daccd6f4fea36bdaad68c3
3
+ metadata.gz: e28e735926cc783f48b5f8708fcdba63b66d20c54acb46197a633c3a2c27ed9f
4
+ data.tar.gz: c48a71718894e02b6d556143d7019b64698d938faf3d82cc97362314e5d821eb
5
5
  SHA512:
6
- metadata.gz: fed510d0cb545bb01bd1f9cdb7d6a79f129e977019355d41a1656d3f02f3130880d177e302b63a57f5e13ca1f15764bb3189f9e5df1aa20a9db58c4dd98dc551
7
- data.tar.gz: 525e7f3f4ec290b71bfc7a39d2fa82a0213c7aaf99ce0005794eef266643a3db0dc105cb0580a766c7387375ff1633e26bb1506fd8389ed852c7f39451614dbc
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,11 @@
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
+
4
9
  ## 0.16.4
5
10
 
6
11
  * Adapt to open request protection strategy of rails 7.0 [#318](https://github.com/Sorcery/sorcery/pull/318)
@@ -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.4'.freeze
2
+ VERSION = '0.16.5'.freeze
3
3
  end
data/sorcery.gemspec CHANGED
@@ -34,7 +34,7 @@ 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'
37
+ s.add_dependency 'oauth', '>= 0.6'
38
38
  s.add_dependency 'oauth2', '~> 2.0'
39
39
 
40
40
  s.add_development_dependency 'byebug', '~> 10.0.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
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-10-04 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,22 +32,16 @@ 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
@@ -188,6 +182,9 @@ executables: []
188
182
  extensions: []
189
183
  extra_rdoc_files: []
190
184
  files:
185
+ - ".devcontainer/Dockerfile"
186
+ - ".devcontainer/devcontainer.json"
187
+ - ".devcontainer/postcreate.sh"
191
188
  - ".document"
192
189
  - ".github/FUNDING.yml"
193
190
  - ".github/ISSUE_TEMPLATE.md"
@@ -385,7 +382,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
385
382
  - !ruby/object:Gem::Version
386
383
  version: '0'
387
384
  requirements: []
388
- rubygems_version: 3.1.4
385
+ rubygems_version: 3.2.33
389
386
  signing_key:
390
387
  specification_version: 4
391
388
  summary: Magical authentication for Rails applications