rack-jwt 0.3.0 → 0.4.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
- SHA1:
3
- metadata.gz: cfa47cb2c138bc46c403e896f61fa82773ef0afa
4
- data.tar.gz: e8a2497f654c31721a1e7943ed0a880607fc2f0d
2
+ SHA256:
3
+ metadata.gz: d0c3dd5975bdb1e6b9d7b07a349a1334bca43ca5e25bfeb8049d6ba00abbb0f5
4
+ data.tar.gz: 05e53f4a510f3362cc05fa1fe8ede02b637a6549a33767ba19325657591f74ab
5
5
  SHA512:
6
- metadata.gz: b52bb55b1d499d5bf1fc3c959845e52a24dc0e5650fa28fbd9cefa561e796cbee4e6f0227f7de66eaa91c2ebf9298ab4468ba87012461c45e759346a0ba04885
7
- data.tar.gz: 7fdeabeb1ebdc4f1baf6a40ef6fc40c018c71673d222ba6171d318a575215eefc470e16e407277fddbde97f85f3921a822693228543e174ccaf0af06190d5a3c
6
+ metadata.gz: 19e0681e2971f43737705c0e5d9fe8e939c6414879b21baacf6e3537948874c92623bec5a05878a4050c37d0670af6b7e2c332590a7cf5c1c4049fc192a5e71a
7
+ data.tar.gz: b50c41b582a5ddf5738fee45b1221b3ceddd389f0335f6a5fcc57447d9a05659f10e20a726fa290a561a7601112d62c2885dc7f79571716da459fa4cf55ac696
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Rack::JWT
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/rack-jwt.svg)](http://badge.fury.io/rb/rack-jwt)
4
- [![Build Status](https://travis-ci.org/eigenbart/rack-jwt.svg)](https://travis-ci.org/eigenbart/rack-jwt)
5
- [![Code Climate](https://codeclimate.com/github/eigenbart/rack-jwt/badges/gpa.svg)](https://codeclimate.com/github/eigenbart/rack-jwt)
4
+ [![Build Status](https://travis-ci.org/eparreno/rack-jwt.svg)](https://travis-ci.org/eparreno/rack-jwt)
5
+ [![Code Climate](https://codeclimate.com/github/eparreno/rack-jwt/badges/gpa.svg)](https://codeclimate.com/github/eparreno/rack-jwt)
6
6
 
7
7
  ## About
8
8
 
@@ -106,7 +106,7 @@ Rack::JWT::Token.encode(my_payload, secret, alg)
106
106
 
107
107
  ## Contributing
108
108
 
109
- 1. Fork it ( https://github.com/[my-github-username]/rack-jwt/fork )
109
+ 1. Fork it ( https://github.com/eparreno/rack-jwt/fork )
110
110
  2. Create your feature branch (`git checkout -b my-new-feature`)
111
111
  3. Commit your changes (`git commit -am 'Add some feature'`)
112
112
  4. Push to the branch (`git push origin my-new-feature`)
@@ -5,6 +5,7 @@ module Rack
5
5
  # abc123.abc123.abc123 (w/ signature)
6
6
  # abc123.abc123. ('none')
7
7
  TOKEN_REGEX = /\A([a-zA-Z0-9\-\_\~\+\\]+\.[a-zA-Z0-9\-\_\~\+\\]+\.[a-zA-Z0-9\-\_\~\+\\]*)\z/
8
+ DEFAULT_HEADERS = {typ: 'JWT'}
8
9
 
9
10
  def self.encode(payload, secret, alg = 'HS256')
10
11
  raise 'Invalid payload. Must be a Hash.' unless payload.is_a?(Hash)
@@ -14,9 +15,9 @@ module Rack
14
15
  # if using an unsigned token ('none' alg) you *must* set the `secret`
15
16
  # to `nil` in which case any user provided `secret` will be ignored.
16
17
  if alg == 'none'
17
- ::JWT.encode(payload, nil, alg)
18
+ ::JWT.encode(payload, nil, alg, DEFAULT_HEADERS)
18
19
  else
19
- ::JWT.encode(payload, secret, alg)
20
+ ::JWT.encode(payload, secret, alg, DEFAULT_HEADERS)
20
21
  end
21
22
  end
22
23
 
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  module JWT
3
- VERSION = '0.3.0'.freeze
3
+ VERSION = '0.4.0'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-jwt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mr. Eigenbart
8
+ - Emili Parreno
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2016-02-19 00:00:00.000000000 Z
12
+ date: 2018-11-14 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: bundler
@@ -80,20 +81,6 @@ dependencies:
80
81
  - - "~>"
81
82
  - !ruby/object:Gem::Version
82
83
  version: 0.11.2
83
- - !ruby/object:Gem::Dependency
84
- name: rubocop
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: 0.37.2
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - "~>"
95
- - !ruby/object:Gem::Version
96
- version: 0.37.2
97
84
  - !ruby/object:Gem::Dependency
98
85
  name: rack
99
86
  requirement: !ruby/object:Gem::Requirement
@@ -114,17 +101,17 @@ dependencies:
114
101
  requirements:
115
102
  - - "~>"
116
103
  - !ruby/object:Gem::Version
117
- version: 1.5.2
104
+ version: '2.0'
118
105
  type: :runtime
119
106
  prerelease: false
120
107
  version_requirements: !ruby/object:Gem::Requirement
121
108
  requirements:
122
109
  - - "~>"
123
110
  - !ruby/object:Gem::Version
124
- version: 1.5.2
111
+ version: '2.0'
125
112
  description: Rack middleware that provides authentication based on JSON Web Tokens.
126
113
  email:
127
- - eigenbart@gmail.com
114
+ - emili@eparreno.com
128
115
  executables: []
129
116
  extensions: []
130
117
  extra_rdoc_files: []
@@ -135,7 +122,7 @@ files:
135
122
  - lib/rack/jwt/auth.rb
136
123
  - lib/rack/jwt/token.rb
137
124
  - lib/rack/jwt/version.rb
138
- homepage: https://github.com/eigenbart/rack-jwt
125
+ homepage: https://github.com/eparreno/rack-jwt
139
126
  licenses:
140
127
  - MIT
141
128
  metadata: {}
@@ -155,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
155
142
  version: '0'
156
143
  requirements: []
157
144
  rubyforge_project:
158
- rubygems_version: 2.4.5
145
+ rubygems_version: 2.7.6
159
146
  signing_key:
160
147
  specification_version: 4
161
148
  summary: Rack middleware that provides authentication based on JSON Web Tokens.