@contember/engine-s3-plugin 1.4.0-rc.8 → 2.0.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/development/index.cjs +30 -0
- package/dist/development/index.cjs.map +1 -0
- package/dist/development/index.js +31 -0
- package/dist/development/index.js.map +1 -0
- package/dist/development/src/Config.cjs +73 -0
- package/dist/development/src/Config.cjs.map +1 -0
- package/dist/development/src/Config.js +56 -0
- package/dist/development/src/Config.js.map +1 -0
- package/dist/development/src/S3ConfigProcessor.cjs +60 -0
- package/dist/development/src/S3ConfigProcessor.cjs.map +1 -0
- package/dist/development/src/S3ConfigProcessor.js +43 -0
- package/dist/development/src/S3ConfigProcessor.js.map +1 -0
- package/dist/development/src/S3ObjectAuthorizator.cjs +46 -0
- package/dist/development/src/S3ObjectAuthorizator.cjs.map +1 -0
- package/dist/development/src/S3ObjectAuthorizator.js +46 -0
- package/dist/development/src/S3ObjectAuthorizator.js.map +1 -0
- package/dist/development/src/S3SchemaContributor.cjs +97 -0
- package/dist/development/src/S3SchemaContributor.cjs.map +1 -0
- package/dist/development/src/S3SchemaContributor.js +97 -0
- package/dist/development/src/S3SchemaContributor.js.map +1 -0
- package/dist/development/src/S3SchemaTypes.cjs +71 -0
- package/dist/development/src/S3SchemaTypes.cjs.map +1 -0
- package/dist/development/src/S3SchemaTypes.js +71 -0
- package/dist/development/src/S3SchemaTypes.js.map +1 -0
- package/dist/development/src/S3Service.cjs +105 -0
- package/dist/development/src/S3Service.cjs.map +1 -0
- package/dist/development/src/S3Service.js +105 -0
- package/dist/development/src/S3Service.js.map +1 -0
- package/dist/development/src/S3Signer.cjs +84 -0
- package/dist/development/src/S3Signer.cjs.map +1 -0
- package/dist/development/src/S3Signer.js +84 -0
- package/dist/development/src/S3Signer.js.map +1 -0
- package/dist/production/index.cjs +30 -0
- package/dist/production/index.cjs.map +1 -0
- package/dist/production/index.js +31 -0
- package/dist/production/index.js.map +1 -0
- package/dist/production/src/Config.cjs +73 -0
- package/dist/production/src/Config.cjs.map +1 -0
- package/dist/production/src/Config.js +56 -0
- package/dist/production/src/Config.js.map +1 -0
- package/dist/production/src/S3ConfigProcessor.cjs +60 -0
- package/dist/production/src/S3ConfigProcessor.cjs.map +1 -0
- package/dist/production/src/S3ConfigProcessor.js +43 -0
- package/dist/production/src/S3ConfigProcessor.js.map +1 -0
- package/dist/production/src/S3ObjectAuthorizator.cjs +46 -0
- package/dist/production/src/S3ObjectAuthorizator.cjs.map +1 -0
- package/dist/production/src/S3ObjectAuthorizator.js +46 -0
- package/dist/production/src/S3ObjectAuthorizator.js.map +1 -0
- package/dist/production/src/S3SchemaContributor.cjs +97 -0
- package/dist/production/src/S3SchemaContributor.cjs.map +1 -0
- package/dist/production/src/S3SchemaContributor.js +97 -0
- package/dist/production/src/S3SchemaContributor.js.map +1 -0
- package/dist/production/src/S3SchemaTypes.cjs +71 -0
- package/dist/production/src/S3SchemaTypes.cjs.map +1 -0
- package/dist/production/src/S3SchemaTypes.js +71 -0
- package/dist/production/src/S3SchemaTypes.js.map +1 -0
- package/dist/production/src/S3Service.cjs +105 -0
- package/dist/production/src/S3Service.cjs.map +1 -0
- package/dist/production/src/S3Service.js +105 -0
- package/dist/production/src/S3Service.js.map +1 -0
- package/dist/production/src/S3Signer.cjs +84 -0
- package/dist/production/src/S3Signer.cjs.map +1 -0
- package/dist/production/src/S3Signer.js +84 -0
- package/dist/production/src/S3Signer.js.map +1 -0
- package/dist/tests/tsconfig.tsbuildinfo +1 -1
- package/dist/{src → types}/Config.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/package.json +24 -12
- package/src/tsconfig.json +1 -1
- package/tests/cases/signRequest.test.ts +1 -1
- package/vitest.config.ts +3 -0
- package/dist/src/Config.js +0 -75
- package/dist/src/Config.js.map +0 -1
- package/dist/src/S3ConfigProcessor.js +0 -64
- package/dist/src/S3ConfigProcessor.js.map +0 -1
- package/dist/src/S3ObjectAuthorizator.js +0 -48
- package/dist/src/S3ObjectAuthorizator.js.map +0 -1
- package/dist/src/S3SchemaContributor.js +0 -122
- package/dist/src/S3SchemaContributor.js.map +0 -1
- package/dist/src/S3SchemaTypes.js +0 -65
- package/dist/src/S3SchemaTypes.js.map +0 -1
- package/dist/src/S3Service.js +0 -101
- package/dist/src/S3Service.js.map +0 -1
- package/dist/src/S3Signer.js +0 -92
- package/dist/src/S3Signer.js.map +0 -1
- package/dist/src/index.js +0 -39
- package/dist/src/index.js.map +0 -1
- package/dist/src/tsconfig.tsbuildinfo +0 -1
- package/dist/tests/cases/authorizator.test.js +0 -21
- package/dist/tests/cases/authorizator.test.js.map +0 -1
- package/dist/tests/cases/signRequest.test.js +0 -44
- package/dist/tests/cases/signRequest.test.js.map +0 -1
- package/vite.config.js +0 -3
- /package/dist/{src → types}/Config.d.ts +0 -0
- /package/dist/{src → types}/S3ConfigProcessor.d.ts +0 -0
- /package/dist/{src → types}/S3ConfigProcessor.d.ts.map +0 -0
- /package/dist/{src → types}/S3ObjectAuthorizator.d.ts +0 -0
- /package/dist/{src → types}/S3ObjectAuthorizator.d.ts.map +0 -0
- /package/dist/{src → types}/S3SchemaContributor.d.ts +0 -0
- /package/dist/{src → types}/S3SchemaContributor.d.ts.map +0 -0
- /package/dist/{src → types}/S3SchemaTypes.d.ts +0 -0
- /package/dist/{src → types}/S3SchemaTypes.d.ts.map +0 -0
- /package/dist/{src → types}/S3Service.d.ts +0 -0
- /package/dist/{src → types}/S3Service.d.ts.map +0 -0
- /package/dist/{src → types}/S3Signer.d.ts +0 -0
- /package/dist/{src → types}/S3Signer.d.ts.map +0 -0
- /package/dist/{src → types}/index.d.ts +0 -0
- /package/dist/{src → types}/index.d.ts.map +0 -0
package/package.json
CHANGED
|
@@ -1,20 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contember/engine-s3-plugin",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-alpha.10",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
|
-
"main": "dist/
|
|
6
|
-
"typings": "dist/
|
|
5
|
+
"main": "./dist/production/index.js",
|
|
6
|
+
"typings": "./dist/types/index.d.ts",
|
|
7
7
|
"exports": {
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
".": {
|
|
9
|
+
"import": {
|
|
10
|
+
"types": "./dist/types/index.d.ts",
|
|
11
|
+
"development": "./dist/development/index.js",
|
|
12
|
+
"production": "./dist/production/index.js",
|
|
13
|
+
"typescript": "./src/index.ts",
|
|
14
|
+
"default": "./dist/production/index.js"
|
|
15
|
+
},
|
|
16
|
+
"require": {
|
|
17
|
+
"types": "./dist/types/index.d.ts",
|
|
18
|
+
"development": "./dist/development/index.cjs",
|
|
19
|
+
"production": "./dist/production/index.cjs",
|
|
20
|
+
"typescript": "./src/index.ts",
|
|
21
|
+
"default": "./dist/production/index.cjs"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
13
24
|
},
|
|
14
25
|
"dependencies": {
|
|
15
|
-
"@contember/engine-plugins": "
|
|
16
|
-
"@contember/graphql-utils": "
|
|
17
|
-
"@contember/typesafe": "
|
|
26
|
+
"@contember/engine-plugins": "2.0.0-alpha.10",
|
|
27
|
+
"@contember/graphql-utils": "2.0.0-alpha.10",
|
|
28
|
+
"@contember/typesafe": "2.0.0-alpha.10",
|
|
18
29
|
"mime-types": "^2.1.35",
|
|
19
30
|
"picomatch": "^3.0.1",
|
|
20
31
|
"qs": "^6.11.2",
|
|
@@ -29,5 +40,6 @@
|
|
|
29
40
|
"peerDependencies": {
|
|
30
41
|
"graphql": ">= 14.6.0",
|
|
31
42
|
"pg": "^8.9.0"
|
|
32
|
-
}
|
|
43
|
+
},
|
|
44
|
+
"type": "module"
|
|
33
45
|
}
|
package/src/tsconfig.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { test, assert, expect } from 'vitest'
|
|
2
2
|
import { S3ObjectAuthorizator, S3Service } from '../../src'
|
|
3
3
|
|
|
4
|
-
const mocked = new Date('2021-07-
|
|
4
|
+
const mocked = new Date('2021-07-02T17:22Z')
|
|
5
5
|
const constantUuid = '9fce3907-ff2b-45bb-b4ce-eff5527dd315'
|
|
6
6
|
const createS3Service = (bucket: string, prefix = '') => new S3Service(
|
|
7
7
|
{
|
package/vitest.config.ts
ADDED
package/dist/src/Config.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.resolveS3PublicBaseUrl = exports.resolveS3Endpoint = exports.resolveS3Config = exports.s3ConfigSchema = exports.S3Providers = void 0;
|
|
27
|
-
const Typesafe = __importStar(require("@contember/typesafe"));
|
|
28
|
-
var S3Providers;
|
|
29
|
-
(function (S3Providers) {
|
|
30
|
-
S3Providers["aws"] = "aws";
|
|
31
|
-
S3Providers["minio"] = "minio";
|
|
32
|
-
S3Providers["ceph"] = "ceph";
|
|
33
|
-
S3Providers["localstack"] = "localstack";
|
|
34
|
-
S3Providers["cloudserver"] = "cloudserver";
|
|
35
|
-
})(S3Providers || (exports.S3Providers = S3Providers = {}));
|
|
36
|
-
exports.s3ConfigSchema = Typesafe.intersection(Typesafe.object({
|
|
37
|
-
bucket: Typesafe.string,
|
|
38
|
-
region: Typesafe.string,
|
|
39
|
-
prefix: Typesafe.string,
|
|
40
|
-
credentials: Typesafe.object({
|
|
41
|
-
key: Typesafe.string,
|
|
42
|
-
secret: Typesafe.string,
|
|
43
|
-
}),
|
|
44
|
-
}), Typesafe.partial({
|
|
45
|
-
endpoint: Typesafe.string,
|
|
46
|
-
cdnEndpoint: Typesafe.string,
|
|
47
|
-
provider: Typesafe.enumeration(S3Providers.aws, S3Providers.minio, S3Providers.ceph, S3Providers.localstack, S3Providers.cloudserver),
|
|
48
|
-
noAcl: Typesafe.boolean,
|
|
49
|
-
}));
|
|
50
|
-
// todo
|
|
51
|
-
const serversWithoutAclSupport = [S3Providers.minio];
|
|
52
|
-
const resolveS3Config = (config) => {
|
|
53
|
-
return {
|
|
54
|
-
noAcl: !!config.provider && serversWithoutAclSupport.includes(config.provider),
|
|
55
|
-
...config,
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
exports.resolveS3Config = resolveS3Config;
|
|
59
|
-
const defaultRegion = 'eu-west-1';
|
|
60
|
-
const resolveS3Endpoint = (config) => {
|
|
61
|
-
const hasLegacyPath = !!config.endpoint || config.bucket.includes('.');
|
|
62
|
-
const endpoint = config.endpoint || `https://${hasLegacyPath ? '' : `${config.bucket}.`}s3.${config.region || defaultRegion}.amazonaws.com`;
|
|
63
|
-
const basePath = hasLegacyPath ? `/${config.bucket}` : '';
|
|
64
|
-
return { endpoint, basePath };
|
|
65
|
-
};
|
|
66
|
-
exports.resolveS3Endpoint = resolveS3Endpoint;
|
|
67
|
-
const resolveS3PublicBaseUrl = (config) => {
|
|
68
|
-
if (config.cdnEndpoint) {
|
|
69
|
-
return config.cdnEndpoint;
|
|
70
|
-
}
|
|
71
|
-
const { endpoint, basePath } = (0, exports.resolveS3Endpoint)(config);
|
|
72
|
-
return endpoint + basePath;
|
|
73
|
-
};
|
|
74
|
-
exports.resolveS3PublicBaseUrl = resolveS3PublicBaseUrl;
|
|
75
|
-
//# sourceMappingURL=Config.js.map
|
package/dist/src/Config.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Config.js","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8DAA+C;AAE/C,IAAY,WAMX;AAND,WAAY,WAAW;IACtB,0BAAW,CAAA;IACX,8BAAe,CAAA;IACf,4BAAa,CAAA;IACb,wCAAyB,CAAA;IACzB,0CAA2B,CAAA;AAC5B,CAAC,EANW,WAAW,2BAAX,WAAW,QAMtB;AAGY,QAAA,cAAc,GAAG,QAAQ,CAAC,YAAY,CAClD,QAAQ,CAAC,MAAM,CAAC;IACf,MAAM,EAAE,QAAQ,CAAC,MAAM;IACvB,MAAM,EAAE,QAAQ,CAAC,MAAM;IACvB,MAAM,EAAE,QAAQ,CAAC,MAAM;IACvB,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC;QAC5B,GAAG,EAAE,QAAQ,CAAC,MAAM;QACpB,MAAM,EAAE,QAAQ,CAAC,MAAM;KACvB,CAAC;CACF,CAAC,EACF,QAAQ,CAAC,OAAO,CAAC;IAChB,QAAQ,EAAE,QAAQ,CAAC,MAAM;IACzB,WAAW,EAAE,QAAQ,CAAC,MAAM;IAC5B,QAAQ,EAAE,QAAQ,CAAC,WAAW,CAAC,WAAW,CAAC,G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AQ,EAAE,QAAQ,EAAE,GAAG,IAAA,yBAAiB,EAAC,MAAM,CAAC,CAAA;IACxD,OAAO,QAAQ,GAAG,QAAQ,CAAA;AAC3B,CAAC,CAAA;AANY,QAAA,sBAAsB,0BAMlC"}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.S3ConfigProcessor = void 0;
|
|
27
|
-
const Config_1 = require("./Config");
|
|
28
|
-
const Typesafe = __importStar(require("@contember/typesafe"));
|
|
29
|
-
class S3ConfigProcessor {
|
|
30
|
-
getDefaultEnv() {
|
|
31
|
-
return {
|
|
32
|
-
DEFAULT_S3_ENDPOINT: '',
|
|
33
|
-
DEFAULT_S3_REGION: 'us-east-1',
|
|
34
|
-
DEFAULT_S3_PROVIDER: 'aws',
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
prepareConfigTemplate(template, { env }) {
|
|
38
|
-
return {
|
|
39
|
-
...template,
|
|
40
|
-
projectDefaults: {
|
|
41
|
-
...template.projectDefaults,
|
|
42
|
-
s3: {
|
|
43
|
-
bucket: `%?project.env.S3_BUCKET%`,
|
|
44
|
-
prefix: `%?project.env.S3_PREFIX||project.slug%`,
|
|
45
|
-
region: `%project.env.S3_REGION%`,
|
|
46
|
-
endpoint: `%project.env.S3_ENDPOINT%`,
|
|
47
|
-
cdnEndpoint: `%?project.env.S3_CDN%`,
|
|
48
|
-
provider: '%project.env.S3_PROVIDER%',
|
|
49
|
-
credentials: {
|
|
50
|
-
key: `%?project.secret.s3.key||project.env.S3_KEY%`,
|
|
51
|
-
secret: `%?project.secret.s3.secret||project.env.S3_SECRET%`,
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
getProjectConfigSchema(slug) {
|
|
58
|
-
return Typesafe.union((input, path = []) => Typesafe.valueAt(input, ['s3', 'credentials', 'key']) === undefined ? {} : Typesafe.fail(path), Typesafe.object({
|
|
59
|
-
s3: Config_1.s3ConfigSchema,
|
|
60
|
-
}));
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
exports.S3ConfigProcessor = S3ConfigProcessor;
|
|
64
|
-
//# sourceMappingURL=S3ConfigProcessor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"S3ConfigProcessor.js","sourceRoot":"","sources":["../../src/S3ConfigProcessor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,qCAAyD;AACzD,8DAA+C;AAE/C,MAAa,iBAAiB;IAC7B,aAAa;QACZ,OAAO;YACN,mBAAmB,EAAE,EAAE;YACvB,iBAAiB,EAAE,WAAW;YAC9B,mBAAmB,EAAE,KAAK;SAC1B,CAAA;IACF,CAAC;IAED,qBAAqB,CAAC,QAAwB,EAAE,EAAE,GAAG,EAAyB;QAC7E,OAAO;YACN,GAAG,QAAQ;YACX,eAAe,EAAE;gBAChB,GAAG,QAAQ,CAAC,eAAe;gBAC3B,EAAE,EAAE;oBACH,MAAM,EAAE,0BAA0B;oBAClC,MAAM,EAAE,wCAAwC;oBAChD,MAAM,EAAE,yBAAyB;oBACjC,QAAQ,EAAE,2BAA2B;oBACrC,WAAW,EAAE,uBAAuB;oBACpC,QAAQ,EAAE,2BAA2B;oBACrC,WAAW,EAAE;wBACZ,GAAG,EAAE,8CAA8C;wBACnD,MAAM,EAAE,oDAAoD;qBAC5D;iBACD;aACD;SACD,CAAA;IACF,CAAC;IAED,sBAAsB,CAAC,IAAY;QAClC,OAAO,QAAQ,CAAC,KAAK,CACpB,CAAC,KAAc,EAAE,OAAsB,EAAE,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAC5I,QAAQ,CAAC,MAAM,CAAC;YACf,EAAE,EAAE,uBAAc;SAClB,CAAC,CACF,CAAA;IACF,CAAC;CAED;AAvCD,8CAuCC"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.S3ObjectAuthorizator = void 0;
|
|
7
|
-
const picomatch_1 = __importDefault(require("picomatch"));
|
|
8
|
-
const graphql_utils_1 = require("@contember/graphql-utils");
|
|
9
|
-
class S3ObjectAuthorizator {
|
|
10
|
-
constructor(uploadRules, readRules) {
|
|
11
|
-
this.uploadRules = uploadRules;
|
|
12
|
-
this.readRules = readRules;
|
|
13
|
-
}
|
|
14
|
-
verifyReadAccess({ key }) {
|
|
15
|
-
var _a;
|
|
16
|
-
for (const rule of this.readRules) {
|
|
17
|
-
(_a = rule.matcher) !== null && _a !== void 0 ? _a : (rule.matcher = (0, picomatch_1.default)(rule.pattern));
|
|
18
|
-
if (rule.matcher(key)) {
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
throw new graphql_utils_1.ForbiddenError(`Read access forbidden for object key ${key}`);
|
|
23
|
-
}
|
|
24
|
-
verifyUploadAccess({ key, size }) {
|
|
25
|
-
var _a;
|
|
26
|
-
const matchedPatterns = [];
|
|
27
|
-
for (const rule of this.uploadRules) {
|
|
28
|
-
(_a = rule.matcher) !== null && _a !== void 0 ? _a : (rule.matcher = (0, picomatch_1.default)(rule.pattern));
|
|
29
|
-
if (rule.matcher(key)) {
|
|
30
|
-
if (!rule.maxSize || (size !== null && size <= rule.maxSize)) {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
matchedPatterns.push(rule);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
if (matchedPatterns.length > 0) {
|
|
37
|
-
if (size === null) {
|
|
38
|
-
throw new graphql_utils_1.ForbiddenError('File size must be provided');
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
throw new graphql_utils_1.ForbiddenError('Uploaded file is too large');
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
throw new graphql_utils_1.ForbiddenError(`Upload access forbidden for object key ${key}`);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
exports.S3ObjectAuthorizator = S3ObjectAuthorizator;
|
|
48
|
-
//# sourceMappingURL=S3ObjectAuthorizator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"S3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8BAAc,CAAC,4BAA4B,CAAC,CAAA;aACtD;iBAAM;gBACN,MAAM,IAAI,8BAAc,CAAC,4BAA4B,CAAC,CAAA;aACtD;SACD;QAED,MAAM,IAAI,8BAAc,CAAC,0CAA0C,GAAG,EAAE,CAAC,CAAA;IAC1E,CAAC;CACD;AAhDD,oDAgDC"}
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.S3SchemaContributor = void 0;
|
|
27
|
-
const graphql_1 = require("graphql");
|
|
28
|
-
const Config_1 = require("./Config");
|
|
29
|
-
const types = __importStar(require("./S3SchemaTypes"));
|
|
30
|
-
const S3SchemaTypes_1 = require("./S3SchemaTypes");
|
|
31
|
-
const S3ObjectAuthorizator_1 = require("./S3ObjectAuthorizator");
|
|
32
|
-
class S3SchemaContributor {
|
|
33
|
-
constructor(s3Config, s3Factory, providers) {
|
|
34
|
-
this.s3Config = s3Config;
|
|
35
|
-
this.s3Factory = s3Factory;
|
|
36
|
-
this.providers = providers;
|
|
37
|
-
}
|
|
38
|
-
createSchema(context) {
|
|
39
|
-
if (!this.s3Config) {
|
|
40
|
-
return undefined;
|
|
41
|
-
}
|
|
42
|
-
const rules = context.identity.projectRoles.flatMap(it => { var _a; return Object.entries(((_a = context.schema.acl.roles[it]) === null || _a === void 0 ? void 0 : _a.s3) || {}); });
|
|
43
|
-
const uploadRules = rules.filter(([, it]) => it.upload).map(([it, val]) => ({
|
|
44
|
-
pattern: it,
|
|
45
|
-
...(typeof val.upload !== 'boolean' ? val.upload : {}),
|
|
46
|
-
}));
|
|
47
|
-
const readRules = rules.filter(([, it]) => it.read).map(([it]) => ({
|
|
48
|
-
pattern: it,
|
|
49
|
-
}));
|
|
50
|
-
if (uploadRules.length === 0 && readRules.length == 0) {
|
|
51
|
-
return undefined;
|
|
52
|
-
}
|
|
53
|
-
const s3Config = (0, Config_1.resolveS3Config)(this.s3Config);
|
|
54
|
-
const authorizator = new S3ObjectAuthorizator_1.S3ObjectAuthorizator(uploadRules, readRules);
|
|
55
|
-
const s3 = this.s3Factory.create(s3Config, this.providers, authorizator);
|
|
56
|
-
const uploadMutation = this.createUploadMutation(s3);
|
|
57
|
-
const readMutation = this.createReadMutation(s3);
|
|
58
|
-
const mutation = {
|
|
59
|
-
generateUploadUrl: uploadMutation,
|
|
60
|
-
generateReadUrl: readMutation,
|
|
61
|
-
};
|
|
62
|
-
return {
|
|
63
|
-
mutation: new graphql_1.GraphQLObjectType({
|
|
64
|
-
name: 'Mutation',
|
|
65
|
-
fields: () => mutation,
|
|
66
|
-
}),
|
|
67
|
-
query: new graphql_1.GraphQLObjectType({
|
|
68
|
-
name: 'Query',
|
|
69
|
-
fields: () => ({
|
|
70
|
-
s3DummyQuery: {
|
|
71
|
-
type: graphql_1.GraphQLString,
|
|
72
|
-
},
|
|
73
|
-
}),
|
|
74
|
-
}),
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
createReadMutation(s3) {
|
|
78
|
-
return {
|
|
79
|
-
type: new graphql_1.GraphQLNonNull(S3SchemaTypes_1.S3SignedRead),
|
|
80
|
-
args: {
|
|
81
|
-
objectKey: {
|
|
82
|
-
type: new graphql_1.GraphQLNonNull(graphql_1.GraphQLString),
|
|
83
|
-
},
|
|
84
|
-
expiration: {
|
|
85
|
-
type: graphql_1.GraphQLInt,
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
resolve: async (parent, args) => {
|
|
89
|
-
var _a;
|
|
90
|
-
return s3.getSignedReadUrl({ objectKey: args.objectKey, expiration: (_a = args.expiration) !== null && _a !== void 0 ? _a : null });
|
|
91
|
-
},
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
createUploadMutation(s3) {
|
|
95
|
-
return {
|
|
96
|
-
type: new graphql_1.GraphQLNonNull(S3SchemaTypes_1.S3SignedUpload),
|
|
97
|
-
args: {
|
|
98
|
-
input: { type: types.S3GenerateSignedUploadInput },
|
|
99
|
-
contentType: { type: graphql_1.GraphQLString, deprecationReason: 'Use input.contentType' },
|
|
100
|
-
expiration: { type: graphql_1.GraphQLInt, deprecationReason: 'Use input.expiration' },
|
|
101
|
-
prefix: { type: graphql_1.GraphQLString, deprecationReason: 'Use input.prefix' },
|
|
102
|
-
acl: { type: types.S3Acl, deprecationReason: 'Use input.acl' },
|
|
103
|
-
},
|
|
104
|
-
resolve: async (parent, args) => {
|
|
105
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
106
|
-
return s3.getSignedUploadUrl({
|
|
107
|
-
acl: (_c = (_b = (_a = args.input) === null || _a === void 0 ? void 0 : _a.acl) !== null && _b !== void 0 ? _b : args.acl) !== null && _c !== void 0 ? _c : null,
|
|
108
|
-
contentDisposition: (_e = (_d = args.input) === null || _d === void 0 ? void 0 : _d.contentDisposition) !== null && _e !== void 0 ? _e : null,
|
|
109
|
-
contentType: (_h = (_g = (_f = args.input) === null || _f === void 0 ? void 0 : _f.contentType) !== null && _g !== void 0 ? _g : args.contentType) !== null && _h !== void 0 ? _h : null,
|
|
110
|
-
expiration: (_l = (_k = (_j = args.input) === null || _j === void 0 ? void 0 : _j.expiration) !== null && _k !== void 0 ? _k : args.expiration) !== null && _l !== void 0 ? _l : null,
|
|
111
|
-
extension: (_o = (_m = args.input) === null || _m === void 0 ? void 0 : _m.extension) !== null && _o !== void 0 ? _o : null,
|
|
112
|
-
fileName: (_q = (_p = args.input) === null || _p === void 0 ? void 0 : _p.fileName) !== null && _q !== void 0 ? _q : null,
|
|
113
|
-
prefix: (_t = (_s = (_r = args.input) === null || _r === void 0 ? void 0 : _r.prefix) !== null && _s !== void 0 ? _s : args.prefix) !== null && _t !== void 0 ? _t : null,
|
|
114
|
-
suffix: (_v = (_u = args.input) === null || _u === void 0 ? void 0 : _u.suffix) !== null && _v !== void 0 ? _v : null,
|
|
115
|
-
size: (_x = (_w = args.input) === null || _w === void 0 ? void 0 : _w.size) !== null && _x !== void 0 ? _x : null,
|
|
116
|
-
});
|
|
117
|
-
},
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
exports.S3SchemaContributor = S3SchemaContributor;
|
|
122
|
-
//# sourceMappingURL=S3SchemaContributor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"S3SchemaContributor.js","sourceRoot":"","sources":["../../src/S3SchemaContributor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAQgB;AAEhB,qCAAoD;AAEpD,uDAAwC;AACxC,mDAAkG;AAClG,iEAA6D;AAqB7D,MA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Q,mCAAI,IAAI;oBACtC,MAAM,EAAE,MAAA,MAAA,MAAA,IAAI,CAAC,KAAK,0CAAE,MAAM,mCAAI,IAAI,CAAC,MAAM,mCAAI,IAAI;oBACjD,MAAM,EAAE,MAAA,MAAA,IAAI,CAAC,KAAK,0CAAE,MAAM,mCAAI,IAAI;oBAClC,IAAI,EAAE,MAAA,MAAA,IAAI,CAAC,KAAK,0CAAE,IAAI,mCAAI,IAAI;iBAC9B,CAAC,CAAA;YACH,CAAC;SACD,CAAA;IACF,CAAC;CACD;AAlGD,kDAkGC"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.S3GenerateSignedUploadInput = exports.S3Acl = exports.S3SignedUpload = exports.S3SignedRead = exports.S3ContentDisposition = exports.S3Header = void 0;
|
|
4
|
-
const graphql_1 = require("graphql");
|
|
5
|
-
exports.S3Header = new graphql_1.GraphQLObjectType({
|
|
6
|
-
name: 'S3Header',
|
|
7
|
-
fields: {
|
|
8
|
-
key: { type: new graphql_1.GraphQLNonNull(graphql_1.GraphQLString) },
|
|
9
|
-
value: { type: new graphql_1.GraphQLNonNull(graphql_1.GraphQLString) },
|
|
10
|
-
},
|
|
11
|
-
});
|
|
12
|
-
exports.S3ContentDisposition = new graphql_1.GraphQLEnumType({
|
|
13
|
-
name: 'S33ContentDisposition', values: {
|
|
14
|
-
ATTACHMENT: {},
|
|
15
|
-
INLINE: {},
|
|
16
|
-
},
|
|
17
|
-
});
|
|
18
|
-
exports.S3SignedRead = new graphql_1.GraphQLObjectType({
|
|
19
|
-
name: 'S3SignedRead',
|
|
20
|
-
fields: {
|
|
21
|
-
url: { type: new graphql_1.GraphQLNonNull(graphql_1.GraphQLString) },
|
|
22
|
-
headers: {
|
|
23
|
-
type: new graphql_1.GraphQLNonNull(new graphql_1.GraphQLList(new graphql_1.GraphQLNonNull(exports.S3Header))),
|
|
24
|
-
},
|
|
25
|
-
method: { type: new graphql_1.GraphQLNonNull(graphql_1.GraphQLString) },
|
|
26
|
-
objectKey: { type: new graphql_1.GraphQLNonNull(graphql_1.GraphQLString) },
|
|
27
|
-
bucket: { type: new graphql_1.GraphQLNonNull(graphql_1.GraphQLString) },
|
|
28
|
-
},
|
|
29
|
-
});
|
|
30
|
-
exports.S3SignedUpload = new graphql_1.GraphQLObjectType({
|
|
31
|
-
name: 'S3SignedUpload',
|
|
32
|
-
fields: {
|
|
33
|
-
url: { type: new graphql_1.GraphQLNonNull(graphql_1.GraphQLString) },
|
|
34
|
-
headers: {
|
|
35
|
-
type: new graphql_1.GraphQLNonNull(new graphql_1.GraphQLList(new graphql_1.GraphQLNonNull(exports.S3Header))),
|
|
36
|
-
},
|
|
37
|
-
method: { type: new graphql_1.GraphQLNonNull(graphql_1.GraphQLString) },
|
|
38
|
-
objectKey: { type: new graphql_1.GraphQLNonNull(graphql_1.GraphQLString) },
|
|
39
|
-
bucket: { type: new graphql_1.GraphQLNonNull(graphql_1.GraphQLString) },
|
|
40
|
-
publicUrl: { type: new graphql_1.GraphQLNonNull(graphql_1.GraphQLString) },
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
exports.S3Acl = new graphql_1.GraphQLEnumType({
|
|
44
|
-
name: 'S3Acl',
|
|
45
|
-
values: {
|
|
46
|
-
PUBLIC_READ: {},
|
|
47
|
-
PRIVATE: {},
|
|
48
|
-
NONE: {},
|
|
49
|
-
},
|
|
50
|
-
});
|
|
51
|
-
exports.S3GenerateSignedUploadInput = new graphql_1.GraphQLInputObjectType({
|
|
52
|
-
name: 'S3GenerateSignedUploadInput',
|
|
53
|
-
fields: {
|
|
54
|
-
contentType: { type: graphql_1.GraphQLString },
|
|
55
|
-
extension: { type: graphql_1.GraphQLString, description: 'If not provided, extension is detected from a content-type.' },
|
|
56
|
-
expiration: { type: graphql_1.GraphQLInt, description: 'Signed URL expiration.' },
|
|
57
|
-
size: { type: graphql_1.GraphQLInt, description: 'Uploaded file size. Required when you enable ACL size limits.' },
|
|
58
|
-
prefix: { type: graphql_1.GraphQLString, description: 'Can be used as a "directory".' },
|
|
59
|
-
suffix: { type: graphql_1.GraphQLString, description: 'Suffix after generated id and before the extension.' },
|
|
60
|
-
fileName: { type: graphql_1.GraphQLString, description: 'This only affects Content-disposition header. Does not affect actual object key.' },
|
|
61
|
-
contentDisposition: { type: exports.S3ContentDisposition },
|
|
62
|
-
acl: { type: exports.S3Acl, description: 'If not supported by S3 provider, an error is thrown.' },
|
|
63
|
-
},
|
|
64
|
-
});
|
|
65
|
-
//# sourceMappingURL=S3SchemaTypes.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"S3SchemaTypes.js","sourceRoot":"","sources":["../../src/S3SchemaTypes.ts"],"names":[],"mappings":";;;AAAA,qCAQgB;AAEH,QAAA,QAAQ,GAAG,IAAI,2BAAiB,CAAC;IAC7C,IAAI,EAAE,UAAU;IAChB,MAAM,EAAE;QACP,GAAG,EAAE,EAAE,IAAI,EAAE,IAAI,wBAAc,CAAC,uBAAa,CAAC,EAAE;QAChD,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,wBAAc,CAAC,uBAAa,CAAC,EAAE;KAClD;CACD,CAAC,CAAA;AAEW,QAAA,oBAAoB,GAAG,IAAI,yBAAe,CAAC;IACvD,IAAI,EAAE,uBAAuB,EAAE,MAAM,EAAE;QACtC,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,EAAE;KACV;CACD,CAAC,CAAA;AAGW,QAAA,YAAY,GAAG,IAAI,2BAAiB,CAAC;IACjD,IAAI,EAAE,cAAc;IACpB,MAAM,EAAE;QACP,GAAG,EAAE,EAAE,IAAI,EAAE,IAAI,wBAAc,CAAC,uBAAa,CAAC,EAAE;QAChD,OAAO,EAAE;YACR,IAAI,EAAE,IAAI,wBAAc,CAAC,IAAI,qBAAW,CAAC,IAAI,wBAAc,CAAC,gBAAQ,CAAC,CAAC,CAAC;SACvE;QACD,MAAM,EA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C9G,UAAU,EAAE,EAAE,IAAI,EAAE,oBAAU,EAAE,WAAW,EAAE,wBAAwB,EAAE;QACvE,IAAI,EAAE,EAAE,IAAI,EAAE,oBAAU,EAAE,WAAW,EAAE,+DAA+D,EAAE;QACxG,MAAM,EAAE,EAAE,IAAI,EAAE,uBAAa,EAAE,WAAW,EAAE,+BAA+B,EAAE;QAC7E,MAAM,EAAE,EAAE,IAAI,EAAE,uBAAa,EAAE,WAAW,EAAE,qDAAqD,EAAE;QACnG,QAAQ,EAAE,EAAE,IAAI,EAAE,uBAAa,EAAE,WAAW,EAAE,kFAAkF,EAAE;QAClI,kBAAkB,EAAE,EAAE,IAAI,EAAE,4BAAoB,EAAE;QAClD,GAAG,EAAE,EAAE,IAAI,EAAE,aAAK,EAAE,WAAW,EAAE,sDAAsD,EAAE;KACzF;CACD,CAAC,CAAA"}
|
package/dist/src/S3Service.js
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.S3ServiceFactory = exports.S3Service = void 0;
|
|
4
|
-
const mime_types_1 = require("mime-types");
|
|
5
|
-
const Config_1 = require("./Config");
|
|
6
|
-
const graphql_utils_1 = require("@contember/graphql-utils");
|
|
7
|
-
const S3Signer_1 = require("./S3Signer");
|
|
8
|
-
class S3Service {
|
|
9
|
-
constructor(config, providers, authorizator) {
|
|
10
|
-
this.config = config;
|
|
11
|
-
this.providers = providers;
|
|
12
|
-
this.authorizator = authorizator;
|
|
13
|
-
this.publicBaseUrl = (0, Config_1.resolveS3PublicBaseUrl)(config);
|
|
14
|
-
this.signer = new S3Signer_1.S3Signer(config, providers);
|
|
15
|
-
}
|
|
16
|
-
getSignedUploadUrl({ acl, contentDisposition, contentType, expiration, prefix, suffix, fileName, extension, size }) {
|
|
17
|
-
var _a;
|
|
18
|
-
const ext = extension !== null && extension !== void 0 ? extension : ((contentType ? (0, mime_types_1.extension)(contentType) : null) || 'bin');
|
|
19
|
-
const id = this.providers.uuid();
|
|
20
|
-
const localObjectKey = (prefix ? prefix + '/' : '') + `${id}${suffix !== null && suffix !== void 0 ? suffix : ''}.${ext}`;
|
|
21
|
-
this.authorizator.verifyUploadAccess({ key: localObjectKey, size });
|
|
22
|
-
const objectKey = (this.config.prefix ? this.config.prefix + '/' : '') + localObjectKey;
|
|
23
|
-
const bucket = this.config.bucket;
|
|
24
|
-
if (acl && this.config.noAcl) {
|
|
25
|
-
throw new graphql_utils_1.UserInputError('ACL is not supported');
|
|
26
|
-
}
|
|
27
|
-
const headers = {
|
|
28
|
-
'Cache-Control': 'immutable',
|
|
29
|
-
};
|
|
30
|
-
if (contentType) {
|
|
31
|
-
headers['Content-Type'] = contentType;
|
|
32
|
-
}
|
|
33
|
-
if (!this.config.noAcl && acl !== 'NONE') {
|
|
34
|
-
const mapping = { PUBLIC_READ: 'public-read', PRIVATE: 'private' };
|
|
35
|
-
headers['x-amz-acl'] = mapping[acl !== null && acl !== void 0 ? acl : 'PUBLIC_READ'];
|
|
36
|
-
}
|
|
37
|
-
if (fileName || contentDisposition) {
|
|
38
|
-
let contentDispositionHeader = (_a = contentDisposition === null || contentDisposition === void 0 ? void 0 : contentDisposition.toLowerCase()) !== null && _a !== void 0 ? _a : 'inline';
|
|
39
|
-
if (fileName) {
|
|
40
|
-
contentDispositionHeader += `; filename*=UTF-8''${encodeURIComponent(fileName)}`;
|
|
41
|
-
}
|
|
42
|
-
headers['Content-Disposition'] = contentDispositionHeader;
|
|
43
|
-
}
|
|
44
|
-
const headersToSend = Object.entries(headers).map(([key, value]) => ({ key, value }));
|
|
45
|
-
// intentionally not sending following headers
|
|
46
|
-
if (size) {
|
|
47
|
-
headers['Content-Length'] = String(size);
|
|
48
|
-
}
|
|
49
|
-
const url = this.signer.sign({
|
|
50
|
-
action: 'upload',
|
|
51
|
-
expiration: expiration !== null && expiration !== void 0 ? expiration : 3600,
|
|
52
|
-
key: objectKey,
|
|
53
|
-
headers: { ...headers },
|
|
54
|
-
});
|
|
55
|
-
const publicUrl = this.formatPublicUrl(objectKey);
|
|
56
|
-
return {
|
|
57
|
-
bucket,
|
|
58
|
-
objectKey,
|
|
59
|
-
url,
|
|
60
|
-
publicUrl,
|
|
61
|
-
headers: headersToSend,
|
|
62
|
-
method: 'PUT',
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
getSignedReadUrl({ objectKey, expiration }) {
|
|
66
|
-
const bucket = this.config.bucket;
|
|
67
|
-
const publicPrefix = this.formatPublicUrl('');
|
|
68
|
-
if (objectKey.startsWith(publicPrefix)) {
|
|
69
|
-
objectKey = objectKey.substring(publicPrefix.length);
|
|
70
|
-
}
|
|
71
|
-
if (this.config.prefix && !objectKey.startsWith(this.config.prefix)) {
|
|
72
|
-
throw new graphql_utils_1.ForbiddenError(`Given object key "${objectKey}" does not start with a project prefix "${this.config.prefix}"`);
|
|
73
|
-
}
|
|
74
|
-
const localObjectKey = this.config.prefix ? objectKey.substring(this.config.prefix.length + 1) : objectKey;
|
|
75
|
-
this.authorizator.verifyReadAccess({ key: localObjectKey });
|
|
76
|
-
const url = this.signer.sign({
|
|
77
|
-
action: 'read',
|
|
78
|
-
expiration: expiration !== null && expiration !== void 0 ? expiration : 3600,
|
|
79
|
-
key: objectKey,
|
|
80
|
-
headers: {},
|
|
81
|
-
});
|
|
82
|
-
return {
|
|
83
|
-
bucket,
|
|
84
|
-
objectKey,
|
|
85
|
-
url,
|
|
86
|
-
headers: [],
|
|
87
|
-
method: 'GET',
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
formatPublicUrl(key) {
|
|
91
|
-
return `${this.publicBaseUrl}/${key}`;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
exports.S3Service = S3Service;
|
|
95
|
-
class S3ServiceFactory {
|
|
96
|
-
create(config, providers, authorizator) {
|
|
97
|
-
return new S3Service(config, providers, authorizator);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
exports.S3ServiceF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