class Aliyun::Mq::Sdk::Auth
Public Class Methods
build_sign(sign_str, secret_key)
click to toggle source
# File lib/aliyun/mq/sdk/utils.rb, line 44 def build_sign(sign_str, secret_key) Base64.strict_encode64("#{OpenSSL::HMAC.digest('sha1', secret_key, sign_str)}").strip end
del_sign(secret_key, topic, consumer_id, msg_handle, date)
click to toggle source
# File lib/aliyun/mq/sdk/utils.rb, line 40 def del_sign(secret_key, topic, consumer_id, msg_handle, date) build_sign([topic, consumer_id, msg_handle, date].join("\n"), secret_key) end
get_sign(secret_key, topic, consumer_id, date)
click to toggle source
# File lib/aliyun/mq/sdk/utils.rb, line 36 def get_sign(secret_key, topic, consumer_id, date) build_sign([topic, consumer_id, date].join("\n"), secret_key) end
md5(cnt)
click to toggle source
# File lib/aliyun/mq/sdk/utils.rb, line 48 def md5(cnt) Digest::MD5.hexdigest(cnt) end
post_sign(secret_key, topic, producer_id, msg, date)
click to toggle source
# File lib/aliyun/mq/sdk/utils.rb, line 32 def post_sign(secret_key, topic, producer_id, msg, date) s = build_sign([topic, producer_id, md5(msg), date].join("\n"), secret_key) end