Compare commits

...

3 Commits

Author SHA1 Message Date
Frédéric Meinnel 406044b519 [DROP ME] Add a few shortcuts to test against cloudserver and against aws s3 2024-01-18 16:55:20 +01:00
Frédéric Meinnel 51010e989b [DROP ME] Using dev version of arsenal
This reverts commit d66c838d373d6afc05aaa18d1735fcdb5b257551.
2024-01-18 16:55:04 +01:00
Frédéric Meinnel 9ed9e6c834 CLDSRV-493: Fix generateV4Headers for HTTP PUT with body 2024-01-18 16:55:04 +01:00
5 changed files with 13 additions and 41 deletions

View File

@ -20,7 +20,7 @@
"homepage": "https://github.com/scality/S3#readme",
"dependencies": {
"@hapi/joi": "^17.1.0",
"arsenal": "git+https://github.com/scality/arsenal#7.10.55",
"arsenal": "git+https://github.com/scality/arsenal#bugfix/S3C-8375/fix-generatev4headers",
"async": "~2.5.0",
"aws-sdk": "2.905.0",
"azure-storage": "^2.1.0",
@ -66,7 +66,10 @@
"ft_awssdk_external_backends": "cd tests/functional/aws-node-sdk && mocha --reporter mocha-multi-reporters --reporter-options configFile=$INIT_CWD/tests/reporter-config.json test/multipleBackend",
"ft_management": "cd tests/functional/report && yarn test",
"ft_node": "cd tests/functional/raw-node && yarn test",
"ft_node_lifecycle": "cd tests/functional/raw-node && mocha --reporter mocha-multi-reporters --reporter-options configFile=$INIT_CWD/tests/reporter-config.json -t 40000 test/lifecycle.js",
"ft_node_lifecycle_aws": "cd tests/functional/raw-node && AWS_ON_AIR=true mocha --reporter mocha-multi-reporters --reporter-options configFile=$INIT_CWD/tests/reporter-config.json -t 40000 test/lifecycle.js",
"ft_node_routes": "cd tests/functional/raw-node && yarn run test-routes",
"ft_node_route_backbeat": "cd tests/functional/raw-node && mocha --reporter mocha-multi-reporters --reporter-options configFile=$INIT_CWD/tests/reporter-config.json -t 40000 test/routes/routeBackbeat.js",
"ft_gcp": "cd tests/functional/raw-node && yarn run test-gcp",
"ft_healthchecks": "cd tests/functional/healthchecks && yarn test",
"ft_s3cmd": "cd tests/functional/s3cmd && mocha --reporter mocha-multi-reporters --reporter-options configFile=$INIT_CWD/tests/reporter-config.json -t 40000 *.js",

View File

@ -4,8 +4,8 @@ const { makeS3Request } = require('../utils/makeRequest');
const { randomUUID } = require('crypto');
const authCredentials = {
accessKey: process.env.AWS_ON_AIR ? 'awsAK' : 'accessKey1',
secretKey: process.env.AWS_ON_AIR ? 'awsSK' : 'verySecretKey1',
accessKey: process.env.AWS_ON_AIR ? process.env.AWS_ON_AIR_AK : 'accessKey1',
secretKey: process.env.AWS_ON_AIR ? process.env.AWS_ON_AIR_SK : 'verySecretKey1',
};
const bucket = `rawnodelifecyclebucket-${randomUUID()}`;

View File

@ -1237,7 +1237,6 @@ describeSkipIfAWS('backbeat routes', () => {
queryObj,
headers: {
'content-length': testData.length,
'content-md5': testDataMd5,
'x-scal-canonical-id': testArn,
},
authCredentials: backbeatAuthCredentials,
@ -1294,7 +1293,6 @@ describeSkipIfAWS('backbeat routes', () => {
queryObj: { v2: '' },
headers: {
'content-length': testData.length,
'content-md5': testDataMd5,
'x-scal-canonical-id': testArn,
},
authCredentials: backbeatAuthCredentials,
@ -1354,7 +1352,6 @@ describeSkipIfAWS('backbeat routes', () => {
queryObj: { v2: '' },
headers: {
'content-length': testData.length,
'content-md5': testDataMd5,
'x-scal-canonical-id': testArn,
},
authCredentials: backbeatAuthCredentials,
@ -1387,7 +1384,6 @@ describeSkipIfAWS('backbeat routes', () => {
queryObj: { v2: '' },
headers: {
'content-length': testData.length,
'content-md5': testDataMd5,
},
authCredentials: backbeatAuthCredentials,
requestBody: testData,
@ -1397,23 +1393,6 @@ describeSkipIfAWS('backbeat routes', () => {
done();
}));
it('should refuse PUT data if no content-md5 header is provided',
done => makeBackbeatRequest({
method: 'PUT', bucket: TEST_BUCKET,
objectKey: testKey, resourceType: 'data',
queryObj: { v2: '' },
headers: {
'content-length': testData.length,
'x-scal-canonical-id': testArn,
},
authCredentials: backbeatAuthCredentials,
requestBody: testData,
},
err => {
assert.strictEqual(err.code, 'BadRequest');
done();
}));
it('should refuse PUT in metadata-only mode if object does not exist',
done => {
async.waterfall([next => {
@ -1447,7 +1426,6 @@ describeSkipIfAWS('backbeat routes', () => {
resourceType: 'data',
headers: {
'content-length': testData.length,
'content-md5': testDataMd5,
'x-scal-canonical-id': testArn,
},
authCredentials: backbeatAuthCredentials,
@ -1492,7 +1470,6 @@ describeSkipIfAWS('backbeat routes', () => {
resourceType: 'data',
headers: {
'content-length': testData.length,
'content-md5': testDataMd5,
'x-scal-canonical-id': testArn,
},
authCredentials: backbeatAuthCredentials,
@ -1548,7 +1525,6 @@ describeSkipIfAWS('backbeat routes', () => {
resourceType: 'data',
headers: {
'content-length': testData.length,
'content-md5': testDataMd5,
'x-scal-canonical-id': testArn,
},
authCredentials: backbeatAuthCredentials,
@ -1634,7 +1610,6 @@ describeSkipIfAWS('backbeat routes', () => {
resourceType: 'data',
headers: {
'content-length': testData.length,
'content-md5': testDataMd5,
'x-scal-canonical-id': testArn,
},
authCredentials: backbeatAuthCredentials,
@ -1685,7 +1660,6 @@ describeSkipIfAWS('backbeat routes', () => {
resourceType: 'data',
headers: {
'content-length': testData.length,
'content-md5': testDataMd5,
'x-scal-canonical-id': testArn,
},
authCredentials: backbeatAuthCredentials,
@ -1716,7 +1690,6 @@ describeSkipIfAWS('backbeat routes', () => {
resourceType: 'data',
headers: {
'content-length': testData.length,
'content-md5': testDataMd5,
'x-scal-canonical-id': testArn,
},
authCredentials: backbeatAuthCredentials,

View File

@ -111,18 +111,14 @@ function makeRequest(params, callback) {
// decode path because signing code re-encodes it
req.path = _decodeURI(encodedPath);
if (authCredentials && !params.GCP) {
if (queryObj) {
auth.client.generateV4Headers(req, queryObj,
authCredentials.accessKey, authCredentials.secretKey, 's3');
// may update later if request may contain POST body
} else {
auth.client.generateV4Headers(req, '', authCredentials.accessKey,
authCredentials.secretKey, 's3');
}
auth.client.generateV4Headers(req, queryObj || '',
authCredentials.accessKey, authCredentials.secretKey, 's3', undefined, undefined, requestBody);
}
// restore original URL-encoded path
req.path = encodedPath;
req.path = queryObj ? `${options.path}?${qs}` : req.path;
if (queryObj) {
req.path = `${options.path}?${qs}`;
}
if (requestBody) {
req.write(requestBody);
}

View File

@ -488,9 +488,9 @@ arraybuffer.slice@~0.0.7:
optionalDependencies:
ioctl "^2.0.2"
"arsenal@git+https://github.com/scality/arsenal#7.10.55":
"arsenal@git+https://github.com/scality/arsenal#bugfix/S3C-8375/fix-generatev4headers":
version "7.10.55"
resolved "git+https://github.com/scality/arsenal#4da59769d24ec0fa4590de1f826dd1dcab1872c6"
resolved "git+https://github.com/scality/arsenal#741f84a282eb0cb0f44f6dd045fa2dff63b47938"
dependencies:
"@types/async" "^3.2.12"
"@types/utf8" "^3.0.1"