castle-rb 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/castle/jwt.rb +3 -3
- data/lib/castle/version.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0856742945aae9ea56e15c7de1ba12804c5fa8e5
|
4
|
+
data.tar.gz: ed17300bdbed7d306d3cc79422ea42bdad2aba16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e2b42486163ce5cfa7bfb8377475ca24b5266662dfce71b0ea6389d7eb8e0a7726b942bd5f5b9c405b032bf3694bfa5b540ef549d771303191a20feac337a75
|
7
|
+
data.tar.gz: 53d70097de459dfa5d3c80071a05efd9ce59dd43e6174bfdab24d8f8e4da6a0376395274b818b222c44d5999c532c9f2f028d0eb3737d0e8646a7cc2ed013e46
|
data/lib/castle/jwt.rb
CHANGED
@@ -7,9 +7,9 @@ module Castle
|
|
7
7
|
def initialize(jwt)
|
8
8
|
begin
|
9
9
|
raise Castle::SecurityError, 'Empty JWT' unless jwt
|
10
|
-
@payload = ::JWT.decode(jwt,
|
10
|
+
@payload = ::JWT.decode(jwt, Castle.config.api_secret, true) do |header|
|
11
11
|
@header = header.with_indifferent_access
|
12
|
-
|
12
|
+
Castle.config.api_secret # used by the 'key finder' in the JWT gem
|
13
13
|
end.with_indifferent_access
|
14
14
|
rescue ::JWT::DecodeError => e
|
15
15
|
raise Castle::SecurityError.new(e)
|
@@ -29,7 +29,7 @@ module Castle
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def to_token
|
32
|
-
::JWT.encode(@payload,
|
32
|
+
::JWT.encode(@payload, Castle.config.api_secret, "HS256", @header)
|
33
33
|
end
|
34
34
|
|
35
35
|
end
|
data/lib/castle/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: castle-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Johan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: her
|