devise-jwt 0.5.7 → 0.5.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: ce25f0119df28a2ff0682ec57b228e7cd3d0d24a
4
- data.tar.gz: f86dd338edbeb3e38992d1a3407888405e566a3d
2
+ SHA256:
3
+ metadata.gz: 0022676c144b6bdc7b157540943addc91d14af980811e1680c6c982f4be44f73
4
+ data.tar.gz: 108eab868c9b5e59d3aae88e0aa624bda94a07b7d0483e201a1e052bbcca1517
5
5
  SHA512:
6
- metadata.gz: d92f20f3d3a4dff6b9eacb4bc2f00633be267e2d0835ed3b50beb22c0c0a720cc9200ca16d9399877927d3249efb43d1644543e9f57496f5107c6351a309dfee
7
- data.tar.gz: 0431acb342abb8d861c9750fa5fa3b121a7b0c05b01ac15bfa407564c0442107f3f93c72ab800da6b86aac7290f377f80a421072b159042fb563664a19cac18e
6
+ metadata.gz: 5684a58be3af200bc14edb00620c76e1a880df3f93a22a479282c52189bb8723c3cd8d5d79f47a6273b36aa5f2e1061108b9e04dbd6415792d41febd5d58fd09
7
+ data.tar.gz: 839c30a43485f5924f9e95579763c4b16a0fb78bf9393437233a03a2c83992989ad59867fd599fc7381bad11aeac29ae6b796a3d457e24c44d55d85be75e1e1b
data/.travis.yml CHANGED
@@ -1,10 +1,9 @@
1
1
  sudo: false
2
2
  language: ruby
3
3
  rvm:
4
- - 2.2.9
5
- - 2.3.6
6
- - 2.4.3
7
- - 2.5.0
4
+ - 2.3
5
+ - 2.4
6
+ - 2.5
8
7
  before_install:
9
8
  - gem update --system --no-doc
10
9
  - bundle install --gemfile=.overcommit_gems.rb
data/CHANGELOG.md CHANGED
@@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/).
6
6
 
7
+ ## [0.5.9] - 2019-03-29
8
+ ### Fixed
9
+ - Update dependencies.
10
+
11
+ ## [0.5.8] - 2018-09-07
12
+ ### Fixed
13
+ - Fix test helper to persist whitelisted tokens.
14
+
7
15
  ## [0.5.7] - 2018-06-22
8
16
  ### Added
9
17
  - Use `primary_key` instead of `id` to fetch resource.
data/README.md CHANGED
@@ -26,7 +26,7 @@ You can read about which security concerns this library takes into account and a
26
26
  Add this line to your application's Gemfile:
27
27
 
28
28
  ```ruby
29
- gem 'devise-jwt', '~> 0.5.7'
29
+ gem 'devise-jwt', '~> 0.5.9'
30
30
  ```
31
31
 
32
32
  And then execute:
data/devise-jwt.gemspec CHANGED
@@ -22,17 +22,17 @@ Gem::Specification.new do |spec|
22
22
  spec.require_paths = ["lib"]
23
23
 
24
24
  spec.add_dependency 'devise', '~> 4.0'
25
- spec.add_dependency 'warden-jwt_auth', '~> 0.3.5'
25
+ spec.add_dependency 'warden-jwt_auth', '~> 0.3.6'
26
26
 
27
- spec.add_development_dependency "bundler", "~> 1.12"
28
- spec.add_development_dependency "rake", "~> 10.0"
29
- spec.add_development_dependency "rspec", "~> 3.0"
30
- spec.add_development_dependency "pry-byebug", "~> 3.4"
27
+ spec.add_development_dependency "bundler", "> 1"
28
+ spec.add_development_dependency "rake", "~> 12.3"
29
+ spec.add_development_dependency "rspec", "~> 3.8"
30
+ spec.add_development_dependency "pry-byebug", "~> 3.7"
31
31
  # Needed to test the rails fixture application
32
32
  spec.add_development_dependency 'rails', '~> 5.0'
33
33
  spec.add_development_dependency 'sqlite3', '~> 1.3'
34
34
  spec.add_development_dependency 'rspec-rails', '~> 3.5'
35
35
  # Test reporting
36
- spec.add_development_dependency 'simplecov', '~> 0.13'
36
+ spec.add_development_dependency 'simplecov', '~> 0.16'
37
37
  spec.add_development_dependency 'codeclimate-test-reporter', '~> 1.0'
38
38
  end
@@ -27,6 +27,7 @@ module Devise
27
27
  devise_mappings.each_key do |scope|
28
28
  inspector = MappingInspector.new(scope)
29
29
  next unless inspector.jwt?
30
+
30
31
  add_defaults(inspector)
31
32
  end
32
33
  defaults
@@ -62,16 +63,19 @@ module Devise
62
63
 
63
64
  def add_sign_in_request(inspector)
64
65
  return unless inspector.session?
66
+
65
67
  defaults[:dispatch_requests].push(*sign_in_requests(inspector))
66
68
  end
67
69
 
68
70
  def add_registration_request(inspector)
69
71
  return unless inspector.registration?
72
+
70
73
  defaults[:dispatch_requests].push(*registration_requests(inspector))
71
74
  end
72
75
 
73
76
  def add_revocation_requests(inspector)
74
77
  return unless inspector.session?
78
+
75
79
  defaults[:revocation_requests].push(*sign_out_requests(inspector))
76
80
  end
77
81
 
@@ -7,6 +7,10 @@ module Devise
7
7
  # Returns headers with a valid token in the `Authorization` header
8
8
  # added.
9
9
  #
10
+ # Side effects could happen if you have implemented
11
+ # `on_jwt_dispatch` method on the user model (as it happens in
12
+ # the whitelist revocation strategy).
13
+ #
10
14
  # Be aware that a fresh copy of `headers` is returned with the new
11
15
  # key/value pair added, instead of modifying given argument.
12
16
  #
@@ -18,12 +22,16 @@ module Devise
18
22
  # the header name configured in `Devise::JWT.config.aud_header`.
19
23
  #
20
24
  # :reek:LongParameterList
25
+ # :reek:ManualDispatch
21
26
  def self.auth_headers(headers, user, scope: nil, aud: nil)
22
27
  scope ||= Devise::Mapping.find_scope!(user)
23
28
  aud ||= headers[Warden::JWTAuth.config.aud_header]
24
- token, _payload = Warden::JWTAuth::UserEncoder.new.call(
29
+ token, payload = Warden::JWTAuth::UserEncoder.new.call(
25
30
  user, scope, aud
26
31
  )
32
+ if user.respond_to?(:on_jwt_dispatch)
33
+ user.on_jwt_dispatch(token, payload)
34
+ end
27
35
  Warden::JWTAuth::HeaderParser.to_headers(headers, token)
28
36
  end
29
37
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Devise
4
4
  module JWT
5
- VERSION = '0.5.7'
5
+ VERSION = '0.5.9'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise-jwt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.7
4
+ version: 0.5.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marc Busqué
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-06-22 00:00:00.000000000 Z
11
+ date: 2019-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: devise
@@ -30,70 +30,70 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.3.5
33
+ version: 0.3.6
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.3.5
40
+ version: 0.3.6
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.12'
47
+ version: '1'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">"
53
53
  - !ruby/object:Gem::Version
54
- version: '1.12'
54
+ version: '1'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '10.0'
61
+ version: '12.3'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '10.0'
68
+ version: '12.3'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '3.0'
75
+ version: '3.8'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '3.0'
82
+ version: '3.8'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: pry-byebug
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '3.4'
89
+ version: '3.7'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '3.4'
96
+ version: '3.7'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rails
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -142,14 +142,14 @@ dependencies:
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: '0.13'
145
+ version: '0.16'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: '0.13'
152
+ version: '0.16'
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: codeclimate-test-reporter
155
155
  requirement: !ruby/object:Gem::Requirement
@@ -224,7 +224,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
224
224
  version: '0'
225
225
  requirements: []
226
226
  rubyforge_project:
227
- rubygems_version: 2.6.8
227
+ rubygems_version: 2.7.8
228
228
  signing_key:
229
229
  specification_version: 4
230
230
  summary: JWT authentication for devise