blockstack 0.5.7 → 0.5.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c3b97f580a7e55d992a203c7795538758d52044d
4
- data.tar.gz: d93d898c251a586f465811760255f1fa1018ed0e
3
+ metadata.gz: b6f17928fc071da951073e2908a2153fe04cd76a
4
+ data.tar.gz: 803d5b93db854420100a55f600ce031e92d965bd
5
5
  SHA512:
6
- metadata.gz: 89e72e362c6c4480a05ca44faa87c45c1517182e7742d171b090033233e967763ba7c488e4148fef83de4e76f6d110655019e206d9b78450fb908e7a2213f729
7
- data.tar.gz: e3c44e440f15a56a67aec5df7862f4e55464c95ca28082634ce3890e16434e25ae91e847e0e7d2a24207ae5ec61dbafa6fceb9a63d0fe6e252426f45fdef7bbb
6
+ metadata.gz: 303b4e3cb314f087247ae5c48b032b89483c7751df68729eb3a7060c118478b8e1f6ebb7bc46b34c1b934962c9e2088f97f01f2867394124c8a793597365ce95
7
+ data.tar.gz: db1f710195a86d49aed2ac54638e29fb5c3c75d3db69cb1b24eb68bbb62bbe6522984b47d4b5cf9ee2e228e62bdeb4de0957a6e8afd4a9bd316ef395bc0b1597
@@ -1,3 +1,3 @@
1
1
  module Blockstack
2
- VERSION = "0.5.7"
2
+ VERSION = "0.5.8"
3
3
  end
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 publicKeys)
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['publicKeys']
55
+ public_keys = decoded_token['public_keys']
56
56
 
57
- raise InvalidAuthResponse.new("Invalid publicKeys array: only 1 key is supported") unless public_keys.length == 1
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['publicKeys']
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.7
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-15 00:00:00.000000000 Z
11
+ date: 2017-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler