blockstack 0.5.8 → 0.5.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/blockstack.gemspec +1 -1
- data/lib/blockstack.rb +5 -5
- data/lib/blockstack/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8daf40736cb953c765242753a4cb4eb2316e2e0c
|
4
|
+
data.tar.gz: bd4f321c8caf70f2c3553a309730f7fb265a8ca0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6cc5b4436ef16f75a3cc85dfc631ba30f1caaff7e772d3dd59b61bf66ab41fc43f84b99c5ad2a36058dff3612d5ff706c095a788107389f78a8d959f5f9ad26
|
7
|
+
data.tar.gz: 6d9a69b8302ecce9131b9aa40ff95b876ecc6f5c7312b3f42e13dee629ae562701ae9b3f021a54fa67a8d5eadc42686513bf01dc78f240197dc1929b205843a6
|
data/blockstack.gemspec
CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.add_development_dependency "webmock"
|
26
26
|
spec.add_development_dependency "vcr"
|
27
27
|
|
28
|
-
spec.add_dependency "
|
28
|
+
spec.add_dependency "jwtb", "2.0.0.beta2.bsk1"
|
29
29
|
spec.add_dependency "bitcoin-ruby"
|
30
30
|
spec.add_dependency "faraday"
|
31
31
|
|
data/lib/blockstack.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require "blockstack/version"
|
2
2
|
require "bitcoin"
|
3
3
|
require "faraday"
|
4
|
-
require "
|
4
|
+
require "jwtb"
|
5
5
|
|
6
6
|
module Blockstack
|
7
7
|
class InvalidAuthResponse < StandardError; end
|
@@ -43,7 +43,7 @@ module Blockstack
|
|
43
43
|
# public keys
|
44
44
|
public_key = nil
|
45
45
|
verify = false
|
46
|
-
decoded_tokens =
|
46
|
+
decoded_tokens = JWTB.decode auth_token, public_key, verify, algorithm: ALGORITHM
|
47
47
|
decoded_token = decoded_tokens[0]
|
48
48
|
|
49
49
|
REQUIRED_CLAIMS.each do |field|
|
@@ -65,7 +65,7 @@ module Blockstack
|
|
65
65
|
verify = true
|
66
66
|
|
67
67
|
# decode & verify signature
|
68
|
-
decoded_tokens =
|
68
|
+
decoded_tokens = JWTB.decode auth_token, ecdsa_key, verify, algorithm: ALGORITHM, exp_leeway: self.leeway
|
69
69
|
decoded_token = decoded_tokens[0]
|
70
70
|
|
71
71
|
raise InvalidAuthResponse.new("Public keys don't match issuer address") unless self.public_keys_match_issuer?(decoded_token)
|
@@ -73,9 +73,9 @@ module Blockstack
|
|
73
73
|
raise InvalidAuthResponse.new("Public keys don't match owner of claimed username") unless self.public_keys_match_username?(decoded_token)
|
74
74
|
|
75
75
|
return decoded_token
|
76
|
-
rescue
|
76
|
+
rescue JWTB::VerificationError => error
|
77
77
|
raise InvalidAuthResponse.new("Signature on JWT is invalid")
|
78
|
-
rescue
|
78
|
+
rescue JWTB::DecodeError => error
|
79
79
|
raise InvalidAuthResponse.new("Unable to decode JWT")
|
80
80
|
rescue RuntimeError => error
|
81
81
|
raise InvalidAuthResponse.new(error.message)
|
data/lib/blockstack/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blockstack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Larry Salibra
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -81,19 +81,19 @@ dependencies:
|
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: jwtb
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - '='
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 2.0.0.beta2
|
89
|
+
version: 2.0.0.beta2.bsk1
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - '='
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 2.0.0.beta2
|
96
|
+
version: 2.0.0.beta2.bsk1
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: bitcoin-ruby
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|