warden-jwt_auth 0.4.2 → 0.5.0

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: 6d846014120be83271db3fad2b4044f7973187efcaeb5be678483af60947d3c1
4
- data.tar.gz: e7d7194e4b20a789327cce656678a72e9755fb2831e25e81a79423c201774f95
3
+ metadata.gz: ac884c1ecfe8201fe9973503bcb067186a2683b290828d9b5bac8b3667929f6d
4
+ data.tar.gz: 26f14054831f628f83c083709fd8e044182eb28bcef092110c48c386009576fb
5
5
  SHA512:
6
- metadata.gz: 63f7143db9afbbe477dfa4a75149406d82f6f907989174b298dc9aa741a10faf5eb7ac27f6e42530f43331ba27faf999a9cd3e1a1fae474e95747a6e7e70466c
7
- data.tar.gz: 612b8e386590a4d331a97c5463e86e06f35de57e0b3cb8aad3f0ce90ab2b5973c7ccce871ddf2b1e418633d73ad48ef2ea2d718c7779f6aac3ba6160d4c105b4
6
+ metadata.gz: dadca31dc64203c56ca77c98e69a8bfc48813e2bf0a61a52ee8741f7a08df9c71d96aa481ca424e908b3ba1e8f979f36544244e8545bba6b0e83624ab96db1fa
7
+ data.tar.gz: 3c58c89cb5d42c462b071008c548d85649e1d88d7186e4d4cc9c987d72e9dbab9d2ddf4a3ed9eb99e017d8f0f66b76f4ccdb88ec584ef64b3bdc097ec69a06ee
@@ -1,6 +1,6 @@
1
1
  require: rubocop-rspec
2
2
  AllCops:
3
- TargetRubyVersion: 2.3
3
+ TargetRubyVersion: 2.6
4
4
  RSpec/NestedGroups:
5
5
  Max: 3
6
6
  RSpec/MessageSpies:
@@ -1,4 +1,3 @@
1
- sudo: false
2
1
  language: ruby
3
2
  rvm:
4
3
  - 2.5
@@ -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.0]
8
+ ### Fixed
9
+ - Fixed dry-configurable compatibility. ([28](https://github.com/waiting-for-dev/warden-jwt_auth/issues/28))
10
+
7
11
  ## [0.4.2] - 2020-03-19
8
12
  ### Fixed
9
13
  - Lock dry-configurable dependency to fix upstream regression. ([21](https://github.com/waiting-for-dev/warden-jwt_auth/issues/21))
@@ -19,6 +19,27 @@ module Warden
19
19
  module JWTAuth
20
20
  extend Dry::Configurable
21
21
 
22
+ def symbolize_keys(hash)
23
+ hash.each_with_object({}) do |(key, value), memo|
24
+ memo[key.to_sym] = value
25
+ end
26
+ end
27
+
28
+ def upcase_first_items(array)
29
+ array.map do |tuple|
30
+ method, path = tuple
31
+ [method.to_s.upcase, path]
32
+ end
33
+ end
34
+
35
+ def constantize_values(hash)
36
+ hash.each_with_object({}) do |(key, value), memo|
37
+ memo[key] = value.is_a?(String) ? Object.const_get(value) : value
38
+ end
39
+ end
40
+
41
+ module_function :constantize_values, :symbolize_keys, :upcase_first_items
42
+
22
43
  # The secret used to encode the token
23
44
  setting :secret
24
45
 
@@ -38,7 +59,7 @@ module Warden
38
59
  # @see Interfaces::UserRepository
39
60
  # @see Interfaces::User
40
61
  setting(:mappings, {}) do |value|
41
- symbolize_keys(value)
62
+ constantize_values(symbolize_keys(value))
42
63
  end
43
64
 
44
65
  # Array of tuples [request_method, request_path_regex] to match request
@@ -75,44 +96,10 @@ module Warden
75
96
  #
76
97
  # @see Interfaces::RevocationStrategy
77
98
  setting(:revocation_strategies, {}) do |value|
78
- symbolize_keys(value)
79
- end
80
-
81
- # :reek:UtilityFunction
82
- def self.symbolize_keys(hash)
83
- Hash[
84
- hash.each_pair do |key, value|
85
- [key.to_sym, value]
86
- end
87
- ]
88
- end
89
-
90
- # :reek:UtilityFunction
91
- def self.upcase_first_items(array)
92
- array.map do |tuple|
93
- method, path = tuple
94
- [method.to_s.upcase, path]
95
- end
99
+ constantize_values(symbolize_keys(value))
96
100
  end
97
101
 
98
102
  Import = Dry::AutoInject(config)
99
-
100
- config.instance_eval do
101
- def mappings
102
- constantize_values(super)
103
- end
104
-
105
- def revocation_strategies
106
- constantize_values(super)
107
- end
108
-
109
- # :reek:UtilityFunction
110
- def constantize_values(hash)
111
- hash.each_with_object({}) do |(key, value), memo|
112
- memo[key] = value.is_a?(String) ? Object.const_get(value) : value
113
- end
114
- end
115
- end
116
103
  end
117
104
  end
118
105
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Warden
4
4
  module JWTAuth
5
- VERSION = '0.4.2'
5
+ VERSION = '0.5.0'
6
6
  end
7
7
  end
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
21
21
  spec.require_paths = ['lib']
22
22
 
23
23
  spec.add_dependency 'dry-auto_inject', '~> 0.6'
24
- spec.add_dependency 'dry-configurable', '~> 0.9', '< 0.11'
24
+ spec.add_dependency 'dry-configurable', '~> 0.9'
25
25
  spec.add_dependency 'jwt', '~> 2.1'
26
26
  spec.add_dependency 'warden', '~> 1.2'
27
27
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: warden-jwt_auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marc Busqué
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-19 00:00:00.000000000 Z
11
+ date: 2020-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-auto_inject
@@ -31,9 +31,6 @@ dependencies:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0.9'
34
- - - "<"
35
- - !ruby/object:Gem::Version
36
- version: '0.11'
37
34
  type: :runtime
38
35
  prerelease: false
39
36
  version_requirements: !ruby/object:Gem::Requirement
@@ -41,9 +38,6 @@ dependencies:
41
38
  - - "~>"
42
39
  - !ruby/object:Gem::Version
43
40
  version: '0.9'
44
- - - "<"
45
- - !ruby/object:Gem::Version
46
- version: '0.11'
47
41
  - !ruby/object:Gem::Dependency
48
42
  name: jwt
49
43
  requirement: !ruby/object:Gem::Requirement
@@ -234,7 +228,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
234
228
  - !ruby/object:Gem::Version
235
229
  version: '0'
236
230
  requirements: []
237
- rubygems_version: 3.1.2
231
+ rubyforge_project:
232
+ rubygems_version: 2.7.8
238
233
  signing_key:
239
234
  specification_version: 4
240
235
  summary: JWT authentication for Warden.