@adobe/spacecat-shared-http-utils 1.5.0 → 1.6.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 +14 -0
- package/package.json +1 -1
- package/src/auth/handlers/scoped-api-key.js +2 -0
- package/src/index.js +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [@adobe/spacecat-shared-http-utils-v1.6.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-http-utils-v1.6.0...@adobe/spacecat-shared-http-utils-v1.6.1) (2024-08-14)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* add query changes ([#324](https://github.com/adobe/spacecat-shared/issues/324)) ([6104f65](https://github.com/adobe/spacecat-shared/commit/6104f65620f8f020e70494c2c2138ae2afefe15e))
|
|
7
|
+
|
|
8
|
+
# [@adobe/spacecat-shared-http-utils-v1.6.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-http-utils-v1.5.0...@adobe/spacecat-shared-http-utils-v1.6.0) (2024-08-14)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* export ScopedApiKeyHandler ([#323](https://github.com/adobe/spacecat-shared/issues/323)) ([778e19c](https://github.com/adobe/spacecat-shared/commit/778e19c490c7ed63f600afe4ae025356f47218fd))
|
|
14
|
+
|
|
1
15
|
# [@adobe/spacecat-shared-http-utils-v1.5.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-http-utils-v1.4.0...@adobe/spacecat-shared-http-utils-v1.5.0) (2024-08-09)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
|
@@ -43,11 +43,13 @@ export default class ScopedApiKeyHandler extends AbstractHandler {
|
|
|
43
43
|
this.log(`No API key entity found in the data layer for the provided API key: ${apiKeyFromHeader}`, 'error');
|
|
44
44
|
return null;
|
|
45
45
|
}
|
|
46
|
+
this.log(`Valid API key entity found. Id: ${apiKeyEntity.getId()}, name: ${apiKeyEntity.getName()}, scopes: ${apiKeyEntity.getScopes()}`, 'debug');
|
|
46
47
|
|
|
47
48
|
// We have an API key entity, and need to check if it's still valid
|
|
48
49
|
const authInfo = new AuthInfo()
|
|
49
50
|
.withProfile(apiKeyEntity) // Include the API key entity as the profile
|
|
50
51
|
.withType(this.name);
|
|
52
|
+
this.log('Successfully constructed authInfo object', 'debug');
|
|
51
53
|
|
|
52
54
|
// Verify that the api key has not expired or been revoked
|
|
53
55
|
const now = new Date().toISOString();
|
package/src/index.js
CHANGED
|
@@ -14,6 +14,7 @@ import { Response } from '@adobe/fetch';
|
|
|
14
14
|
|
|
15
15
|
import LegacyApiKeyHandler from './auth/handlers/legacy-api-key.js';
|
|
16
16
|
import AdobeImsHandler from './auth/handlers/ims.js';
|
|
17
|
+
import ScopedApiKeyHandler from './auth/handlers/scoped-api-key.js';
|
|
17
18
|
|
|
18
19
|
const HEADER_CONTENT_TYPE = 'content-type';
|
|
19
20
|
const HEADER_ERROR = 'x-error';
|
|
@@ -91,4 +92,4 @@ export { authWrapper } from './auth/auth-wrapper.js';
|
|
|
91
92
|
export { enrichPathInfo } from './enrich-path-info-wrapper.js';
|
|
92
93
|
export { hashWithSHA256 } from './auth/generate-hash.js';
|
|
93
94
|
|
|
94
|
-
export { AdobeImsHandler, LegacyApiKeyHandler };
|
|
95
|
+
export { AdobeImsHandler, ScopedApiKeyHandler, LegacyApiKeyHandler };
|