Class: AWS::SimpleWorkflow::Request
Instance Attribute Summary collapse
#access_key_id, #headers, #host, #http_method, #params, #path, #proxy_uri, #region, #service_ruby_name
Instance Method Summary
collapse
#add_param, #initialize, #port, #port=, #querystring, #ssl_ca_file, #ssl_ca_file=, #ssl_ca_path, #ssl_ca_path=, #ssl_verify_peer=, #ssl_verify_peer?, #uri, #url_encoded_params, #use_ssl=, #use_ssl?
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
22
23
24
|
# File 'lib/aws/simple_workflow/request.rb', line 22
def body
@body
end
|
Instance Method Details
#add_authorization!(signer) ⇒ Object
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
# File 'lib/aws/simple_workflow/request.rb', line 24
def add_authorization!(signer)
self.access_key_id = signer.access_key_id
["x-amz-date"] ||= (["date"] ||= Time.now.rfc822)
["host"] ||= host
request_hash = OpenSSL::Digest::SHA256.digest(string_to_sign)
signature = signer.sign(request_hash)
["x-amzn-authorization"] =
"AWS3 "+
"AWSAccessKeyId=#{signer.access_key_id},"+
"Algorithm=HmacSHA256,"+
"SignedHeaders=#{headers_to_sign.join(';')},"+
"Signature=#{signature}"
end
|
53
54
55
56
57
58
|
# File 'lib/aws/simple_workflow/request.rb', line 53
def
.map do |name|
value = [name]
"#{name.downcase.strip}:#{value.strip}\n"
end.sort.join
end
|
46
47
48
49
50
51
|
# File 'lib/aws/simple_workflow/request.rb', line 46
def
.keys.select do ||
== "host" ||
=~ /^x-amz/
end
end
|
#read_timeout ⇒ Object
68
69
70
71
72
73
74
75
|
# File 'lib/aws/simple_workflow/request.rb', line 68
def read_timeout
if ['x-amz-target'] =~ /PollFor(Decision|Activity)Task/
90
else
@read_timeout
end
end
|
#string_to_sign ⇒ Object
60
61
62
63
64
65
66
|
# File 'lib/aws/simple_workflow/request.rb', line 60
def string_to_sign
[http_method,
"/",
"",
,
body].join("\n")
end
|