@fastly/compute-js-static-publish 8.0.0-beta.6 → 8.0.0-beta.7
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/README.md +1 -1
- package/README.short.md +1 -1
- package/build/cli/cli/commands/manage/clean.js +1 -1
- package/build/cli/cli/commands/manage/collections/delete.js +1 -1
- package/build/cli/cli/commands/manage/collections/index.js +1 -1
- package/build/cli/cli/commands/manage/collections/list.js +1 -1
- package/build/cli/cli/commands/manage/collections/promote.js +1 -1
- package/build/cli/cli/commands/manage/collections/update-expiration.js +1 -1
- package/build/cli/cli/commands/manage/index.js +1 -1
- package/build/cli/cli/commands/manage/publish-content.d.ts.map +1 -1
- package/build/cli/cli/commands/manage/publish-content.js +7 -6
- package/build/cli/cli/commands/scaffold/index.d.ts.map +1 -1
- package/build/cli/cli/commands/scaffold/index.js +26 -7
- package/build/cli/cli/storage/kv-store-local-provider.d.ts +1 -0
- package/build/cli/cli/storage/kv-store-local-provider.d.ts.map +1 -1
- package/build/cli/cli/storage/kv-store-local-provider.js +2 -0
- package/build/cli/cli/storage/kv-store-provider.d.ts +1 -0
- package/build/cli/cli/storage/kv-store-provider.d.ts.map +1 -1
- package/build/cli/cli/storage/kv-store-provider.js +2 -0
- package/build/cli/cli/storage/s3-storage-provider.d.ts +4 -1
- package/build/cli/cli/storage/s3-storage-provider.d.ts.map +1 -1
- package/build/cli/cli/storage/s3-storage-provider.js +43 -4
- package/build/cli/cli/storage/storage-provider.d.ts +1 -0
- package/build/cli/cli/storage/storage-provider.d.ts.map +1 -1
- package/build/cli/cli/util/purge.d.ts +3 -0
- package/build/cli/cli/util/purge.d.ts.map +1 -0
- package/build/cli/cli/util/purge.js +23 -0
- package/build/server/server/publisher-server/index.js +2 -2
- package/build/server/server/storage/s3-storage-provider.d.ts +7 -8
- package/build/server/server/storage/s3-storage-provider.d.ts.map +1 -1
- package/build/server/server/storage/s3-storage-provider.js +23 -14
- package/build/server/server/storage/storage-provider.d.ts +1 -1
- package/build/server/server/storage/storage-provider.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ This CLI tool helps you:
|
|
|
18
18
|
Create a directory for your project, place your static files in `./public`, then type:
|
|
19
19
|
|
|
20
20
|
```sh
|
|
21
|
-
npx @fastly/compute-js-static-publish@latest --root-dir=./public --
|
|
21
|
+
npx @fastly/compute-js-static-publish@latest --root-dir=./public --kv-store-name=site-content
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
**New in v8:** S3-compatible storage (such as Fastly Object Storage) is also supported (Beta). To use this mode, type:
|
package/README.short.md
CHANGED
|
@@ -18,7 +18,7 @@ This CLI tool helps you:
|
|
|
18
18
|
Create a directory for your project, place your static files in `./public`, then type:
|
|
19
19
|
|
|
20
20
|
```sh
|
|
21
|
-
npx @fastly/compute-js-static-publish@latest --root-dir=./public --
|
|
21
|
+
npx @fastly/compute-js-static-publish@latest --root-dir=./public --kv-store-name=site-content
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
**New in v8:** S3-compatible storage (such as Fastly Object Storage) is also supported (Beta). To use this mode, type:
|
|
@@ -33,7 +33,7 @@ KV Store Options:
|
|
|
33
33
|
1. FASTLY_API_TOKEN environment variable
|
|
34
34
|
2. Logged-in Fastly CLI profile
|
|
35
35
|
|
|
36
|
-
S3 Storage Options:
|
|
36
|
+
S3 Storage Options (BETA):
|
|
37
37
|
--aws-access-key-id=<key> AWS Access Key ID and Secret Access Key used to
|
|
38
38
|
--aws-secret-access-key=<key> interface with S3.
|
|
39
39
|
If not set, the tool will check:
|
|
@@ -32,7 +32,7 @@ KV Store Options:
|
|
|
32
32
|
1. FASTLY_API_TOKEN environment variable
|
|
33
33
|
2. Logged-in Fastly CLI profile
|
|
34
34
|
|
|
35
|
-
S3 Storage Options:
|
|
35
|
+
S3 Storage Options (BETA):
|
|
36
36
|
--aws-access-key-id=<key> AWS Access Key ID and Secret Access Key used to
|
|
37
37
|
--aws-secret-access-key=<key> interface with S3.
|
|
38
38
|
If not set, the tool will check:
|
|
@@ -33,7 +33,7 @@ KV Store Options:
|
|
|
33
33
|
1. FASTLY_API_TOKEN environment variable
|
|
34
34
|
2. Logged-in Fastly CLI profile
|
|
35
35
|
|
|
36
|
-
S3 Storage Options:
|
|
36
|
+
S3 Storage Options (BETA):
|
|
37
37
|
--aws-access-key-id=<key> AWS Access Key ID and Secret Access Key used to
|
|
38
38
|
--aws-secret-access-key=<key> interface with S3.
|
|
39
39
|
If not set, the tool will check:
|
|
@@ -27,7 +27,7 @@ KV Store Options:
|
|
|
27
27
|
1. FASTLY_API_TOKEN environment variable
|
|
28
28
|
2. Logged-in Fastly CLI profile
|
|
29
29
|
|
|
30
|
-
S3 Storage Options:
|
|
30
|
+
S3 Storage Options (BETA):
|
|
31
31
|
--aws-access-key-id=<key> AWS Access Key ID and Secret Access Key used to
|
|
32
32
|
--aws-secret-access-key=<key> interface with S3.
|
|
33
33
|
If not set, the tool will check:
|
|
@@ -49,7 +49,7 @@ KV Store Options:
|
|
|
49
49
|
1. FASTLY_API_TOKEN environment variable
|
|
50
50
|
2. Logged-in Fastly CLI profile
|
|
51
51
|
|
|
52
|
-
S3 Storage Options:
|
|
52
|
+
S3 Storage Options (BETA):
|
|
53
53
|
--aws-access-key-id=<key> AWS Access Key ID and Secret Access Key used to
|
|
54
54
|
--aws-secret-access-key=<key> interface with S3.
|
|
55
55
|
If not set, the tool will check:
|
|
@@ -45,7 +45,7 @@ KV Store Options:
|
|
|
45
45
|
1. FASTLY_API_TOKEN environment variable
|
|
46
46
|
2. Logged-in Fastly CLI profile
|
|
47
47
|
|
|
48
|
-
S3 Storage Options:
|
|
48
|
+
S3 Storage Options (BETA):
|
|
49
49
|
--aws-access-key-id=<key> AWS Access Key ID and Secret Access Key used to
|
|
50
50
|
--aws-secret-access-key=<key> interface with S3.
|
|
51
51
|
If not set, the tool will check:
|
|
@@ -35,7 +35,7 @@ KV Store Options:
|
|
|
35
35
|
1. FASTLY_API_TOKEN environment variable
|
|
36
36
|
2. Logged-in Fastly CLI profile
|
|
37
37
|
|
|
38
|
-
S3 Storage Options:
|
|
38
|
+
S3 Storage Options (BETA):
|
|
39
39
|
--aws-access-key-id=<key> AWS Access Key ID and Secret Access Key used to
|
|
40
40
|
--aws-secret-access-key=<key> interface with S3.
|
|
41
41
|
If not set, the tool will check:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish-content.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/manage/publish-content.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"publish-content.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/manage/publish-content.ts"],"names":[],"mappings":"AA6GA,wBAAsB,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,iBA4ehD"}
|
|
@@ -42,6 +42,11 @@ Optional:
|
|
|
42
42
|
--root-dir=<dir> Directory to publish from. Overrides the config file setting.
|
|
43
43
|
Default: rootDir from publish-content.config.js
|
|
44
44
|
|
|
45
|
+
--fastly-api-token=<token> Fastly API token for KV Store or cache access.
|
|
46
|
+
If not set, the tool will check:
|
|
47
|
+
1. FASTLY_API_TOKEN environment variable
|
|
48
|
+
2. Logged-in Fastly CLI profile
|
|
49
|
+
|
|
45
50
|
--overwrite-existing Always overwrite existing entries in storage, even if unchanged.
|
|
46
51
|
|
|
47
52
|
Expiration:
|
|
@@ -61,14 +66,9 @@ KV Store Options:
|
|
|
61
66
|
local files that will be used to simulate the KV Store
|
|
62
67
|
with the local development environment.
|
|
63
68
|
|
|
64
|
-
--fastly-api-token=<token> Fastly API token for KV Store access.
|
|
65
|
-
If not set, the tool will check:
|
|
66
|
-
1. FASTLY_API_TOKEN environment variable
|
|
67
|
-
2. Logged-in Fastly CLI profile
|
|
68
|
-
|
|
69
69
|
--kv-overwrite Alias for --overwrite-existing.
|
|
70
70
|
|
|
71
|
-
S3 Storage Options:
|
|
71
|
+
S3 Storage Options (BETA):
|
|
72
72
|
--aws-access-key-id=<key> AWS Access Key ID and Secret Access Key used to
|
|
73
73
|
--aws-secret-access-key=<key> interface with S3.
|
|
74
74
|
If not set, the tool will check:
|
|
@@ -475,5 +475,6 @@ export async function action(actionArgs) {
|
|
|
475
475
|
const settingsFilePath = path.resolve(storageContentDir, settingsFileName);
|
|
476
476
|
await storageProvider.submitStorageEntry(settingsFileKey, settingsFilePath, JSON.stringify(serverSettings));
|
|
477
477
|
console.log(`✅ Settings have been saved.`);
|
|
478
|
+
await storageProvider.purgeSurrogateKey(`${publishId}-${collectionName}`);
|
|
478
479
|
console.log(`🎉 Completed.`);
|
|
479
480
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/scaffold/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/scaffold/index.ts"],"names":[],"mappings":"AAuEA,MAAM,MAAM,cAAc,GAAG;IAC3B,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,yBAAyB,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9C,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC,CAAC;AA0TF,wBAAsB,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,iBAsqBhD"}
|
|
@@ -26,8 +26,9 @@ Description:
|
|
|
26
26
|
management mode.
|
|
27
27
|
|
|
28
28
|
Options:
|
|
29
|
-
--storage-mode <mode>
|
|
30
|
-
Can be "kv-store" or "s3".
|
|
29
|
+
--storage-mode <mode> Storage mode for content storage.
|
|
30
|
+
Can be "kv-store" or "s3" (BETA).
|
|
31
|
+
(default: kv-store)
|
|
31
32
|
If --storage-mode=kv-store, then:
|
|
32
33
|
--kv-store-name <name> (required) Name of the KV Store.
|
|
33
34
|
|
|
@@ -39,8 +40,8 @@ Options:
|
|
|
39
40
|
--root-dir <path> (required) Path to static content (e.g., ./public)
|
|
40
41
|
-o, --output <dir> Output directory for Compute app (default: ./compute-js)
|
|
41
42
|
--static-publisher-working-dir <dir> Working directory for build artifacts (default: <output>/static-publisher)
|
|
42
|
-
--publish-id <id> Advanced. Prefix for KV keys (default: "default")
|
|
43
43
|
(default: ./compute-js/static-publisher)
|
|
44
|
+
--publish-id <id> Advanced. Prefix for KV keys (default: "default")
|
|
44
45
|
|
|
45
46
|
Compute Service Metadata:
|
|
46
47
|
--name <name> App name (for fastly.toml)
|
|
@@ -334,8 +335,8 @@ function processPublicDirToken(filepath, publicDir) {
|
|
|
334
335
|
export async function action(actionArgs) {
|
|
335
336
|
const optionDefinitions = [
|
|
336
337
|
{ name: 'verbose', type: Boolean },
|
|
337
|
-
//
|
|
338
|
-
{ name: 'storage-mode', type: String, },
|
|
338
|
+
// Storage mode for content storage. Can be "kv-store" or "s3".
|
|
339
|
+
{ name: 'storage-mode', type: String, defaultValue: 'kv-store', },
|
|
339
340
|
// If storage-mode=kv-store, then:
|
|
340
341
|
// Required. The name of a Fastly KV Store to hold the content assets.
|
|
341
342
|
// It is also added to the fastly.toml that is generated.
|
|
@@ -540,7 +541,7 @@ export async function action(actionArgs) {
|
|
|
540
541
|
const fastlyServiceId = options.serviceId;
|
|
541
542
|
const storageMode = options.storageMode;
|
|
542
543
|
if (!(storageMode === 'kv-store' || storageMode === 's3')) {
|
|
543
|
-
console.error(`❌
|
|
544
|
+
console.error(`❌ parameter --storage-mode must be set to 'kv-store' or 's3'.`);
|
|
544
545
|
process.exitCode = 1;
|
|
545
546
|
return;
|
|
546
547
|
}
|
|
@@ -614,7 +615,7 @@ export async function action(actionArgs) {
|
|
|
614
615
|
console.log('KV Store Name :', kvStoreName);
|
|
615
616
|
}
|
|
616
617
|
else if (storageMode === 's3') {
|
|
617
|
-
console.log('Storage Name : S3-compatible storage');
|
|
618
|
+
console.log('Storage Name : S3-compatible storage (BETA)');
|
|
618
619
|
console.log('S3 Region :', s3Region);
|
|
619
620
|
console.log('S3 Bucket :', s3Bucket);
|
|
620
621
|
console.log('S3 Endpoint :', String(s3EndpointUrl));
|
|
@@ -689,10 +690,15 @@ export async function action(actionArgs) {
|
|
|
689
690
|
if (storageMode === 'kv-store') {
|
|
690
691
|
const localServerKvStorePath = dotRelative(computeJsDir, path.resolve(staticPublisherWorkingDir, 'kvstore.json'));
|
|
691
692
|
fastlyTomlLocalServer = /* language=text */ `\
|
|
693
|
+
[local_server]
|
|
694
|
+
|
|
692
695
|
[local_server.kv_stores]
|
|
693
696
|
${kvStoreName} = { file = "${localServerKvStorePath}", format = "json" }
|
|
694
697
|
`;
|
|
695
698
|
fastlyTomlSetup = /* language=text */ `\
|
|
699
|
+
[setup]
|
|
700
|
+
|
|
701
|
+
[setup.kv_stores]
|
|
696
702
|
[setup.kv_stores.${kvStoreName}]
|
|
697
703
|
`;
|
|
698
704
|
// kvstore.json
|
|
@@ -700,6 +706,8 @@ ${kvStoreName} = { file = "${localServerKvStorePath}", format = "json" }
|
|
|
700
706
|
}
|
|
701
707
|
else if (storageMode === 's3') {
|
|
702
708
|
fastlyTomlLocalServer = /* language=text */ `\
|
|
709
|
+
[local_server]
|
|
710
|
+
|
|
703
711
|
[local_server.secret_stores]
|
|
704
712
|
[[local_server.secret_stores.AWS_CREDENTIALS]]
|
|
705
713
|
key = "AWS_ACCESS_KEY_ID"
|
|
@@ -714,10 +722,21 @@ url = "${String(s3EndpointUrl)}"
|
|
|
714
722
|
override_host = "${s3EndpointUrl.hostname}"
|
|
715
723
|
`;
|
|
716
724
|
fastlyTomlSetup = /* language=text */ `\
|
|
725
|
+
[setup]
|
|
726
|
+
|
|
727
|
+
[setup.backends]
|
|
717
728
|
[setup.backends.aws]
|
|
718
729
|
address = "${s3EndpointUrl.hostname}"
|
|
719
730
|
description = "S3 API endpoint"
|
|
720
731
|
port = 443
|
|
732
|
+
[setup.secret_stores]
|
|
733
|
+
[setup.secret_stores.AWS_CREDENTIALS]
|
|
734
|
+
description = "Credentials for S3 storage"
|
|
735
|
+
[setup.secret_stores.AWS_CREDENTIALS.items]
|
|
736
|
+
[setup.secret_stores.AWS_CREDENTIALS.items.AWS_ACCESS_KEY_ID]
|
|
737
|
+
description = "AWS Access Key ID"
|
|
738
|
+
[setup.secret_stores.AWS_CREDENTIALS.items.AWS_SECRET_ACCESS_KEY]
|
|
739
|
+
description = "AWS Secret Access Key"
|
|
721
740
|
`;
|
|
722
741
|
}
|
|
723
742
|
resourceFiles['fastly.toml'] = /* language=text */ `\
|
|
@@ -16,5 +16,6 @@ export declare class KvStoreLocalProvider implements StorageProvider {
|
|
|
16
16
|
}>(objects: TObject[], fn: (obj: TObject, key: string, index: number) => Promise<void>, maxConcurrent?: number): Promise<void>;
|
|
17
17
|
calculateNumChunks(size: number): number;
|
|
18
18
|
getExistingAssetVariant(_variantKey: string): Promise<AssetVariantMetadata | null>;
|
|
19
|
+
purgeSurrogateKey(_surrogateKey: string): Promise<void>;
|
|
19
20
|
}
|
|
20
21
|
//# sourceMappingURL=kv-store-local-provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kv-store-local-provider.d.ts","sourceRoot":"","sources":["../../../../src/cli/storage/kv-store-local-provider.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,KAAK,oBAAoB,EAC1B,MAAM,8BAA8B,CAAC;AAoBtC,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAE3B,KAAK,oBAAoB,EAC1B,MAAM,uBAAuB,CAAC;AAK/B,eAAO,MAAM,kBAAkB,EAAE,sBAkBhC,CAAC;AAEF,qBAAa,oBAAqB,YAAW,eAAe;gBAExD,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM;IAMvB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAEzB,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC;IAQzD,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;IAc1D,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;IAe9D,kBAAkB,CACtB,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,cAAc,CAAC,UAAU,CAAC,GAAG,UAAU,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,EACzE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAChC,OAAO,CAAC,IAAI,CAAC;IAsBV,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAS9C,UAAU,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;IAmBtD,oB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,IAAI,EAAE,cAAc,CAAC,UAAU,CAAC,GAAG,UAAU,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,EACzE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAChC,OAAO,CAAC,IAAI,CAAC;IAsBV,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAS9C,UAAU,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;IAmBtD,oBAAoB,CAAC,OAAO,SAAS;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,EACxD,OAAO,EAAE,OAAO,EAAE,EAClB,EAAE,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,EAC/D,aAAa,CAAC,EAAE,MAAM,GACrB,OAAO,CAAC,IAAI,CAAC;IAWhB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAIlC,uBAAuB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IAMlF,iBAAiB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAE9D"}
|
|
@@ -18,6 +18,7 @@ export declare class KvStoreProvider implements StorageProvider {
|
|
|
18
18
|
}>(objects: TObject[], fn: (obj: TObject, key: string, index: number) => Promise<void>, maxConcurrent?: number): Promise<void>;
|
|
19
19
|
calculateNumChunks(size: number): number;
|
|
20
20
|
getExistingAssetVariant(variantKey: string): Promise<AssetVariantMetadata | null>;
|
|
21
|
+
purgeSurrogateKey(_surrogateKey: string): Promise<void>;
|
|
21
22
|
}
|
|
22
23
|
export declare function kvStoreEntryToStorageEntry(kvStoreEntry: KvStoreEntryInfo): StorageEntry;
|
|
23
24
|
export declare function parseKvStoreMetadata(metadata: string): Record<string, string> | null;
|
|
@@ -1 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OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;IAiB9D,kBAAkB,CACtB,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,cAAc,CAAC,UAAU,CAAC,GAAG,UAAU,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,EACzE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAChC,OAAO,CAAC,IAAI,CAAC;IAYV,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAU9C,UAAU,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;IA4BtD,oBAAoB,CAAC,OAAO,SAAS;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,EACxD,OAAO,EAAE,OAAO,EAAE,EAClB,EAAE,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,EAC/D,aAAa,GAAE,MAAW,GACzB,OAAO,CAAC,IAAI,CAAC;IAkBhB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAIlC,uBAAuB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IA+DjF,iBAAiB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAE9D;AAED,wBAAgB,0BAA0B,CACxC,YAAY,EAAE,gBAAgB,gBAuB/B;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,iCAiCpD"}
|
|
@@ -5,7 +5,9 @@ import { type StorageEntry, type StorageProvider, type StorageProviderBuilder, t
|
|
|
5
5
|
type CommandOutput<C> = C extends Command<any, any, any, infer O, any> ? O : never;
|
|
6
6
|
export declare const buildStoreProvider: StorageProviderBuilder;
|
|
7
7
|
export declare class S3StorageProvider implements StorageProvider {
|
|
8
|
-
constructor(s3Region: string, accessKeyId: string, secretAccessKey: string, s3Bucket: string, s3Endpoint?: string);
|
|
8
|
+
constructor(fastlyServiceId: string | undefined, fastlyApiToken: string | undefined, s3Region: string, accessKeyId: string, secretAccessKey: string, s3Bucket: string, s3Endpoint?: string);
|
|
9
|
+
private readonly fastlyServiceId?;
|
|
10
|
+
private readonly fastlyApiContext?;
|
|
9
11
|
private readonly s3Region;
|
|
10
12
|
private readonly accessKeyId;
|
|
11
13
|
private readonly secretAccessKey;
|
|
@@ -25,6 +27,7 @@ export declare class S3StorageProvider implements StorageProvider {
|
|
|
25
27
|
}>(objects: TObject[], fn: (obj: TObject, key: string, index: number) => Promise<void>, maxConcurrent?: number): Promise<void>;
|
|
26
28
|
calculateNumChunks(_size: number): number;
|
|
27
29
|
getExistingAssetVariant(variantKey: string): Promise<AssetVariantMetadata | null>;
|
|
30
|
+
purgeSurrogateKey(surrogateKey: string): Promise<void>;
|
|
28
31
|
}
|
|
29
32
|
export {};
|
|
30
33
|
//# sourceMappingURL=s3-storage-provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"s3-storage-provider.d.ts","sourceRoot":"","sources":["../../../../src/cli/storage/s3-storage-provider.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"s3-storage-provider.d.ts","sourceRoot":"","sources":["../../../../src/cli/storage/s3-storage-provider.ts"],"names":[],"mappings":"AAOA,OAAO,EAWL,QAAQ,EAET,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,kBAAkB,EACxB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,KAAK,oBAAoB,EAE1B,MAAM,8BAA8B,CAAC;AAQtC,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAE3B,KAAK,oBAAoB,EAC1B,MAAM,uBAAuB,CAAC;AAsB/B,KAAK,aAAa,CAAC,CAAC,IAAI,CAA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AG,IAAI,CAAC;IAwB9D,kBAAkB,CACtB,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,cAAc,CAAC,UAAU,CAAC,GAAG,UAAU,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,EACzE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAChC,OAAO,CAAC,IAAI,CAAC;IAaV,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAW9C,UAAU,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;IAqBtD,oBAAoB,CAAC,OAAO,SAAS;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,EACxD,OAAO,EAAE,OAAO,EAAE,EAClB,EAAE,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,EAC/D,aAAa,GAAE,MAAW,GACzB,OAAO,CAAC,IAAI,CAAC;IAkBhB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAInC,uBAAuB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IA8BjF,iBAAiB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CA4B7D"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT license. See LICENSE file for details.
|
|
4
4
|
*/
|
|
5
5
|
import fs from 'node:fs';
|
|
6
|
+
import path from 'node:path';
|
|
6
7
|
import { DeleteObjectCommand, GetObjectCommand, HeadObjectCommand, ListObjectsV2Command, PutObjectCommand, S3Client, S3ServiceException, } from '@aws-sdk/client-s3';
|
|
7
8
|
import { decodeAssetVariantMetadata, } from '../../models/assets/index.js';
|
|
8
9
|
import { isS3StorageConfigRc, } from '../../models/config/static-publish-rc.js';
|
|
@@ -10,15 +11,18 @@ import { getS3StorageConfigFromRc, } from '../../models/config/s3-storage-config
|
|
|
10
11
|
import { loadAwsCredentials, } from '../util/aws-credentials.js';
|
|
11
12
|
import { concurrentParallel, makeRetryable, } from '../util/retryable.js';
|
|
12
13
|
import { rootRelative, } from '../util/files.js';
|
|
14
|
+
import { loadApiToken, } from '../util/api-token.js';
|
|
15
|
+
import { readServiceId, } from '../util/fastly-toml.js';
|
|
16
|
+
import { purgeSurrogateKey, } from '../util/purge.js';
|
|
13
17
|
export const buildStoreProvider = async (config, context) => {
|
|
14
18
|
if (isS3StorageConfigRc(config)) {
|
|
15
|
-
console.log(` Working on S3 (or compatible) storage...`);
|
|
19
|
+
console.log(` Working on S3 (or compatible) storage (BETA)...`);
|
|
16
20
|
}
|
|
17
21
|
else {
|
|
18
22
|
return null;
|
|
19
23
|
}
|
|
20
24
|
const { region, bucket, endpoint, } = getS3StorageConfigFromRc(config);
|
|
21
|
-
console.log(` | Using S3 storage`);
|
|
25
|
+
console.log(` | Using S3 storage (BETA)`);
|
|
22
26
|
console.log(` Region : ${region}`);
|
|
23
27
|
console.log(` Bucket : ${bucket}`);
|
|
24
28
|
console.log(` Endpoint: ${endpoint ?? 'default'}`);
|
|
@@ -31,10 +35,27 @@ export const buildStoreProvider = async (config, context) => {
|
|
|
31
35
|
throw new Error("❌ S3 Credentials not provided.\nProvide an AWS access key ID and secret access key that has write access to the S3 Storage.\nRefer to the README file and --help for additional information.");
|
|
32
36
|
}
|
|
33
37
|
console.log(`✔️ S3 Credentials: ${awsCredentialsResult.awsAccessKeyId.slice(0, 4)}${'*'.repeat(awsCredentialsResult.awsAccessKeyId.length - 4)} from '${awsCredentialsResult.source}'`);
|
|
34
|
-
|
|
38
|
+
const fastlyTomlPath = path.resolve(context.computeAppDir, 'fastly.toml');
|
|
39
|
+
const serviceId = readServiceId(fastlyTomlPath);
|
|
40
|
+
let apiToken = undefined;
|
|
41
|
+
if (serviceId == null) {
|
|
42
|
+
console.log(`- Service ID not found in fastly.toml, application may not have been deployed yet. Will skip purge step after publish.`);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
console.log(`✔️ Service ID from fastly.toml: ${serviceId}`);
|
|
46
|
+
const apiTokenResult = loadApiToken({ commandLine: context.fastlyApiToken });
|
|
47
|
+
if (apiTokenResult == null) {
|
|
48
|
+
throw new Error("❌ Fastly API Token not provided.\nSet the FASTLY_API_TOKEN environment variable to an API token that has write access to the KV Store.");
|
|
49
|
+
}
|
|
50
|
+
console.log(`✔️ Fastly API Token: ${apiTokenResult.apiToken.slice(0, 4)}${'*'.repeat(apiTokenResult.apiToken.length - 4)} from '${apiTokenResult.source}'`);
|
|
51
|
+
apiToken = apiTokenResult.apiToken;
|
|
52
|
+
}
|
|
53
|
+
return new S3StorageProvider(serviceId, apiToken, region, awsCredentialsResult.awsAccessKeyId, awsCredentialsResult.awsSecretAccessKey, bucket, endpoint);
|
|
35
54
|
};
|
|
36
55
|
export class S3StorageProvider {
|
|
37
|
-
constructor(s3Region, accessKeyId, secretAccessKey, s3Bucket, s3Endpoint) {
|
|
56
|
+
constructor(fastlyServiceId, fastlyApiToken, s3Region, accessKeyId, secretAccessKey, s3Bucket, s3Endpoint) {
|
|
57
|
+
this.fastlyServiceId = fastlyServiceId;
|
|
58
|
+
this.fastlyApiContext = fastlyApiToken != null ? { apiToken: fastlyApiToken } : undefined;
|
|
38
59
|
this.s3Region = s3Region;
|
|
39
60
|
this.accessKeyId = accessKeyId;
|
|
40
61
|
this.secretAccessKey = secretAccessKey;
|
|
@@ -198,4 +219,22 @@ export class S3StorageProvider {
|
|
|
198
219
|
});
|
|
199
220
|
return assetVariantMetadata;
|
|
200
221
|
}
|
|
222
|
+
async purgeSurrogateKey(surrogateKey) {
|
|
223
|
+
if (this.fastlyServiceId == null) {
|
|
224
|
+
console.log('Fastly Service ID not set, skipping purge...');
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
if (this.fastlyApiContext?.apiToken == null) {
|
|
228
|
+
console.log('Fastly API token not set, skipping purge...');
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
console.log(`Purging surrogate key [${surrogateKey}] on service [${this.fastlyServiceId}]...`);
|
|
232
|
+
const result = await purgeSurrogateKey(this.fastlyApiContext, this.fastlyServiceId, surrogateKey, true);
|
|
233
|
+
if (result) {
|
|
234
|
+
console.log('Purged');
|
|
235
|
+
}
|
|
236
|
+
else {
|
|
237
|
+
console.log('Failed purging');
|
|
238
|
+
}
|
|
239
|
+
}
|
|
201
240
|
}
|
|
@@ -17,6 +17,7 @@ export interface StorageProvider {
|
|
|
17
17
|
}>(objects: TObject[], fn: (obj: TObject, key: string, index: number) => Promise<void>, maxConcurrent?: number): Promise<void>;
|
|
18
18
|
calculateNumChunks(size: number): number;
|
|
19
19
|
getExistingAssetVariant(variantKey: string): Promise<AssetVariantMetadata | null>;
|
|
20
|
+
purgeSurrogateKey(surrogateKey: string): Promise<void>;
|
|
20
21
|
}
|
|
21
22
|
export type StorageProviderBatchEntry = {
|
|
22
23
|
write: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage-provider.d.ts","sourceRoot":"","sources":["../../../../src/cli/storage/storage-provider.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,KAAK,oBAAoB,EAC1B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,KAAK,eAAe,EACrB,MAAM,0CAA0C,CAAC;AAElD,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC3C;AAED,MAAM,WAAW,eAAe;IAC9B,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,GAAG,IAAI,C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,gBAAgB,EAAc,MAAM,gBAAgB,CAAC;AAElF,wBAAsB,iBAAiB,CACrC,gBAAgB,EAAE,gBAAgB,EAClC,eAAe,EAAE,MAAM,EACvB,YAAY,EAAE,MAAM,EACpB,SAAS,GAAE,OAAe,oBAuB3B"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Fastly, Inc.
|
|
3
|
+
* Licensed under the MIT license. See LICENSE file for details.
|
|
4
|
+
*/
|
|
5
|
+
import { callFastlyApi, FetchError } from './api-token.js';
|
|
6
|
+
export async function purgeSurrogateKey(fastlyApiContext, fastlyServiceId, surrogateKey, softPurge = false) {
|
|
7
|
+
const endpoint = `/service/${encodeURIComponent(fastlyServiceId)}/purge`;
|
|
8
|
+
try {
|
|
9
|
+
const headers = new Headers();
|
|
10
|
+
headers.set('surrogate-key', surrogateKey);
|
|
11
|
+
if (softPurge) {
|
|
12
|
+
headers.set('fastly-soft-purge', '1');
|
|
13
|
+
}
|
|
14
|
+
await callFastlyApi(fastlyApiContext, endpoint, `Purging surrogate key [${surrogateKey}] on service [${fastlyServiceId}]`, null, { method: 'POST', headers });
|
|
15
|
+
}
|
|
16
|
+
catch (err) {
|
|
17
|
+
if (err instanceof FetchError) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
throw err;
|
|
21
|
+
}
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
@@ -61,7 +61,7 @@ export class PublisherServer {
|
|
|
61
61
|
return this.settingsCached;
|
|
62
62
|
}
|
|
63
63
|
const settingsFileKey = `${this.publishId}_settings_${this.activeCollectionName}`;
|
|
64
|
-
const settingsFile = await this.storageProvider.getEntry(settingsFileKey);
|
|
64
|
+
const settingsFile = await this.storageProvider.getEntry(settingsFileKey, [`${this.publishId}-${this.activeCollectionName}`, 'settings']);
|
|
65
65
|
if (settingsFile == null) {
|
|
66
66
|
console.error(`Settings File not found at ${settingsFileKey}.`);
|
|
67
67
|
console.error(`You may need to publish your application.`);
|
|
@@ -96,7 +96,7 @@ export class PublisherServer {
|
|
|
96
96
|
return this.assetEntryMapCache;
|
|
97
97
|
}
|
|
98
98
|
const indexFileKey = `${this.publishId}_index_${this.activeCollectionName}`;
|
|
99
|
-
const indexFile = await this.storageProvider.getEntry(indexFileKey);
|
|
99
|
+
const indexFile = await this.storageProvider.getEntry(indexFileKey, [`${this.publishId}-${this.activeCollectionName}`, 'index']);
|
|
100
100
|
if (indexFile == null) {
|
|
101
101
|
console.error(`Index File not found at ${indexFileKey}.`);
|
|
102
102
|
console.error(`You may need to publish your application.`);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Command } from '@smithy/types';
|
|
2
|
+
import { S3ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from '@aws-sdk/client-s3';
|
|
2
3
|
import { type StorageEntry, type StorageProvider, StorageProviderBuilder } from './storage-provider.js';
|
|
3
4
|
export type AwsCredentials = {
|
|
4
5
|
accessKeyId: string;
|
|
@@ -9,23 +10,21 @@ export declare const buildStoreProvider: StorageProviderBuilder;
|
|
|
9
10
|
export declare function setSecretStoreForAwsCredentials(secretStoreName: string): void;
|
|
10
11
|
export declare function setSecretStoreKeyForAwsAccessKeyId(secretStoreKey: string): void;
|
|
11
12
|
export declare function setSecretStoreKeyForAwsSecretAccessKey(secretStoreKey: string): void;
|
|
12
|
-
export declare function buildAwsCredentialsFromSecretStore(): Promise<
|
|
13
|
-
accessKeyId: string;
|
|
14
|
-
secretAccessKey: string;
|
|
15
|
-
}>;
|
|
13
|
+
export declare function buildAwsCredentialsFromSecretStore(): Promise<AwsCredentials>;
|
|
16
14
|
export declare function setAwsCredentialsBuilder(awsCredentialsBuilder: AwsCredentialsBuilder): void;
|
|
17
15
|
export type S3StorageProviderParams = {
|
|
18
16
|
s3Endpoint?: string;
|
|
19
17
|
s3FastlyBackendName?: string;
|
|
20
18
|
};
|
|
19
|
+
type S3ClientCommand<InputType extends ServiceInputTypes, OutputType extends ServiceOutputTypes> = Command<ServiceInputTypes, InputType, ServiceOutputTypes, OutputType, S3ClientResolvedConfig>;
|
|
21
20
|
export declare class S3StorageProvider implements StorageProvider {
|
|
22
21
|
constructor(s3Region: string, s3Bucket: string, params?: S3StorageProviderParams);
|
|
23
22
|
private readonly s3Region;
|
|
24
23
|
private readonly s3Bucket;
|
|
25
24
|
private readonly s3Endpoint?;
|
|
26
25
|
private readonly s3FastlyBackendName?;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
getEntry(key: string): Promise<StorageEntry | null>;
|
|
26
|
+
sendS3Command<InputType extends ServiceInputTypes, OutputType extends ServiceOutputTypes>(command: S3ClientCommand<InputType, OutputType>, requestInit?: RequestInit): Promise<OutputType>;
|
|
27
|
+
getEntry(key: string, tags?: string[]): Promise<StorageEntry | null>;
|
|
30
28
|
}
|
|
29
|
+
export {};
|
|
31
30
|
//# sourceMappingURL=s3-storage-provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"s3-storage-provider.d.ts","sourceRoot":"","sources":["../../../../src/server/storage/s3-storage-provider.ts"],"names":[],"mappings":"AAOA,OAAO,
|
|
1
|
+
{"version":3,"file":"s3-storage-provider.d.ts","sourceRoot":"","sources":["../../../../src/server/storage/s3-storage-provider.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EAKL,sBAAsB,EAEtB,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAS5B,OAAO,EAEL,KAAK,YAAY,EAEjB,KAAK,eAAe,EACpB,sBAAsB,EACvB,MAAM,uBAAuB,CAAC;AAE/B,MAAM,MAAM,cAAc,GAAG;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC;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
2
|
* Copyright Fastly, Inc.
|
|
3
3
|
* Licensed under the MIT license. See LICENSE file for details.
|
|
4
4
|
*/
|
|
5
|
+
import { CacheOverride } from 'fastly:cache-override';
|
|
5
6
|
import { SecretStore } from 'fastly:secret-store';
|
|
6
7
|
import { FetchHttpHandler } from '@smithy/fetch-http-handler';
|
|
7
|
-
import { GetObjectCommand, S3Client, S3ServiceException } from '@aws-sdk/client-s3';
|
|
8
|
+
import { GetObjectCommand, S3Client, S3ServiceException, } from '@aws-sdk/client-s3';
|
|
8
9
|
import { isS3StorageConfigRc, } from '../../models/config/static-publish-rc.js';
|
|
9
10
|
import { getS3StorageConfigFromRc, } from '../../models/config/s3-storage-config.js';
|
|
10
11
|
import { concatReadableStreams, StorageEntryImpl, } from './storage-provider.js';
|
|
@@ -30,7 +31,11 @@ export function setSecretStoreKeyForAwsAccessKeyId(secretStoreKey) {
|
|
|
30
31
|
export function setSecretStoreKeyForAwsSecretAccessKey(secretStoreKey) {
|
|
31
32
|
_secretStoreKeyForAwsSecretAccessKey = secretStoreKey;
|
|
32
33
|
}
|
|
34
|
+
let _awsCredentialsFromSecretStore = undefined;
|
|
33
35
|
export async function buildAwsCredentialsFromSecretStore() {
|
|
36
|
+
if (_awsCredentialsFromSecretStore != null) {
|
|
37
|
+
return _awsCredentialsFromSecretStore;
|
|
38
|
+
}
|
|
34
39
|
let secretStore;
|
|
35
40
|
try {
|
|
36
41
|
secretStore = new SecretStore(_secretStoreForAwsCredentials);
|
|
@@ -48,10 +53,11 @@ export async function buildAwsCredentialsFromSecretStore() {
|
|
|
48
53
|
throw new Error(`Could not retrieve value '${_secretStoreKeyForAwsSecretAccessKey}' in secret store '${_secretStoreForAwsCredentials}'`);
|
|
49
54
|
}
|
|
50
55
|
const secretAccessKey = secretAccessKeyEntry.plaintext();
|
|
51
|
-
|
|
56
|
+
_awsCredentialsFromSecretStore = {
|
|
52
57
|
accessKeyId,
|
|
53
58
|
secretAccessKey,
|
|
54
59
|
};
|
|
60
|
+
return _awsCredentialsFromSecretStore;
|
|
55
61
|
}
|
|
56
62
|
let _awsCredentialsBuilder = buildAwsCredentialsFromSecretStore;
|
|
57
63
|
export function setAwsCredentialsBuilder(awsCredentialsBuilder) {
|
|
@@ -64,13 +70,9 @@ export class S3StorageProvider {
|
|
|
64
70
|
this.s3Endpoint = params?.s3Endpoint;
|
|
65
71
|
this.s3FastlyBackendName = params?.s3FastlyBackendName;
|
|
66
72
|
}
|
|
67
|
-
async
|
|
68
|
-
if (this.s3Client != null) {
|
|
69
|
-
return this.s3Client;
|
|
70
|
-
}
|
|
73
|
+
async sendS3Command(command, requestInit) {
|
|
71
74
|
const awsCredentials = await _awsCredentialsBuilder();
|
|
72
|
-
const
|
|
73
|
-
this.s3Client = new S3Client({
|
|
75
|
+
const s3Client = new S3Client({
|
|
74
76
|
region: this.s3Region,
|
|
75
77
|
endpoint: this.s3Endpoint,
|
|
76
78
|
forcePathStyle: this.s3Endpoint != null,
|
|
@@ -78,14 +80,16 @@ export class S3StorageProvider {
|
|
|
78
80
|
accessKeyId: awsCredentials.accessKeyId,
|
|
79
81
|
secretAccessKey: awsCredentials.secretAccessKey,
|
|
80
82
|
},
|
|
81
|
-
maxAttempts:
|
|
83
|
+
maxAttempts: 5,
|
|
82
84
|
requestHandler: new FetchHttpHandler({
|
|
83
|
-
requestInit() {
|
|
85
|
+
requestInit() {
|
|
86
|
+
return requestInit ?? {};
|
|
87
|
+
},
|
|
84
88
|
}),
|
|
85
89
|
});
|
|
86
|
-
return
|
|
90
|
+
return s3Client.send(command);
|
|
87
91
|
}
|
|
88
|
-
async getEntry(key) {
|
|
92
|
+
async getEntry(key, tags) {
|
|
89
93
|
const input = {
|
|
90
94
|
Bucket: this.s3Bucket, // required
|
|
91
95
|
Key: key, // required
|
|
@@ -93,8 +97,13 @@ export class S3StorageProvider {
|
|
|
93
97
|
const command = new GetObjectCommand(input);
|
|
94
98
|
let response;
|
|
95
99
|
try {
|
|
96
|
-
|
|
97
|
-
|
|
100
|
+
response = await this.sendS3Command(command, {
|
|
101
|
+
backend: this.s3FastlyBackendName ?? "aws",
|
|
102
|
+
cacheOverride: new CacheOverride({
|
|
103
|
+
ttl: 3600,
|
|
104
|
+
surrogateKey: (tags ?? []).join(' ') || undefined,
|
|
105
|
+
}),
|
|
106
|
+
});
|
|
98
107
|
}
|
|
99
108
|
catch (err) {
|
|
100
109
|
if (err instanceof S3ServiceException && (err.name === "NotFound" || err.name === "NoSuchKey")) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type StaticPublishRc } from '../../models/config/static-publish-rc.js';
|
|
2
2
|
export interface StorageProvider {
|
|
3
|
-
getEntry(key: string): Promise<StorageEntry | null>;
|
|
3
|
+
getEntry(key: string, tags?: string[]): Promise<StorageEntry | null>;
|
|
4
4
|
}
|
|
5
5
|
export type StorageProviderBuilder = (config: StaticPublishRc) => (StorageProvider | null);
|
|
6
6
|
export interface StorageEntry {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage-provider.d.ts","sourceRoot":"","sources":["../../../../src/server/storage/storage-provider.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,KAAK,eAAe,EACrB,MAAM,0CAA0C,CAAC;AAElD,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"storage-provider.d.ts","sourceRoot":"","sources":["../../../../src/server/storage/storage-provider.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,KAAK,eAAe,EACrB,MAAM,0CAA0C,CAAC;AAElD,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;CACtE;AAED,MAAM,MAAM,sBAAsB,GAAG,CAAC,MAAM,EAAE,eAAe,KAAK,CAAC,eAA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