@adobe/spacecat-shared-http-utils 1.18.2 → 1.19.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 CHANGED
@@ -1,3 +1,17 @@
1
+ # [@adobe/spacecat-shared-http-utils-v1.19.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-http-utils-v1.19.0...@adobe/spacecat-shared-http-utils-v1.19.1) (2025-11-28)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * update to node 24 ([#1179](https://github.com/adobe/spacecat-shared/issues/1179)) ([0e60c0a](https://github.com/adobe/spacecat-shared/commit/0e60c0ab791b47662d07822f7c93009a8f7048fd))
7
+
8
+ # [@adobe/spacecat-shared-http-utils-v1.19.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-http-utils-v1.18.2...@adobe/spacecat-shared-http-utils-v1.19.0) (2025-11-20)
9
+
10
+
11
+ ### Features
12
+
13
+ * **utils,http-utils:** trigger release for trace ID propagation ([#1154](https://github.com/adobe/spacecat-shared/issues/1154)) ([fb48149](https://github.com/adobe/spacecat-shared/commit/fb481497725e49dab18812b4ba1ba7186e35a8f9)), closes [#1152](https://github.com/adobe/spacecat-shared/issues/1152) [#1152](https://github.com/adobe/spacecat-shared/issues/1152) [#1097](https://github.com/adobe/spacecat-shared/issues/1097) [#1097](https://github.com/adobe/spacecat-shared/issues/1097) [#1097](https://github.com/adobe/spacecat-shared/issues/1097) [#1152](https://github.com/adobe/spacecat-shared/issues/1152) [adobe/spacecat-audit-worker#1520](https://github.com/adobe/spacecat-audit-worker/issues/1520)
14
+
1
15
  # [@adobe/spacecat-shared-http-utils-v1.18.2](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-http-utils-v1.18.1...@adobe/spacecat-shared-http-utils-v1.18.2) (2025-11-16)
2
16
 
3
17
 
package/README.md CHANGED
@@ -3,6 +3,8 @@
3
3
  A set of TypeScript functions for creating HTTP responses with standardized formats, and classes for dealing with
4
4
  authenticating HTTP requests.
5
5
 
6
+ > **v1.19.0**: Added trace ID extraction from HTTP headers for distributed tracing support.
7
+
6
8
  ## Table of Contents
7
9
 
8
10
  - [Introduction](#introduction)
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@adobe/spacecat-shared-http-utils",
3
- "version": "1.18.2",
3
+ "version": "1.19.1",
4
4
  "description": "Shared modules of the Spacecat Services - HTTP Utils",
5
5
  "type": "module",
6
6
  "engines": {
7
- "node": ">=22.0.0 <23.0.0",
7
+ "node": ">=22.0.0 <25.0.0",
8
8
  "npm": ">=10.9.0 <12.0.0"
9
9
  },
10
10
  "main": "src/index.js",
@@ -35,8 +35,8 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@adobe/fetch": "4.2.3",
38
- "@adobe/spacecat-shared-data-access": "2.45.0",
39
- "@adobe/spacecat-shared-utils": "1.66.0",
38
+ "@adobe/spacecat-shared-data-access": "2.88.3",
39
+ "@adobe/spacecat-shared-utils": "1.81.0",
40
40
  "jose": "6.1.2"
41
41
  },
42
42
  "devDependencies": {
@@ -136,7 +136,7 @@ export default class AdobeImsHandler extends AbstractHandler {
136
136
  throw new Error('expires_in and created_at claims must be numbers');
137
137
  }
138
138
 
139
- if (createdAt >= now) {
139
+ if (createdAt > now) {
140
140
  throw new Error('created_at should be in the past');
141
141
  }
142
142
 
@@ -13,14 +13,23 @@
13
13
  export function enrichPathInfo(fn) { // export for testing
14
14
  return async (request, context) => {
15
15
  const [, route] = context?.pathInfo?.suffix?.split(/\/+/) || [];
16
+ const headers = request.headers.plain();
17
+
16
18
  context.pathInfo = {
17
19
  ...context.pathInfo,
18
20
  ...{
19
21
  method: request.method.toUpperCase(),
20
- headers: request.headers.plain(),
22
+ headers,
21
23
  route,
22
24
  },
23
25
  };
26
+
27
+ // Extract and store traceId from x-trace-id header if present
28
+ const traceIdHeader = headers['x-trace-id'];
29
+ if (traceIdHeader) {
30
+ context.traceId = traceIdHeader;
31
+ }
32
+
24
33
  return fn(request, context);
25
34
  };
26
35
  }