@adobe/spacecat-shared-utils 1.97.0 → 1.98.0

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 CHANGED
@@ -1,3 +1,9 @@
1
+ ## [@adobe/spacecat-shared-utils-v1.98.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.97.0...@adobe/spacecat-shared-utils-v1.98.0) (2026-02-27)
2
+
3
+ ### Features
4
+
5
+ * LLMO-3231 byocdn-fastly default auth method is iam role ([#1384](https://github.com/adobe/spacecat-shared/issues/1384)) ([446dd15](https://github.com/adobe/spacecat-shared/commit/446dd1540040c48181ef9a50093fced93fe92034))
6
+
1
7
  ## [@adobe/spacecat-shared-utils-v1.97.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.96.3...@adobe/spacecat-shared-utils-v1.97.0) (2026-02-27)
2
8
 
3
9
  ### Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/spacecat-shared-utils",
3
- "version": "1.97.0",
3
+ "version": "1.98.0",
4
4
  "description": "Shared modules of the Spacecat Services - utils",
5
5
  "type": "module",
6
6
  "exports": {
@@ -62,24 +62,31 @@ const FASTLY_LOG_FORMAT = `{
62
62
  "time_to_first_byte": "%{time.to_first_byte}V"
63
63
  }`;
64
64
  const CDN_TRANSFORMATIONS = {
65
- 'byocdn-fastly': (payload) => ({
66
- 'Bucket Name': payload.bucketName,
67
- Domain: `s3.${payload.region}.amazonaws.com`,
68
- Path: `${payload.allowedPaths?.[0] || ''}%Y/%m/%d/%H/`,
69
- 'Timestamp Format': '%Y-%m-%dT%H:%M:%S.000',
70
- Placement: 'Format Version Default',
71
- 'Log format': FASTLY_LOG_FORMAT,
72
- 'Access method': 'User credentials',
73
- ...transformCredentialFields(payload),
74
- Period: 300,
75
- 'Log line format': 'Blank',
76
- Compression: 'Gzip',
77
- 'Redundancy level': 'Standard',
78
- ACL: 'None',
79
- 'Server side encryption': 'None',
80
- 'Maximum bytes': 0,
81
- HelpUrl: 'https://www.fastly.com/documentation/guides/integrations/logging-endpoints/log-streaming-amazon-s3/',
82
- }),
65
+ 'byocdn-fastly': (payload) => {
66
+ const authMethodLabel = payload.authMethod === 'iam_role' ? 'IAM Role' : 'User credentials';
67
+ const authFields = payload.authMethod === 'iam_role'
68
+ ? { 'Role ARN': payload.roleArn }
69
+ : transformCredentialFields(payload);
70
+
71
+ return {
72
+ 'Bucket Name': payload.bucketName,
73
+ Domain: `s3.${payload.region}.amazonaws.com`,
74
+ Path: `${payload.allowedPaths?.[0] || ''}%Y/%m/%d/%H/`,
75
+ 'Timestamp Format': '%Y-%m-%dT%H:%M:%S.000',
76
+ Placement: 'Format Version Default',
77
+ 'Log format': FASTLY_LOG_FORMAT,
78
+ 'Access method': authMethodLabel,
79
+ ...authFields,
80
+ Period: 300,
81
+ 'Log line format': 'Blank',
82
+ Compression: 'Gzip',
83
+ 'Redundancy level': 'Standard',
84
+ ACL: 'None',
85
+ 'Server side encryption': 'None',
86
+ 'Maximum bytes': 0,
87
+ HelpUrl: 'https://www.fastly.com/documentation/guides/integrations/logging-endpoints/log-streaming-amazon-s3/',
88
+ };
89
+ },
83
90
  'byocdn-akamai': (payload) => ({
84
91
  'Bucket Name': payload.bucketName,
85
92
  Region: payload.region,
@@ -238,7 +245,22 @@ const prettifyLogForwardingConfig = (payload) => {
238
245
  throw new Error('allowedPaths is required in payload');
239
246
  }
240
247
 
241
- if (payload.logSource === 'byocdn-fastly' || payload.logSource === 'byocdn-akamai' || payload.logSource === 'byocdn-other') {
248
+ if (payload.logSource === 'byocdn-fastly') {
249
+ if (payload.authMethod === 'user_credentials') {
250
+ if (!payload.accessKey && !payload.currentAccessKey) {
251
+ throw new Error('accessKey or currentAccessKey is required in payload');
252
+ }
253
+ if (!payload.secretKey && !payload.currentSecretKey) {
254
+ throw new Error('secretKey or currentSecretKey is required in payload');
255
+ }
256
+ } else if (payload.authMethod === 'iam_role') {
257
+ if (!payload.roleArn) {
258
+ throw new Error('roleArn is required in payload when authMethod is iam_role');
259
+ }
260
+ }
261
+ }
262
+
263
+ if (payload.logSource === 'byocdn-akamai' || payload.logSource === 'byocdn-other') {
242
264
  if (!payload.accessKey && !payload.currentAccessKey) {
243
265
  throw new Error('accessKey or currentAccessKey is required in payload');
244
266
  }