70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
# File 'lib/api_auth/railtie.rb', line 70
def request_with_auth(method, path, *arguments)
if use_hmac && hmac_access_id && hmac_secret_key
h = arguments.last
tmp = "Net::HTTP::#{method.to_s.capitalize}".constantize.new(path, h)
tmp.body = arguments[0] if arguments.length > 1
ApiAuth.sign!(tmp, hmac_access_id, hmac_secret_key, api_auth_options)
if tmp['X-Authorization-Content-SHA256']
arguments.last['X-Authorization-Content-SHA256'] = tmp['X-Authorization-Content-SHA256']
end
arguments.last['DATE'] = tmp['DATE']
arguments.last['Authorization'] = tmp['Authorization']
end
request_without_auth(method, path, *arguments)
end
|