This repository has been archived by the owner on May 27, 2020. It is now read-only.
forked from scality/cloudserver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconstants.js
89 lines (83 loc) · 3.68 KB
/
constants.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import crypto from 'crypto';
export default {
/*
* Splitter is used to build the object name for the overview of a
* multipart upload and to build the object names for each part of a
* multipart upload. These objects with large names are then stored in
* metadata in a "shadow bucket" to a real bucket. The shadow bucket
* contains all ongoing multipart uploads. We include in the object
* name some of the info we might need to pull about an open multipart
* upload or about an individual part with each piece of info separated
* by the splitter. We can then extract each piece of info by splitting
* the object name string with this splitter.
* For instance, assuming a splitter of '...!*!',
* the name of the upload overview would be:
* overview...!*!objectKey...!*!uploadId
* For instance, the name of a part would be:
* uploadId...!*!partNumber
*
* The sequence of characters used in the splitter should not occur
* elsewhere in the pieces of info to avoid splitting where not
* intended.
*
* Splitter is also used in adding bucketnames to the
* namespacerusersbucket. The object names added to the
* namespaceusersbucket are of the form:
* canonicalID...!*!bucketname
*/
splitter: '..|..',
// BACKWARD: This line will be removed when removing backward compatibility
oldSplitter: 'splitterfornow',
usersBucket: 'users..bucket',
oldUsersBucket: 'namespaceusersbucket',
// MPU Bucket Prefix is used to create the name of the shadow
// bucket used for multipart uploads. There is one shadow mpu
// bucket per bucket and its name is the mpuBucketPrefix followed
// by the name of the final destination bucket for the object
// once the multipart upload is complete.
mpuBucketPrefix: 'mpuShadowBucket',
// PublicId is used as the canonicalID for a request that contains
// no authentication information. Requestor can access
// only public resources
publicId: 'http://acs.amazonaws.com/groups/global/AllUsers',
// All Authenticated Users is an ACL group.
allAuthedUsersId: 'http://acs.amazonaws.com/groups/' +
'global/AuthenticatedUsers',
// LogId is used for the AWS logger to write the logs
// to the destination bucket. This style of logging is
// to be implemented later but the logId is used in the
// ACLs.
logId: 'http://acs.amazonaws.com/groups/s3/LogDelivery',
emptyFileMd5: 'd41d8cd98f00b204e9800998ecf8427e',
// Number of sub-directories for file backend
folderHash: 3511, // Prime number
// AWS only returns 1000 on a listing
// http://docs.aws.amazon.com/AmazonS3/latest/API/
// RESTBucketGET.html#RESTBucketGET-requests
listingHardLimit: 1000,
// AWS sets a minimum size limit for parts except for the last part.
// http://docs.aws.amazon.com/AmazonS3/latest/API/mpUploadComplete.html
minimumAllowedPartSize: 5242880,
// hex digest of sha256 hash of empty string:
emptyStringHash: crypto.createHash('sha256')
.update('', 'binary').digest('hex'),
// Queries supported by AWS that we do not currently support.
unsupportedQueries: {
'accelerate': true,
'analytics': true,
'inventory': true,
'lifecycle': true,
'list-type': true,
'logging': true,
'metrics': true,
'notification': true,
'policy': true,
'replication': true,
'requestPayment': true,
'restore': true,
'tagging': true,
'torrent': true,
},
// user metadata header to set object locationConstraint
objectLocationConstraintHeader: 'x-amz-meta-scal-location-constraint',
};