jwt-rest 0.1.1 → 0.1.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: ae525463a10212504c13323bde8753cdf915e0e1
4
- data.tar.gz: c17596765573791fbfb174c77ab1ba268faee0bd
3
+ metadata.gz: 4e601954d716c75280a697f162b16dadac221a0f
4
+ data.tar.gz: a8664f62307935699ca89e55ac7e27e946fcd24a
5
5
  SHA512:
6
- metadata.gz: 2d178c1501ab75f7594be5652947659ce16690f6425764729125b9b3fccf5e01498d3aff7f6ffaf17e503e72652a7bfaf770fea9159300f8358358079561a9bb
7
- data.tar.gz: 07ce7a77605de47e2e827e3ec4bd70d877fb2688da0913f1f9073320d28d5b9d067bb7206a7a455271c79bdc6cbf5bebf48dbeffa061e433bbfa2dca843fcfe9
6
+ metadata.gz: 601928a04163f61d6f1188454291267db847bee304fd5809a601b9f24e1c44e7a28ce1df237dc8c060ea2f5add4861847f954eb5372ee4412fe6d2ebe2bcbf38
7
+ data.tar.gz: 5db9906d04719b5578e2e5a7781796540c99e2b95c1a16b1542357d768ef6bfcf07d429da0bc8bca3b9e97c7f0adf28f553ed35ad0c443dd0194a118204b6f28
data/README.md CHANGED
@@ -16,7 +16,7 @@ $ bundle
16
16
 
17
17
  First you will need to provide a way to find if the ApiKey is valid or not, and a way to retrieve the RSA private key to sign JWT tokens. For this, lets create a initializer `config/initializers/jwt_rest.rb`.
18
18
 
19
- ```
19
+ ```ruby
20
20
  require "jwt_rest"
21
21
 
22
22
  module JwtRest
@@ -34,11 +34,10 @@ end
34
34
 
35
35
  Then in your API's base controller do this
36
36
 
37
- ```
37
+ ```ruby
38
38
  class ApiController < ActionController::API
39
39
  include JwtRest::Authenticable
40
40
 
41
- before_action :demand_application_json
42
41
  before_action :demand_api_key
43
42
 
44
43
  def handle_user_identity(jwt_payload)
@@ -51,7 +50,7 @@ end
51
50
  This will ensure that every call to your API i
52
51
  s made with a valid api key. You could use the method `demand_current_user` for those endpoins where you need to authenticate the user with the JWT token.
53
52
 
54
- ```
53
+ ```ruby
55
54
  class UsersController < ApiController
56
55
  before_action :demand_current_user, only: [:profile]
57
56
 
@@ -1,7 +1,7 @@
1
1
  module JwtRest
2
2
  class AuthHeader
3
3
  def initialize(chunk = "")
4
- @type, @value = chunk.split(" ")
4
+ @type, @value = chunk&.split(" ")
5
5
  @type = @type&.downcase
6
6
  end
7
7
 
@@ -1,3 +1,3 @@
1
1
  module JwtRest
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jwt-rest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - mariowise
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-07 00:00:00.000000000 Z
11
+ date: 2018-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails