@adobe/spacecat-shared-data-access 1.40.0 → 1.41.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,10 @@
|
|
|
1
|
+
# [@adobe/spacecat-shared-data-access-v1.41.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.40.0...@adobe/spacecat-shared-data-access-v1.41.0) (2024-08-09)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* Introduce scoped API keys ([#312](https://github.com/adobe/spacecat-shared/issues/312)) ([449d273](https://github.com/adobe/spacecat-shared/commit/449d2736154d7e92fb4a3d1f9f290e15e665aa5e))
|
|
7
|
+
|
|
1
8
|
# [@adobe/spacecat-shared-data-access-v1.40.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.39.1...@adobe/spacecat-shared-data-access-v1.40.0) (2024-08-08)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
package/src/models/api-key.js
CHANGED
|
@@ -82,12 +82,14 @@ export const createApiKey = (data) => {
|
|
|
82
82
|
throw new Error(`Scope name is not part of the pre-defined scopes: ${scope.name}`);
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
if (
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
85
|
+
if (scope.domains) {
|
|
86
|
+
if (!Array.isArray(scope.domains)) {
|
|
87
|
+
throw new Error(`Scope domains should be an array: ${scope.domains}`);
|
|
88
|
+
}
|
|
89
|
+
for (const domain of scope.domains) {
|
|
90
|
+
if (!isValidUrl(domain)) {
|
|
91
|
+
throw new Error(`Invalid domain: ${domain}`);
|
|
92
|
+
}
|
|
91
93
|
}
|
|
92
94
|
}
|
|
93
95
|
}
|