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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 548c73431631f012020ed8e4c94c83017bfdec9454d26b009549f04d8a5204a9
4
- data.tar.gz: 1c45033d1fd635870afe11150b871c471898a52c234f8b8c99c9462298d2024d
3
+ metadata.gz: 71fb810b83aa86b841807f59e77760a8f23e127107f1ee44ba712d847f64e64c
4
+ data.tar.gz: 4752611fec5d825fe22dbbc376a5711b76f3736c498cdfc2fcb8d465e3f982b4
5
5
  SHA512:
6
- metadata.gz: bf283cf247ef4fbe2482370f844bbeb50a09f06e82920bfdd1646aca372438b1c6d53820063f39ef80f9f6cf8bc2550907dab667e1675ec8e38f3739ba6fa06a
7
- data.tar.gz: 971575d161e4fbf23253b8b380115321b671a8740c5f54ec283e8c71dd7bbac9d380d1657e4e94386c239aba4228183bcf6663b38888d9f6c3bfb5f45c25e2da
6
+ metadata.gz: c2802159a521550d9dcf0acde0a706699ece0fb5d6ca973b0583ea09a45f342a3a70385a00a8afd4bc3df8dac907b416c32578e60bcc92fbde1954ff2851cc4a
7
+ data.tar.gz: 29a55c5db1a6c47240293131716badb7508159e0ccde1903b8d526d3b6cbf7384391d6bb73dae8d4e6b3fcf5dfdb2d0656fd1eea1a9409cda8d0cb3cedfa8a41
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- qinium (0.1.2)
4
+ qinium (0.3.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -65,4 +65,4 @@ DEPENDENCIES
65
65
  webmock (~> 3.17)
66
66
 
67
67
  BUNDLED WITH
68
- 2.3.9
68
+ 2.5.16
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::escape(key)
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? then
42
- download_url = "#{schema}://#{domain}/#{url_encoded_key}"
43
- else
44
- download_url = "#{schema}://#{domain}:#{port}/#{url_encoded_key}"
45
- end
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] != '' then
49
- if download_url.include?('?')
50
- # 已有参数
51
- download_url = "#{download_url}&#{args[:fop]}"
52
- else
53
- # 尚无参数
54
- download_url = "#{download_url}?#{args[:fop]}"
55
- end
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
- download_url = "#{download_url}&e=#{e}"
65
- else
66
- # 尚无参数
67
- download_url = "#{download_url}?e=#{e}"
68
- end
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)
@@ -1,3 +1,3 @@
1
1
  class Qinium
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
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.0
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-05-24 00:00:00.000000000 Z
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.19
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: []