tencentcloud-simple-sign 1.0.0 → 1.0.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: 4160751fc4885ac1b8d4235af4a2a3ca2cc7f3365380bf1807693e52dc93af10
4
- data.tar.gz: 9210cfd39a66135f4def0365c02ec9b89073d827398caf026bbe134d47de419b
3
+ metadata.gz: 577c2dd8ffcd69a98b64bec8fe5b5599e276e1011c197bbed55fe10ec7ef1796
4
+ data.tar.gz: '08617dbb6793d473569a1e70a8b70a74502104f060e7563d1edc1129286daf0f'
5
5
  SHA512:
6
- metadata.gz: 12af7f15a53fbe9f0cab3c55fa082e1fc782a5c5e0484239c32f2e93338441e11b12f4b40171e63908cf006594e50821b726357031975d4b893645168c2fff9c
7
- data.tar.gz: a53d3cd9edb344c956871a400817bfb926d74bc1a639a012dd25cfb27cefac12b7311bbae0701dbac0cc8a4e1e4fc6e8fcbfbdc0da4432bf1de51afb8f5d9e23
6
+ metadata.gz: 523d173915af4aa46a9dd8cc69a9df45da139dc42571a0457a33760f680e4f71e8e3f1c5a3857f974b06751572c2c64b564be8daae87a1ee43600fe0889b8ff3
7
+ data.tar.gz: 93f4b6dbb3e981a9ac879c08a3c0b33d2e2e03d0d6a87086d62bdc796b8134c9e06af9265de1f21029195dfd0f02af2de8be75eca57c4b3f99cafff0ed60526d
data/lib/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.0.1
@@ -6,7 +6,7 @@ require 'base64'
6
6
  module TencentCloud
7
7
  class Sign
8
8
  class << self
9
- def sign_v3(secret_id, secret_key, host, timestamp, expire_timestamp)
9
+ def sign_v3(secret_id, secret_key, host, timestamp, expire_timestamp, token = '')
10
10
  service = 'clbia'
11
11
  method = 'POST'
12
12
  content_type = 'application/json'
@@ -40,7 +40,11 @@ module TencentCloud
40
40
  secret_service = OpenSSL::HMAC.digest(digest, secret_date, service)
41
41
  secret_signing = OpenSSL::HMAC.digest(digest, secret_service, 'tc3_request')
42
42
  signature = OpenSSL::HMAC.hexdigest(digest, secret_signing, string_to_sign)
43
- "#{algorithm} Credential=#{secret_id}/#{credential_scope}, SignedHeaders=#{signed_headers}, SignTime=#{timestamp}, ExpireTime=#{expire_timestamp}, Signature=#{signature}"
43
+ authorization = "#{algorithm} Credential=#{secret_id}/#{credential_scope}, SignedHeaders=#{signed_headers}, SignTime=#{timestamp}, ExpireTime=#{expire_timestamp}, Signature=#{signature}"
44
+ if token != ''
45
+ authorization += ', Token=' + token
46
+ end
47
+ authorization
44
48
  end
45
49
  end
46
50
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tencentcloud-simple-sign
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tencent Cloud
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-10 00:00:00.000000000 Z
11
+ date: 2024-10-12 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Tencent Cloud Simple Sign SDK for Ruby
14
14
  email: