warden-jwt_auth 0.3.1 → 0.3.2

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
  SHA1:
3
- metadata.gz: a9782cdbdf76a6eb2713519f95119793dfe5a394
4
- data.tar.gz: 7440380db752d295344edb0f99f174ecd59b8fe4
3
+ metadata.gz: e5ef370e2769321525a4f8d75188c541befe14f8
4
+ data.tar.gz: 719f327eca349ce320832fb46ca2057893feb2fc
5
5
  SHA512:
6
- metadata.gz: b32d3633a45e59021721bcd22ddd4368e54b0a5170273bc70c7a3f9899dd51dce637eac2f0a48946e73f72b06ed4b008c1aa5677d2bb176dfdb55489dc85181e
7
- data.tar.gz: f0565c6480919c4b39e44034b8e352b806661f18bc25da17989b0c1e670bda9759a6ea255525d91d4f2085980fc24228131bc9e32edd64b935e249f8cbf505ec
6
+ metadata.gz: ba697509f99e66bdc16a8eb7c4b3575ffefe7cc122e4ebf7ebc5a807eefbc2f6f5667e79b724b517b2b6078c731c3c3b955b7feadc71127b0d942664e4c29d68
7
+ data.tar.gz: 9b292cca9927bda28c92decf5170ef0f7c0f040e88770fb126591370c1b22fe49e9e27a8783e2844d0b81eda4dfb01d4811ffdff1822a6fa34402a647323f128
@@ -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.3.2] - 2017-12-23
8
+ ### Fixed
9
+ - Do not couple `aud_header` env value to the setting
10
+
7
11
  ## [0.3.1] - 2017-12-11
8
12
  ### Added
9
13
  - Ensure JWT scopes are not fetched from session. Workaround for
data/README.md CHANGED
@@ -24,7 +24,7 @@ If what you need is a JWT authentication library for [devise](https://github.com
24
24
  ## Installation
25
25
 
26
26
  ```ruby
27
- gem 'warden-jwt_auth', '~> 0.3.1'
27
+ gem 'warden-jwt_auth', '~> 0.3.2'
28
28
  ```
29
29
 
30
30
  And then execute:
@@ -27,9 +27,7 @@ module Warden
27
27
 
28
28
  # Request header which value will be encoded as `aud` claim in JWT. If
29
29
  # the header is not present `aud` will be `nil`.
30
- setting(:aud_header, 'JWT_AUD') do |value|
31
- ('HTTP_' + value.upcase).tr('-', '_')
32
- end
30
+ setting :aud_header, 'JWT_AUD'
33
31
 
34
32
  # A hash of warden scopes as keys and user repositories as values. The
35
33
  # values can be either the constants themselves or the constant names.
@@ -53,7 +53,8 @@ module Warden
53
53
  # @param env [Hash] Rack env
54
54
  # @return [String]
55
55
  def self.aud_header(env)
56
- env[JWTAuth.config.aud_header]
56
+ env_name = ('HTTP_' + JWTAuth.config.aud_header.upcase).tr('-', '_')
57
+ env[env_name]
57
58
  end
58
59
  end
59
60
  end
@@ -51,9 +51,10 @@ module Warden
51
51
  end
52
52
 
53
53
  # :reek:ManualDispatch
54
- # :reek:FeatureEnvy
54
+ # :reek:UtilityFunction
55
55
  def add_token_to_env(user, scope, env)
56
- token, payload = UserEncoder.new.call(user, scope, env[aud_header])
56
+ aud = EnvHelper.aud_header(env)
57
+ token, payload = UserEncoder.new.call(user, scope, aud)
57
58
  user.on_jwt_dispatch(token, payload) if user.respond_to?(:on_jwt_dispatch)
58
59
  env[PREPARED_TOKEN_ENV_KEY] = token
59
60
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Warden
4
4
  module JWTAuth
5
- VERSION = '0.3.1'
5
+ VERSION = '0.3.2'
6
6
  end
7
7
  end
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.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marc Busqué
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-12-11 00:00:00.000000000 Z
11
+ date: 2017-12-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-configurable