doorkeeper-jwt 0.1.8 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/README.md +7 -0
- data/lib/doorkeeper-jwt.rb +6 -1
- data/lib/doorkeeper-jwt/config.rb +1 -0
- data/lib/doorkeeper-jwt/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e6534ea59e17aa379e1d4cc2d47a640a36c5c4d
|
4
|
+
data.tar.gz: 0c11fac08c1c8db218115d889cee472855294b2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5fbe79b34afcf13c32d2fa29892e3844a79a3c91d3a8c9aa4a30483a11df7e531b9eddf69498e2b5aecf387a5bd8f2992981b4bf72f4259864be4af36e78aa49
|
7
|
+
data.tar.gz: 47052809cd673a929cd7297d63e3a7eaa9d20c800d5ee908c79b29904de4279f57fb8163cb554b839feeed60a190f8e2d2bfacea6f489c95bbf4c9ecc020d610
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
# Change Log
|
2
|
+
All notable changes to this project will be documented in this file.
|
3
|
+
|
4
|
+
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
5
|
+
and this project adheres to [Semantic Versioning](http://semver.org/).
|
6
|
+
|
7
|
+
## [0.2.0] - 2017-05-25
|
8
|
+
### Added
|
9
|
+
- Added support for ["kid" (Key ID) Header Parameter](https://tools.ietf.org/html/rfc7515#section-4.1.4) @travisofthenorth. Allows custom token headers.
|
data/README.md
CHANGED
@@ -53,6 +53,13 @@ Doorkeeper::JWT.configure do
|
|
53
53
|
}
|
54
54
|
end
|
55
55
|
|
56
|
+
# Optionally set additional headers for the JWT. See https://tools.ietf.org/html/rfc7515#section-4.1
|
57
|
+
token_headers do |opts|
|
58
|
+
{
|
59
|
+
kid: opts[:application][:uid]
|
60
|
+
}
|
61
|
+
end
|
62
|
+
|
56
63
|
# Use the application secret specified in the Access Grant token
|
57
64
|
# Defaults to false
|
58
65
|
# If you specify `use_application_secret true`, both secret_key and secret_key_path will be ignored
|
data/lib/doorkeeper-jwt.rb
CHANGED
@@ -9,7 +9,8 @@ module Doorkeeper
|
|
9
9
|
::JWT.encode(
|
10
10
|
token_payload(opts),
|
11
11
|
secret_key(opts),
|
12
|
-
encryption_method
|
12
|
+
encryption_method,
|
13
|
+
token_headers
|
13
14
|
)
|
14
15
|
end
|
15
16
|
|
@@ -19,6 +20,10 @@ module Doorkeeper
|
|
19
20
|
Doorkeeper::JWT.configuration.token_payload.call opts
|
20
21
|
end
|
21
22
|
|
23
|
+
def token_headers(opts = {})
|
24
|
+
Doorkeeper::JWT.configuration.token_headers.call opts
|
25
|
+
end
|
26
|
+
|
22
27
|
def secret_key(opts)
|
23
28
|
opts = { application: {} }.merge(opts)
|
24
29
|
|
@@ -111,6 +111,7 @@ module Doorkeeper
|
|
111
111
|
|
112
112
|
option :token_payload,
|
113
113
|
default: proc{ { token: SecureRandom.method(:hex) } }
|
114
|
+
option :token_headers, default: proc { {} }
|
114
115
|
option :use_application_secret, default: false
|
115
116
|
option :secret_key, default: nil
|
116
117
|
option :secret_key_path, default: nil
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: doorkeeper-jwt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Warren
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jwt
|
@@ -114,6 +114,7 @@ files:
|
|
114
114
|
- ".gitignore"
|
115
115
|
- ".rspec"
|
116
116
|
- ".travis.yml"
|
117
|
+
- CHANGELOG.md
|
117
118
|
- Gemfile
|
118
119
|
- LICENSE.txt
|
119
120
|
- README.md
|
@@ -145,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
145
146
|
version: '0'
|
146
147
|
requirements: []
|
147
148
|
rubyforge_project:
|
148
|
-
rubygems_version: 2.4.
|
149
|
+
rubygems_version: 2.4.6
|
149
150
|
signing_key:
|
150
151
|
specification_version: 4
|
151
152
|
summary: JWT token generator for Doorkeeper
|