rails_jwt_auth 0.20.0 → 0.21.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rails_jwt_auth/jwt/manager.rb +6 -2
- data/lib/rails_jwt_auth/version.rb +1 -1
- metadata +14 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2d3d72328f4fd09857c817cdcb70aa8950badbdce4f4b24eef9c0c03cd33c40
|
4
|
+
data.tar.gz: 6324cd6f9d293b683e273972ab8dafaee11b89f2ffb209ef1574c69c42b9b377
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9a3821d06717a9ca57ca1f56358401a67d6028f5b537f0a80c02f39069932754369d1611d26412b7e0762fd0a53ee358321dc3925c54c35f8b4010cbcae3d12
|
7
|
+
data.tar.gz: 1f8c0a8a8270bc776b37b4ed8edd00485df3a1693224c81f47dcf735285f3684ff53ad6ae8a0e50cadba84c790e871819e7e1d8478c9bc82a7f81401eee13b6c
|
@@ -3,16 +3,20 @@ require 'jwt'
|
|
3
3
|
module RailsJwtAuth
|
4
4
|
module Jwt
|
5
5
|
class Manager
|
6
|
+
def self.secret_key_base
|
7
|
+
Rails.application.secrets.secret_key_base || Rails.application.credentials.secret_key_base
|
8
|
+
end
|
9
|
+
|
6
10
|
# Encodes and signs JWT Payload with expiration
|
7
11
|
def self.encode(payload)
|
8
12
|
payload.reverse_merge!(meta)
|
9
|
-
JWT.encode(payload,
|
13
|
+
JWT.encode(payload, secret_key_base)
|
10
14
|
end
|
11
15
|
|
12
16
|
# Decodes the JWT with the signed secret
|
13
17
|
# [{"auth_token"=>"xxx", "exp"=>148..., "iss"=>"RJA"}, {"typ"=>"JWT", "alg"=>"HS256"}]
|
14
18
|
def self.decode(token)
|
15
|
-
JWT.decode(token,
|
19
|
+
JWT.decode(token, secret_key_base)
|
16
20
|
end
|
17
21
|
|
18
22
|
# Validates the payload hash for expiration and meta claims
|
metadata
CHANGED
@@ -1,71 +1,71 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_jwt_auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.21.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- rjurado
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: bcrypt
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '3.1'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '3.1'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: jwt
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '1
|
33
|
+
version: '2.1'
|
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: '1
|
40
|
+
version: '2.1'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: rails
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '5.0'
|
48
48
|
type: :runtime
|
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: '
|
54
|
+
version: '5.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: warden
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '1.2'
|
62
62
|
type: :runtime
|
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: '
|
68
|
+
version: '1.2'
|
69
69
|
description: Rails authentication solution based on Warden and JWT and inspired by
|
70
70
|
Devise.
|
71
71
|
email:
|