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

Function testV2ToSign

test/auth.spec.js:36–55  ·  view source on GitHub ↗
(t, request, amzHeaders, addConfig, evapConfig)

Source from the content-addressed store, hash-verified

34 return testCommonAuthorization(t, addCfg, evapConfig);
35}
36function testV2ToSign(t, request, amzHeaders, addConfig, evapConfig) {
37 return testV2Authorization(t, evapConfig, addConfig)
38 .then(function () {
39 var qp = params(testRequests[t.context.testId][2].url),
40 h = Object.assign({}, amzHeaders, {testId: t.context.testId, 'x-amz-date': qp.datetime}),
41 r = Object.assign({}, request, {x_amz_headers: h, contentType: (addConfig ? addConfig.contentType : undefined)}),
42 expected = encodeURIComponent(stringToSignV2('/' + AWS_BUCKET + '/' + t.context.config.name +
43 '?partNumber=1&uploadId=Hzr2sK034dOrV4gMsYK.MMrtWIS8JVBPKgeQ.LWd6H8V2PsLecsBqoA1cG1hjD3G4KRX_EBEwxWWDu8lNKezeA--', 'PUT', r))
44
45 return new Promise(function (resolve, reject) {
46 var result = {
47 result: qp.to_sign,
48 expected: expected
49 }
50 resolve(result)
51
52 })
53 })
54
55}
56function testV2ListParts(t, request, amzHeaders, addConfig, maxGetParts, partNumberMarker, evapConfig) {
57 t.context.partNumberMarker = partNumberMarker
58 t.context.maxGetParts = maxGetParts

Callers 1

auth.spec.jsFile · 0.85

Calls 4

testV2AuthorizationFunction · 0.85
paramsFunction · 0.85
stringToSignV2Function · 0.85
resolveFunction · 0.85

Tested by

no test coverage detected