Skip to content

Commit 5d2b194

Browse files
Reformat
Command: yarn lint --fix Issue: CLDSRV-723
1 parent 6d8890f commit 5d2b194

File tree

309 files changed

+14168
-14169
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

309 files changed

+14168
-14169
lines changed

bin/search_bucket.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ const https = require('https');
1010
const logger = require('../lib/utilities/logger');
1111

1212
function _performSearch(host,
13-
port,
14-
bucketName,
15-
query,
16-
listVersions,
17-
accessKey,
18-
secretKey,
19-
sessionToken,
20-
verbose, ssl) {
13+
port,
14+
bucketName,
15+
query,
16+
listVersions,
17+
accessKey,
18+
secretKey,
19+
sessionToken,
20+
verbose, ssl) {
2121
const escapedSearch = encodeURIComponent(query);
2222
const options = {
2323
host,

constants.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,9 @@ const constants = {
122122
// declare here all existing service accounts and their properties
123123
// (if any, otherwise an empty object)
124124
serviceAccountProperties: {
125-
replication: {},
126-
lifecycle: {},
127-
gc: {},
125+
'replication': {},
126+
'lifecycle': {},
127+
'gc': {},
128128
'md-ingestion': {
129129
canReplicate: true,
130130
},

dataserver.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ if (config.backends.data === 'file' ||
3131
dataServer.setup(err => {
3232
if (err) {
3333
logger.error('Error initializing REST data server',
34-
{ error: err });
34+
{ error: err });
3535
return;
3636
}
3737
dataServer.start();

lib/Config.js

Lines changed: 86 additions & 86 deletions
Large diffs are not rendered by default.

lib/api/api.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ const api = {
220220
// issue 100 Continue to the client
221221
writeContinue(request, response);
222222
const MAX_POST_LENGTH = request.method === 'POST' ?
223-
1024 * 1024 : 1024 * 1024 / 2; // 1 MB or 512 KB
223+
1024 * 1024 : 1024 * 1024 / 2; // 1 MB or 512 KB
224224
const post = [];
225225
let postLength = 0;
226226
request.on('data', chunk => {
@@ -241,7 +241,7 @@ const api = {
241241
request.on('end', () => {
242242
if (postLength > MAX_POST_LENGTH) {
243243
log.error('body length is too long for request type',
244-
{ postLength });
244+
{ postLength });
245245
return next(errors.InvalidRequest);
246246
}
247247
// Convert array of post buffers into one string
@@ -287,8 +287,8 @@ const api = {
287287
}, {});
288288
}
289289
const methodCallback = (err, ...results) => async.forEachLimit(request.finalizerHooks, 5,
290-
(hook, done) => hook(err, done),
291-
() => callback(err, ...results));
290+
(hook, done) => hook(err, done),
291+
() => callback(err, ...results));
292292

293293
if (apiMethod === 'objectPut' || apiMethod === 'objectPutPart') {
294294
request._response = response;

lib/api/apiUtils/authorization/permissionChecks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ function evaluateBucketPolicyWithIAM(bucket, requestTypesInput, canonicalID, aut
428428
arn = authInfo.getArn();
429429
}
430430
return processBucketPolicy(_requestType, bucket, canonicalID, arn, bucket.getOwner(), log,
431-
request, true, results, actionImplicitDenies);
431+
request, true, results, actionImplicitDenies);
432432
});
433433
}
434434

lib/api/apiUtils/authorization/prepareRequestContexts.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ function prepareRequestContexts(apiMethod, request, sourceBucket,
7575
// In the API, we then ignore these authorization results, and we can use
7676
// any information returned, e.g., the quota.
7777
const requestContextMultiObjectDelete = generateRequestContext('objectDelete');
78-
requestContexts.push(requestContextMultiObjectDelete);
78+
requestContexts.push(requestContextMultiObjectDelete);
7979
} else if (apiMethodAfterVersionCheck === 'objectCopy'
8080
|| apiMethodAfterVersionCheck === 'objectPutCopyPart') {
8181
const objectGetAction = sourceVersionId ? 'objectGetVersion' :
82-
'objectGet';
82+
'objectGet';
8383
const reqQuery = Object.assign({}, request.query,
8484
{ versionId: sourceVersionId });
8585
const getRequestContext = new RequestContext(request.headers,
@@ -107,7 +107,7 @@ function prepareRequestContexts(apiMethod, request, sourceBucket,
107107
|| apiMethodAfterVersionCheck === 'objectGetVersion') {
108108
const objectGetTaggingAction = (request.query &&
109109
request.query.versionId) ? 'objectGetTaggingVersion' :
110-
'objectGetTagging';
110+
'objectGetTagging';
111111
if (request.headers['x-amz-version-id']) {
112112
const objectGetVersionAction = 'objectGetVersion';
113113
const getVersionResourceVersion =
@@ -212,7 +212,7 @@ function prepareRequestContexts(apiMethod, request, sourceBucket,
212212
} else if (apiMethodAfterVersionCheck === 'initiateMultipartUpload' ||
213213
apiMethodAfterVersionCheck === 'objectPutPart' ||
214214
apiMethodAfterVersionCheck === 'completeMultipartUpload'
215-
) {
215+
) {
216216
if (request.headers['x-scal-s3-version-id'] ||
217217
request.headers['x-scal-s3-version-id'] === '') {
218218
const putVersionRequestContext =

lib/api/apiUtils/bucket/bucketCors.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ const _validator = {
9393
validateNumberRules(length) {
9494
if (length > 100) {
9595
return errorInstances.InvalidRequest
96-
.customizeDescription(customizedErrs.numberRules);
96+
.customizeDescription(customizedErrs.numberRules);
9797
}
9898
return true;
9999
},
@@ -323,20 +323,20 @@ function parseCorsXml(xml, log, cb) {
323323
function convertToXml(arrayRules) {
324324
const xml = [];
325325
xml.push('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>',
326-
'<CORSConfiguration>');
326+
'<CORSConfiguration>');
327327
arrayRules.forEach(rule => {
328328
xml.push('<CORSRule>');
329329
['allowedMethods', 'allowedOrigins', 'allowedHeaders', 'exposeHeaders']
330-
.forEach(key => {
331-
if (rule[key]) {
332-
const element = key.charAt(0).toUpperCase() +
330+
.forEach(key => {
331+
if (rule[key]) {
332+
const element = key.charAt(0).toUpperCase() +
333333
key.slice(1, -1);
334-
rule[key].forEach(value => {
335-
xml.push(`<${element}>${escapeForXml(value)}` +
334+
rule[key].forEach(value => {
335+
xml.push(`<${element}>${escapeForXml(value)}` +
336336
`</${element}>`);
337-
});
338-
}
339-
});
337+
});
338+
}
339+
});
340340
if (rule.id) {
341341
xml.push(`<ID>${escapeForXml(rule.id)}</ID>`);
342342
}

lib/api/apiUtils/bucket/bucketCreation.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,10 @@ function createBucket(authInfo, bucketName, headers,
255255
// and no SSE settings were specified during bucket creation.
256256
// Bucket-specific SSE headers override the default encryption.
257257
const sseConfig = config.globalEncryptionEnabled && !bucketSseConfig.algorithm
258-
? {
259-
algorithm: 'AES256',
260-
mandatory: true,
261-
} : bucketSseConfig;
258+
? {
259+
algorithm: 'AES256',
260+
mandatory: true,
261+
} : bucketSseConfig;
262262

263263
return bucketLevelServerSideEncryption(
264264
bucket, sseConfig, log,
@@ -271,7 +271,7 @@ function createBucket(authInfo, bucketName, headers,
271271
'new bucket without flags; adding transient label');
272272
newBucketMD.addTransientFlag();
273273
return freshStartCreateBucket(newBucketMD, canonicalID,
274-
log, cb);
274+
log, cb);
275275
});
276276
}
277277
if (existingBucketMD.hasTransientFlag() ||

lib/api/apiUtils/bucket/bucketShield.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ function bucketShield(bucket, requestType) {
2525
invisiblyDelete(bucket.getName(), bucket.getOwner());
2626
return true;
2727
}
28-
// If request is initiateMultipartUpload (requestType objectPut),
29-
// objectPut, bucketPutACL or bucketDelete, proceed with request.
30-
// Otherwise return an error to the client
28+
// If request is initiateMultipartUpload (requestType objectPut),
29+
// objectPut, bucketPutACL or bucketDelete, proceed with request.
30+
// Otherwise return an error to the client
3131
if ((bucket.hasDeletedFlag() || bucket.hasTransientFlag()) &&
3232
(requestType !== 'objectPut' &&
3333
requestType !== 'initiateMultipartUpload' &&

0 commit comments

Comments
 (0)