blockstack 0.5.7 → 0.5.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/blockstack/version.rb +1 -1
- data/lib/blockstack.rb +4 -4
- 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: b6f17928fc071da951073e2908a2153fe04cd76a
|
4
|
+
data.tar.gz: 803d5b93db854420100a55f600ce031e92d965bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 303b4e3cb314f087247ae5c48b032b89483c7751df68729eb3a7060c118478b8e1f6ebb7bc46b34c1b934962c9e2088f97f01f2867394124c8a793597365ce95
|
7
|
+
data.tar.gz: db1f710195a86d49aed2ac54638e29fb5c3c75d3db69cb1b24eb68bbb62bbe6522984b47d4b5cf9ee2e228e62bdeb4de0957a6e8afd4a9bd316ef395bc0b1597
|
data/lib/blockstack/version.rb
CHANGED
data/lib/blockstack.rb
CHANGED
@@ -8,7 +8,7 @@ module Blockstack
|
|
8
8
|
|
9
9
|
USER_AGENT = "blockstack-ruby #{VERSION}"
|
10
10
|
ALGORITHM = "ES256K"
|
11
|
-
REQUIRED_CLAIMS = %w(iss iat jti exp username profile
|
11
|
+
REQUIRED_CLAIMS = %w(iss iat jti exp username profile public_keys)
|
12
12
|
|
13
13
|
DEFAULT_LEEWAY = 30 # seconds
|
14
14
|
DEFAULT_VALID_WITHIN = 30 # seconds
|
@@ -52,9 +52,9 @@ module Blockstack
|
|
52
52
|
raise InvalidAuthResponse.new("Missing required 'iat' claim.") if !decoded_token["iat"]
|
53
53
|
raise InvalidAuthResponse.new("'iat' timestamp claim is skewed too far from present.") if (Time.now.to_i - decoded_token["iat"]).abs > self.valid_within
|
54
54
|
|
55
|
-
public_keys = decoded_token['
|
55
|
+
public_keys = decoded_token['public_keys']
|
56
56
|
|
57
|
-
raise InvalidAuthResponse.new("Invalid
|
57
|
+
raise InvalidAuthResponse.new("Invalid public_keys array: only 1 key is supported") unless public_keys.length == 1
|
58
58
|
|
59
59
|
compressed_hex_public_key = public_keys[0]
|
60
60
|
bignum = OpenSSL::BN.new(compressed_hex_public_key, 16)
|
@@ -97,7 +97,7 @@ module Blockstack
|
|
97
97
|
protected
|
98
98
|
|
99
99
|
def self.public_keys_match_issuer?(decoded_token)
|
100
|
-
public_keys = decoded_token['
|
100
|
+
public_keys = decoded_token['public_keys']
|
101
101
|
address_from_issuer = get_address_from_did(decoded_token['iss'])
|
102
102
|
|
103
103
|
raise 'Multiple public keys are not supported' unless public_keys.count == 1
|
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.8
|
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-03-
|
11
|
+
date: 2017-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|