MCPcopy Index your code
hub / github.com/scality/cloudserver / _makeRequest

Function _makeRequest

tests/unit/api/bucketDeletePolicy.js:17–39  ·  view source on GitHub ↗
(includePolicy)

Source from the content-addressed store, hash-verified

15const bucketName = 'bucketname';
16
17function _makeRequest(includePolicy) {
18 const request = {
19 bucketName,
20 headers: { host: `${bucketName}.s3.amazonaws.com` },
21 url: '/',
22 actionImplicitDenies: false,
23 };
24 if (includePolicy) {
25 const examplePolicy = {
26 Version: '2012-10-17',
27 Statement: [
28 {
29 Effect: 'Allow',
30 Resource: `arn:aws:s3:::${bucketName}`,
31 Principal: '*',
32 Action: ['s3:GetBucketLocation'],
33 },
34 ],
35 };
36 request.post = JSON.stringify(examplePolicy);
37 }
38 return request;
39}
40
41describe('deleteBucketPolicy API', () => {
42 before(() => cleanup());

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected