qinium 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/qinium/auth.rb +21 -21
- data/lib/qinium/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 71fb810b83aa86b841807f59e77760a8f23e127107f1ee44ba712d847f64e64c
|
4
|
+
data.tar.gz: 4752611fec5d825fe22dbbc376a5711b76f3736c498cdfc2fcb8d465e3f982b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2802159a521550d9dcf0acde0a706699ece0fb5d6ca973b0583ea09a45f342a3a70385a00a8afd4bc3df8dac907b416c32578e60bcc92fbde1954ff2851cc4a
|
7
|
+
data.tar.gz: 29a55c5db1a6c47240293131716badb7508159e0ccde1903b8d526d3b6cbf7384391d6bb73dae8d4e6b3fcf5dfdb2d0656fd1eea1a9409cda8d0cb3cedfa8a41
|
data/Gemfile.lock
CHANGED
data/lib/qinium/auth.rb
CHANGED
@@ -34,38 +34,38 @@ class Qinium
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def authorize_download_url(domain, key, access_key, secret_key, args = {})
|
37
|
-
url_encoded_key = CGI
|
37
|
+
url_encoded_key = key.split("/").map { |s| CGI.escape(s) }.join("/")
|
38
38
|
schema = args[:schema] || "http"
|
39
39
|
port = args[:port]
|
40
40
|
|
41
|
-
if port.nil?
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
41
|
+
download_url = if port.nil?
|
42
|
+
"#{schema}://#{domain}/#{url_encoded_key}"
|
43
|
+
else
|
44
|
+
"#{schema}://#{domain}:#{port}/#{url_encoded_key}"
|
45
|
+
end
|
46
46
|
|
47
47
|
### URL变换:追加FOP指令
|
48
|
-
if args[:fop].is_a?(String) && args[:fop] !=
|
49
|
-
if download_url.include?(
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
48
|
+
if args[:fop].is_a?(String) && args[:fop] != ""
|
49
|
+
download_url = if download_url.include?("?")
|
50
|
+
# 已有参数
|
51
|
+
"#{download_url}&#{args[:fop]}"
|
52
|
+
else
|
53
|
+
# 尚无参数
|
54
|
+
"#{download_url}?#{args[:fop]}"
|
55
|
+
end
|
56
56
|
end
|
57
57
|
|
58
58
|
### 授权期计算
|
59
59
|
e = Time.now.to_i + args[:expires_in]
|
60
60
|
|
61
61
|
### URL变换:追加授权期参数
|
62
|
-
if download_url.include?(
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
62
|
+
download_url = if download_url.include?("?")
|
63
|
+
# 已有参数
|
64
|
+
"#{download_url}&e=#{e}"
|
65
|
+
else
|
66
|
+
# 尚无参数
|
67
|
+
"#{download_url}?e=#{e}"
|
68
|
+
end
|
69
69
|
|
70
70
|
### 生成数字签名
|
71
71
|
sign = calculate_hmac_sha1_digest(secret_key, download_url)
|
data/lib/qinium/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qinium
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- xiaohui
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-11-06 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Qiniu Cloud Storage SDK for multi-tenant system, can call API with multiple
|
14
14
|
accounts
|
@@ -46,7 +46,7 @@ metadata:
|
|
46
46
|
homepage_uri: https://github.com/xiaohui-zhangxh/qinium
|
47
47
|
source_code_uri: https://github.com/xiaohui-zhangxh/qinium
|
48
48
|
changelog_uri: https://github.com/xiaohui-zhangxh/qinium/CHANGELOG.md
|
49
|
-
post_install_message:
|
49
|
+
post_install_message:
|
50
50
|
rdoc_options: []
|
51
51
|
require_paths:
|
52
52
|
- lib
|
@@ -61,8 +61,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
61
61
|
- !ruby/object:Gem::Version
|
62
62
|
version: '0'
|
63
63
|
requirements: []
|
64
|
-
rubygems_version: 3.4.
|
65
|
-
signing_key:
|
64
|
+
rubygems_version: 3.4.10
|
65
|
+
signing_key:
|
66
66
|
specification_version: 4
|
67
67
|
summary: Qiniu Cloud Storage SDK for multi-tenant system
|
68
68
|
test_files: []
|