MCPcopy
hub / github.com/TTLabs/EvaporateJS / stringToSignV2

Function stringToSignV2

test/auth.spec.js:121–145  ·  view source on GitHub ↗
(path, method, request)

Source from the content-addressed store, hash-verified

119}
120
121function stringToSignV2(path, method, request) {
122
123 var x_amz_headers = '', result, header_key_array = [];
124
125 for (var key in request.x_amz_headers) {
126 if (request.x_amz_headers.hasOwnProperty(key)) {
127 header_key_array.push(key);
128 }
129 }
130 header_key_array.sort();
131
132 header_key_array.forEach(function (header_key) {
133 x_amz_headers += (header_key + ':' + request.x_amz_headers[header_key] + '\n');
134 });
135
136 result = method + '\n' +
137 (request.md5_digest || '') + '\n' +
138 (request.contentType || '') + '\n' +
139 '\n' +
140 x_amz_headers +
141 '' +
142 path;
143
144 return result;
145}
146
147function v4Authorization(signingKey) {
148 return 'AWS4-HMAC-SHA256 Credential=testkey/' + v4DateString() + '/us-east-1/s3/aws4_request, SignedHeaders=host;testid;x-amz-date, Signature=' + signingKey

Callers 2

testV2ToSignFunction · 0.85
testV2ListPartsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected