aliyun-api 0.0.8 → 0.0.9

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: a918d63655ddef8c7721cc5347f38ab44c427543
4
- data.tar.gz: 328046cf5951d221822fd11de94c84d419ca9f59
3
+ metadata.gz: 521d6aa9fce4f08964bfdc6c410c61b65649ebb5
4
+ data.tar.gz: 1bca6e89110b371bbca33be0276145dceb8604af
5
5
  SHA512:
6
- metadata.gz: 4b0c7bd6bf3367cc2eff0d4237b86d8865e8fcaf4560f5b0fb7e18d6c8698a5ad8fb1cf5da3ff67d056b9623180b8fd914f2b971ebf5a489d7951420f6fdb8e0
7
- data.tar.gz: 55fd0d89834f464ce7ae3aa392d3ec6222256b111eab0abedc2a6497f8a305aca0e2935d56e165f7f6a92b80fc9bad81e490165106efcfc2563c8d7d824711a0
6
+ metadata.gz: b4a0d14d1a7fb5437356b432b09dc15d4a01a99bdb2b40d29d294c065f0a905e21be9af1177f8c0ff4bfbd69cd66cf42318fa4c16d4ffc26515b98126bf8c0f2
7
+ data.tar.gz: 558f0bd123476bfd148a4b2fda8ca37c3f2df1cab66d54036330eb26554ba7cf9fd3a80a3ac3964bc481f508819e958f25a1116229b23073e531c32a4ceb477b
data/lib/aliyun/ecs.rb CHANGED
@@ -3,7 +3,7 @@ require 'securerandom'
3
3
  require 'uri'
4
4
  require 'rest_client'
5
5
  require 'base64'
6
- require 'hmac-sha1'
6
+ require 'openssl'
7
7
  require 'json'
8
8
 
9
9
 
@@ -69,10 +69,7 @@ module Aliyun
69
69
  end
70
70
 
71
71
  def calculate_signature key, string_to_sign
72
- hmac = HMAC::SHA1.new(key)
73
- hmac.update(string_to_sign)
74
- signature = Base64.encode64(hmac.digest).gsub("\n", '')
75
- signature
72
+ Base64.strict_encode64 OpenSSL::HMAC.digest('sha1',key, string_to_sign)
76
73
  end
77
74
 
78
75
  def percent_encode value
@@ -1,3 +1,3 @@
1
1
  module Aliyun
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aliyun-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - qjpcpu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-28 00:00:00.000000000 Z
11
+ date: 2016-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler