tencent_cos_sdk 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/lib/tencent_cos_sdk/utils.rb +0 -16
- data/lib/tencent_cos_sdk/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 33168e64ad0f45cce481cdfd3289a5ab5df7f52c
|
4
|
+
data.tar.gz: 2c635c64254ce175c87a20303e6eee3372425d6f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c89cbde83fa36d51fe2148127e0de8f7eb91bea1e258f2babae0beef87982c6543fbc09bdce4a1388ebe16f4d6385337c720bb3ee6ef5c579aded3ff8cc767e1
|
7
|
+
data.tar.gz: 6f4afc9bbd4ea8b16b851927ac7024a0783c4cf3a7883ad9d121b4225f31b57b1973f83ddb7e4e43fa6d606153f73069efd9a09a646899359b57dc2c9a075421
|
data/README.md
CHANGED
@@ -60,4 +60,5 @@ Everyone interacting in the TencentCosSdk project’s codebases, issue trackers,
|
|
60
60
|
|
61
61
|
## Links
|
62
62
|
|
63
|
-
* [ruby gem tencent_cos_sdk](https://
|
63
|
+
* [ruby gem tencent_cos_sdk](https://github.com/xxjapp/tencent_cos_sdk)
|
64
|
+
* [ruby gem carrierwave-tencent_cos](https://github.com/xxjapp/carrierwave-tencent_cos)
|
@@ -13,29 +13,13 @@ module TencentCosSdk
|
|
13
13
|
end
|
14
14
|
|
15
15
|
class Request
|
16
|
-
def log_debug *values
|
17
|
-
p values if options[:log_debug]
|
18
|
-
end
|
19
|
-
|
20
16
|
def get_authorization
|
21
17
|
sign_time = options[:sign_time] || "#{Time.now.to_i - 3600};#{Time.now.to_i + 3600}"
|
22
|
-
log_debug '=>', sign_time
|
23
|
-
|
24
|
-
log_debug '[', TencentCosSdk.conf.secret_key, ']'
|
25
18
|
sign_key = OpenSSL::HMAC.hexdigest('sha1', TencentCosSdk.conf.secret_key, sign_time)
|
26
|
-
log_debug '=>', sign_key
|
27
|
-
|
28
19
|
http_string = get_http_string
|
29
|
-
log_debug '=>', http_string
|
30
|
-
|
31
20
|
sha1ed_http_string = Digest::SHA1.hexdigest http_string
|
32
|
-
log_debug '=>', sha1ed_http_string
|
33
|
-
|
34
21
|
string_to_sign = "sha1\n#{sign_time}\n#{sha1ed_http_string}\n"
|
35
|
-
log_debug '=>', string_to_sign
|
36
|
-
|
37
22
|
signature = OpenSSL::HMAC.hexdigest('sha1', sign_key, string_to_sign)
|
38
|
-
log_debug '=>', signature
|
39
23
|
|
40
24
|
{
|
41
25
|
'q-sign-algorithm' => 'sha1',
|