sorcery-jwt 0.1.5 → 0.1.10

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
2
  SHA256:
3
- metadata.gz: 826045ac18f5ab1acd04a13ac1985bb1d20e24fd62564aa3b004aca9de25e8f3
4
- data.tar.gz: d5a49f8b4678a44008b746e3d1a4d60ab8f9ba048e60e4e9c66e2578a8e40875
3
+ metadata.gz: 5cd5919d24091d9f985c280915c1eb7c83bf8df98c7ee64c02e5d8faa126be48
4
+ data.tar.gz: f4962116d588298105213bc556c43eb9819d497cb9ebace5b269643a715f2abe
5
5
  SHA512:
6
- metadata.gz: 85aa97351bfe5033baf6bd484834123ca4681cd522beaf05c6722b466a34e72ead0d4e1c3fd8531aeae05eecba8b36f8b074f22c3900c9d79f01b504015be498
7
- data.tar.gz: 9284375080211ee4c2f217ea002b32cb31f1fe93235489e84c79165e5d08d0c2d1de3cd775cc1fc6b99962ab18337cff99a9c63dc8f6d609cb7475db6cba9b32
6
+ metadata.gz: c1b85a3e3d481231902ab8ca9abf21cd1b8e646d11033243a248df104ac05b9795c5c1b4f6189febd2701c74cddcd280c74f594dd03e18deb5c18c1a34853fc4
7
+ data.tar.gz: a18eb95be5d852e202d700aa3f48b2121038caa68b90b9745f9d5ec6353886e1e7c758ee6e3eb65e60c20d7ac286cfd8f39bcfb5a841892df423fcfc2827021f
@@ -1,26 +1,26 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sorcery-jwt (0.1.2)
4
+ sorcery-jwt (0.1.7)
5
5
  jwt (~> 1.0)
6
- sorcery (~> 0.12.0)
6
+ sorcery (>= 0.13, < 0.16)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- bcrypt (3.1.12)
11
+ bcrypt (3.1.13)
12
12
  coderay (1.1.2)
13
13
  diff-lcs (1.3)
14
- faraday (0.15.4)
14
+ faraday (1.0.1)
15
15
  multipart-post (>= 1.2, < 3)
16
16
  jwt (1.5.6)
17
17
  method_source (0.8.2)
18
- multi_json (1.13.1)
18
+ multi_json (1.14.1)
19
19
  multi_xml (0.6.0)
20
- multipart-post (2.0.0)
20
+ multipart-post (2.1.1)
21
21
  oauth (0.5.4)
22
- oauth2 (1.4.1)
23
- faraday (>= 0.8, < 0.16.0)
22
+ oauth2 (1.4.4)
23
+ faraday (>= 0.8, < 2.0)
24
24
  jwt (>= 1.0, < 3.0)
25
25
  multi_json (~> 1.3)
26
26
  multi_xml (~> 0.5)
@@ -29,8 +29,8 @@ GEM
29
29
  coderay (~> 1.1.0)
30
30
  method_source (~> 0.8.1)
31
31
  slop (~> 3.4)
32
- rack (2.0.6)
33
- rake (10.5.0)
32
+ rack (2.2.3)
33
+ rake (13.0.1)
34
34
  rspec (3.8.0)
35
35
  rspec-core (~> 3.8.0)
36
36
  rspec-expectations (~> 3.8.0)
@@ -45,7 +45,7 @@ GEM
45
45
  rspec-support (~> 3.8.0)
46
46
  rspec-support (3.8.0)
47
47
  slop (3.6.0)
48
- sorcery (0.12.0)
48
+ sorcery (0.15.0)
49
49
  bcrypt (~> 3.1)
50
50
  oauth (~> 0.4, >= 0.4.4)
51
51
  oauth2 (~> 1.0, >= 0.8.0)
@@ -56,7 +56,7 @@ PLATFORMS
56
56
  DEPENDENCIES
57
57
  bundler (~> 1.16)
58
58
  pry (~> 0.10.0)
59
- rake (~> 10.0)
59
+ rake (~> 13.0)
60
60
  rspec (~> 3.0)
61
61
  sorcery-jwt!
62
62
 
data/README.md CHANGED
@@ -26,7 +26,7 @@ First, include the `:jwt` submodule in your list of configured Sorcery submodule
26
26
  Rails.application.config.sorcery.submodules = [:jwt, ...]
27
27
  ```
28
28
 
29
- Next, in the Sorcery `user_config`, set the secret and algorithm that will be used to sign your tokens:
29
+ Next, in the Sorcery `user_config`, set the secret and algorithm that will be used to sign your tokens. You can also set length of time in seconds that the token will be valid for. Note that this is configured separately from the `:session_timeout` submodule.
30
30
 
31
31
  ```
32
32
  Rails.application.config.sorcery.configure do |config|
@@ -35,6 +35,7 @@ Rails.application.config.sorcery.configure do |config|
35
35
  # ...
36
36
  user.jwt_secret = Rails.application.secrets.secret_key_base
37
37
  user.jwt_algorithm = "HS256" # HS256 is used by default.
38
+ user.session_expiry = 60 * 60 * 24 * 7 * 2 # 2 weeks is used by default.
38
39
  end
39
40
  end
40
41
  ```
@@ -1,5 +1,5 @@
1
1
  module Sorcery
2
2
  module Jwt
3
- VERSION = "0.1.5".freeze
3
+ VERSION = "0.1.10".freeze
4
4
  end
5
5
  end
@@ -17,7 +17,7 @@ module Sorcery
17
17
 
18
18
  base.sorcery_config.instance_eval do
19
19
  @defaults[:@jwt_algorithm] = "HS256"
20
- @defaults[:@session_expiry] = Time.now.to_i + (3600 * 24 * 14)
20
+ @defaults[:@session_expiry] = 60 * 60 * 24 * 7 * 2 # 2 weeks
21
21
 
22
22
  reset!
23
23
  end
@@ -30,7 +30,7 @@ module Sorcery
30
30
 
31
31
  module ClassMethods
32
32
  def issue_token(payload)
33
- exp_payload = payload.merge(exp: @sorcery_config.session_expiry)
33
+ exp_payload = payload.merge(exp: Time.now.to_i + @sorcery_config.session_expiry)
34
34
  JWT.encode(exp_payload, @sorcery_config.jwt_secret, @sorcery_config.jwt_algorithm)
35
35
  end
36
36
 
@@ -38,9 +38,9 @@ Gem::Specification.new do |spec|
38
38
 
39
39
  spec.add_development_dependency "bundler", "~> 1.16"
40
40
  spec.add_development_dependency "pry", "~> 0.10.0"
41
- spec.add_development_dependency "rake", "~> 10.0"
41
+ spec.add_development_dependency "rake", "~> 13.0"
42
42
  spec.add_development_dependency "rspec", "~> 3.0"
43
43
 
44
44
  spec.add_runtime_dependency "jwt", "~> 1.0"
45
- spec.add_runtime_dependency "sorcery", "~> 0.12.0"
45
+ spec.add_runtime_dependency "sorcery", ">= 0.13", "< 0.16"
46
46
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sorcery-jwt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hayden Luckenbach
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-02-05 00:00:00.000000000 Z
11
+ date: 2020-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '10.0'
47
+ version: '13.0'
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: '10.0'
54
+ version: '13.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -84,16 +84,22 @@ dependencies:
84
84
  name: sorcery
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0.13'
90
+ - - "<"
88
91
  - !ruby/object:Gem::Version
89
- version: 0.12.0
92
+ version: '0.16'
90
93
  type: :runtime
91
94
  prerelease: false
92
95
  version_requirements: !ruby/object:Gem::Requirement
93
96
  requirements:
94
- - - "~>"
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: '0.13'
100
+ - - "<"
95
101
  - !ruby/object:Gem::Version
96
- version: 0.12.0
102
+ version: '0.16'
97
103
  description: ''
98
104
  email:
99
105
  - hluckenb@gmail.com
@@ -136,8 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
142
  - !ruby/object:Gem::Version
137
143
  version: '0'
138
144
  requirements: []
139
- rubyforge_project:
140
- rubygems_version: 2.7.6
145
+ rubygems_version: 3.0.3
141
146
  signing_key:
142
147
  specification_version: 4
143
148
  summary: Jwt extension for the Sorcery authentication library