@adobe/spacecat-shared-http-utils 1.9.2 → 1.9.4
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 +14 -0
- package/package.json +2 -2
- package/src/auth/handlers/scoped-api-key.js +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [@adobe/spacecat-shared-http-utils-v1.9.4](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-http-utils-v1.9.3...@adobe/spacecat-shared-http-utils-v1.9.4) (2025-01-11)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **deps:** update dependency @adobe/rum-distiller to v1.15.0 ([#536](https://github.com/adobe/spacecat-shared/issues/536)) ([ff70837](https://github.com/adobe/spacecat-shared/commit/ff70837e4cfb5fda6b7ba4b1369bbfaeb4c30b49)), closes [#8203](https://github.com/adobe/spacecat-shared/issues/8203)
|
|
7
|
+
|
|
8
|
+
# [@adobe/spacecat-shared-http-utils-v1.9.3](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-http-utils-v1.9.2...@adobe/spacecat-shared-http-utils-v1.9.3) (2025-01-06)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* api-key v2 data access ([#526](https://github.com/adobe/spacecat-shared/issues/526)) ([d13f8ae](https://github.com/adobe/spacecat-shared/commit/d13f8aea8f5f1822efd9073b4b4f0b50df6ef5c3))
|
|
14
|
+
|
|
1
15
|
# [@adobe/spacecat-shared-http-utils-v1.9.2](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-http-utils-v1.9.1...@adobe/spacecat-shared-http-utils-v1.9.2) (2024-12-31)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/spacecat-shared-http-utils",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.4",
|
|
4
4
|
"description": "Shared modules of the Spacecat Services - HTTP Utils",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@adobe/fetch": "4.1.11",
|
|
37
37
|
"@adobe/spacecat-shared-utils": "1.25.2",
|
|
38
|
-
"@adobe/spacecat-shared-data-access": "
|
|
38
|
+
"@adobe/spacecat-shared-data-access": "2.0.0",
|
|
39
39
|
"jose": "5.9.6"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
@@ -30,6 +30,8 @@ export default class ScopedApiKeyHandler extends AbstractHandler {
|
|
|
30
30
|
throw new Error('Data access is required');
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
const { ApiKey } = dataAccess;
|
|
34
|
+
|
|
33
35
|
const apiKeyFromHeader = headers['x-api-key'];
|
|
34
36
|
if (!hasText(apiKeyFromHeader)) {
|
|
35
37
|
return null;
|
|
@@ -37,7 +39,7 @@ export default class ScopedApiKeyHandler extends AbstractHandler {
|
|
|
37
39
|
|
|
38
40
|
// Keys are stored by their hash, so we need to hash the key to look it up
|
|
39
41
|
const hashedApiKey = hashWithSHA256(apiKeyFromHeader);
|
|
40
|
-
const apiKeyEntity = await
|
|
42
|
+
const apiKeyEntity = await ApiKey.findByHashedApiKey(hashedApiKey);
|
|
41
43
|
|
|
42
44
|
if (!apiKeyEntity) {
|
|
43
45
|
this.log(`No API key entity found in the data layer for the provided API key: ${apiKeyFromHeader}`, 'error');
|