@adobe/spacecat-shared-utils 1.101.0 → 1.102.1
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/CHANGELOG.md +12 -0
- package/package.json +3 -3
- package/src/cdn-helpers.js +24 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [@adobe/spacecat-shared-utils-v1.102.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.102.0...@adobe/spacecat-shared-utils-v1.102.1) (2026-03-15)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* **deps:** update external fixes ([#1440](https://github.com/adobe/spacecat-shared/issues/1440)) ([d1a583a](https://github.com/adobe/spacecat-shared/commit/d1a583aca6a68378debbc01e3a3e8796f1f228bf))
|
|
6
|
+
|
|
7
|
+
## [@adobe/spacecat-shared-utils-v1.102.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.101.0...@adobe/spacecat-shared-utils-v1.102.0) (2026-03-12)
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* LLMO-3473 byocdn-fastly supports switching to role-based access ([#1430](https://github.com/adobe/spacecat-shared/issues/1430)) ([743daab](https://github.com/adobe/spacecat-shared/commit/743daabaab9c8002cc64ef605e3415f9fa025acb))
|
|
12
|
+
|
|
1
13
|
## [@adobe/spacecat-shared-utils-v1.101.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.100.1...@adobe/spacecat-shared-utils-v1.101.0) (2026-03-10)
|
|
2
14
|
|
|
3
15
|
### Features
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/spacecat-shared-utils",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.102.1",
|
|
4
4
|
"description": "Shared modules of the Spacecat Services - utils",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@adobe/fetch": "4.2.3",
|
|
56
|
-
"@aws-sdk/client-s3": "3.
|
|
57
|
-
"@aws-sdk/client-sqs": "3.
|
|
56
|
+
"@aws-sdk/client-s3": "3.1009.0",
|
|
57
|
+
"@aws-sdk/client-sqs": "3.1009.0",
|
|
58
58
|
"@json2csv/plainjs": "7.0.6",
|
|
59
59
|
"aws-xray-sdk": "3.12.0",
|
|
60
60
|
"cheerio": "1.2.0",
|
package/src/cdn-helpers.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* Transforms credential fields object
|
|
14
|
+
* Transforms credential fields object
|
|
15
15
|
* @param {Object} payload - The payload containing credential information
|
|
16
16
|
* @returns {Object} - Object with credential fields
|
|
17
17
|
*/
|
|
@@ -20,14 +20,10 @@ const transformCredentialFields = (payload) => {
|
|
|
20
20
|
|
|
21
21
|
if (payload.currentAccessKey) {
|
|
22
22
|
fields['Access Key (current)'] = payload.currentAccessKey;
|
|
23
|
-
} else if (payload.accessKey) {
|
|
24
|
-
fields['Access Key'] = payload.accessKey;
|
|
25
23
|
}
|
|
26
24
|
|
|
27
25
|
if (payload.currentSecretKey) {
|
|
28
26
|
fields['Secret Key (current)'] = payload.currentSecretKey;
|
|
29
|
-
} else if (payload.secretKey) {
|
|
30
|
-
fields['Secret Key'] = payload.secretKey;
|
|
31
27
|
}
|
|
32
28
|
|
|
33
29
|
if (payload.oldAccessKey) {
|
|
@@ -64,9 +60,21 @@ const FASTLY_LOG_FORMAT = `{
|
|
|
64
60
|
const CDN_TRANSFORMATIONS = {
|
|
65
61
|
'byocdn-fastly': (payload) => {
|
|
66
62
|
const authMethodLabel = payload.authMethod === 'iam_role' ? 'IAM Role' : 'User credentials';
|
|
67
|
-
const authFields =
|
|
68
|
-
|
|
69
|
-
|
|
63
|
+
const authFields = {};
|
|
64
|
+
const hasCredentialData = [
|
|
65
|
+
payload.currentAccessKey,
|
|
66
|
+
payload.currentSecretKey,
|
|
67
|
+
payload.oldAccessKey,
|
|
68
|
+
payload.oldSecretKey,
|
|
69
|
+
].some((value) => value);
|
|
70
|
+
|
|
71
|
+
if (payload.authMethod === 'iam_role' && payload.roleArn) {
|
|
72
|
+
authFields['Role ARN'] = payload.roleArn;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if (hasCredentialData) {
|
|
76
|
+
Object.assign(authFields, transformCredentialFields(payload));
|
|
77
|
+
}
|
|
70
78
|
|
|
71
79
|
return {
|
|
72
80
|
'Bucket Name': payload.bucketName,
|
|
@@ -247,11 +255,11 @@ const prettifyLogForwardingConfig = (payload) => {
|
|
|
247
255
|
|
|
248
256
|
if (payload.logSource === 'byocdn-fastly') {
|
|
249
257
|
if (payload.authMethod === 'user_credentials') {
|
|
250
|
-
if (!payload.
|
|
251
|
-
throw new Error('
|
|
258
|
+
if (!payload.currentAccessKey) {
|
|
259
|
+
throw new Error('currentAccessKey is required in payload');
|
|
252
260
|
}
|
|
253
|
-
if (!payload.
|
|
254
|
-
throw new Error('
|
|
261
|
+
if (!payload.currentSecretKey) {
|
|
262
|
+
throw new Error('currentSecretKey is required in payload');
|
|
255
263
|
}
|
|
256
264
|
} else if (payload.authMethod === 'iam_role') {
|
|
257
265
|
if (!payload.roleArn) {
|
|
@@ -261,11 +269,11 @@ const prettifyLogForwardingConfig = (payload) => {
|
|
|
261
269
|
}
|
|
262
270
|
|
|
263
271
|
if (payload.logSource === 'byocdn-akamai' || payload.logSource === 'byocdn-other') {
|
|
264
|
-
if (!payload.
|
|
265
|
-
throw new Error('
|
|
272
|
+
if (!payload.currentAccessKey) {
|
|
273
|
+
throw new Error('currentAccessKey is required in payload');
|
|
266
274
|
}
|
|
267
|
-
if (!payload.
|
|
268
|
-
throw new Error('
|
|
275
|
+
if (!payload.currentSecretKey) {
|
|
276
|
+
throw new Error('currentSecretKey is required in payload');
|
|
269
277
|
}
|
|
270
278
|
}
|
|
271
279
|
|