@teamkeel/functions-runtime 0.405.0 → 0.405.2
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/package.json +1 -1
- package/src/File.js +10 -2
package/package.json
CHANGED
package/src/File.js
CHANGED
|
@@ -14,6 +14,14 @@ const s3Client = (() => {
|
|
|
14
14
|
return null;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
if (!process.env.TEST_AWS_ENDPOINT) {
|
|
18
|
+
// If no test endpoint is provided then use the env's configuration
|
|
19
|
+
return new S3Client({
|
|
20
|
+
region: process.env.KEEL_REGION,
|
|
21
|
+
credentials: fromEnv(),
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
|
|
17
25
|
// Set in integration tests to send all AWS API calls to a test server
|
|
18
26
|
// for mocking
|
|
19
27
|
const endpoint = process.env.TEST_AWS_ENDPOINT;
|
|
@@ -29,9 +37,9 @@ const s3Client = (() => {
|
|
|
29
37
|
}
|
|
30
38
|
: fromEnv(),
|
|
31
39
|
|
|
32
|
-
// If a custom endpoint is set we need to use a custom resolver. Just
|
|
40
|
+
// If a custom endpoint is set we need to use a custom resolver. Just setting the base endpoint isn't enough for S3 as it
|
|
33
41
|
// as the default resolver uses the bucket name as a sub-domain, which likely won't work with the custom endpoint.
|
|
34
|
-
// By
|
|
42
|
+
// By implementing a full resolver we can force it to be the endpoint we want.
|
|
35
43
|
endpointProvider: () => {
|
|
36
44
|
return {
|
|
37
45
|
url: new URL(endpoint),
|