devise-jwt 0.5.5 → 0.5.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +1 -1
- data/lib/devise/jwt/defaults_generator.rb +8 -5
- data/lib/devise/jwt/mapping_inspector.rb +10 -10
- data/lib/devise/jwt/test_helpers.rb +1 -1
- data/lib/devise/jwt/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a1dcf5432b3eca3682d6eda74ea8659a4de99692
|
4
|
+
data.tar.gz: 98ca51ba3d3e16558f3e2690504f517fffe45b73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f4a10c20c6dd4638f7fdf661f7715d93a7337dc1e7458f507a2c0f0dcebc80ca58108783a2ded9cbf3c6efda25773e6ce8916a17029b542726ea512eb2ce161
|
7
|
+
data.tar.gz: 930058ffefc9dfcfcf47143fbbb27cc81ad10e5528ec99e860d8d0e64ee144fee8b0ed5684ade1f83f28fe1e397cc9a63038ff77f0c5acb0058583bc08634754
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,10 @@ 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.6] - 2018-02-22
|
8
|
+
### Fixed
|
9
|
+
- Work with more than one `sign_out_via` configured
|
10
|
+
|
7
11
|
## [0.5.5] - 2018-01-30
|
8
12
|
### Fixed
|
9
13
|
- Update `warden-jwt_auth` dependency to reenable JWT scopes being stored to
|
data/README.md
CHANGED
@@ -90,15 +90,18 @@ module Devise
|
|
90
90
|
# :reek:FeatureEnvy
|
91
91
|
def requests(inspector, name)
|
92
92
|
path = inspector.path(name)
|
93
|
-
|
94
|
-
inspector.formats.
|
95
|
-
|
93
|
+
methods = inspector.methods(name)
|
94
|
+
inspector.formats.each_with_object([]) do |format, requests|
|
95
|
+
requests.push(*requests_for_format(path, methods, format))
|
96
96
|
end
|
97
97
|
end
|
98
98
|
|
99
|
-
|
99
|
+
# :reek:UtilityFunction
|
100
|
+
def requests_for_format(path, methods, format)
|
100
101
|
path_regexp = format ? /^#{path}.#{format}$/ : /^#{path}$/
|
101
|
-
|
102
|
+
methods.map do |method|
|
103
|
+
[method, path_regexp]
|
104
|
+
end
|
102
105
|
end
|
103
106
|
end
|
104
107
|
end
|
@@ -36,15 +36,13 @@ module Devise
|
|
36
36
|
end
|
37
37
|
|
38
38
|
# :reek:ControlParameter
|
39
|
-
def
|
40
|
-
case name
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
'POST'
|
47
|
-
end
|
39
|
+
def methods(name)
|
40
|
+
method = case name
|
41
|
+
when :sign_in then 'POST'
|
42
|
+
when :sign_out then sign_out_via
|
43
|
+
when :registration then 'POST'
|
44
|
+
end
|
45
|
+
Array(method)
|
48
46
|
end
|
49
47
|
|
50
48
|
def formats
|
@@ -65,7 +63,9 @@ module Devise
|
|
65
63
|
end
|
66
64
|
|
67
65
|
def sign_out_via
|
68
|
-
mapping.sign_out_via.
|
66
|
+
Array(mapping.sign_out_via).map do |method|
|
67
|
+
method.to_s.upcase
|
68
|
+
end
|
69
69
|
end
|
70
70
|
|
71
71
|
def default_formats
|
@@ -17,7 +17,7 @@ module Devise
|
|
17
17
|
# @param aud [String] The aud claim. If `nil` it will be autodetected from
|
18
18
|
# the header name configured in `Devise::JWT.config.aud_header`.
|
19
19
|
#
|
20
|
-
# :reek:
|
20
|
+
# :reek:LongParameterList
|
21
21
|
def self.auth_headers(headers, user, scope: nil, aud: nil)
|
22
22
|
scope ||= Devise::Mapping.find_scope!(user)
|
23
23
|
aud ||= headers[Warden::JWTAuth.config.aud_header]
|
data/lib/devise/jwt/version.rb
CHANGED
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.
|
4
|
+
version: 0.5.6
|
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-
|
11
|
+
date: 2018-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: devise
|