@forge/manifest 12.1.0-next.1 → 12.1.0-next.2

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,5 +1,11 @@
1
1
  # @forge/manifest
2
2
 
3
+ ## 12.1.0-next.2
4
+
5
+ ### Minor Changes
6
+
7
+ - e4c143c: Do not allow wildcard remote endpoints
8
+
3
9
  ## 12.1.0-next.1
4
10
 
5
11
  ### Patch Changes
@@ -28,9 +28,9 @@ class PermissionsValidator {
28
28
  remotesHasValidEntryForKey(remoteMap, key) {
29
29
  return (remoteMap !== undefined &&
30
30
  remoteMap.has(key) &&
31
- (remoteMap.get(key) === null || this.isValidURL(remoteMap.get(key))));
31
+ (remoteMap.get(key) === null || this.isValidURL(remoteMap.get(key), false)));
32
32
  }
33
- isValidURL(inputURL) {
33
+ isValidURL(inputURL, allowGlobalUrl) {
34
34
  const protocolRegex = /^(.*?:\/\/)/;
35
35
  const validURI = /^(\*\.)?[.a-zA-Z0-9_\-\/:~#%?=&]+$/;
36
36
  const allowedProtocols = ['https:', 'wss:'];
@@ -38,8 +38,8 @@ class PermissionsValidator {
38
38
  if (inputURL.length > MAX_URL_LENGTH) {
39
39
  return false;
40
40
  }
41
- if (inputURL === '*') {
42
- return true;
41
+ if (inputURL === egress_types_1.GLOBAL_URL) {
42
+ return allowGlobalUrl;
43
43
  }
44
44
  const customURLSchemeRegex = /^[a-zA-Z]+:(\\\\)?/;
45
45
  if (customURLSchemeRegex.test(inputURL) &&
@@ -81,7 +81,7 @@ class PermissionsValidator {
81
81
  });
82
82
  }
83
83
  validateExternalPermissionURLs(result, extPermType, perms, manifest) {
84
- const invalidPerms = perms?.filter((key) => !this.isValidURL(key));
84
+ const invalidPerms = perms?.filter((key) => !this.isValidURL(key, true));
85
85
  if (invalidPerms?.length) {
86
86
  this.addValidationErrors(result, extPermType, invalidPerms, manifest);
87
87
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/manifest",
3
- "version": "12.1.0-next.1",
3
+ "version": "12.1.0-next.2",
4
4
  "description": "Definitions and validations of the Forge manifest",
5
5
  "main": "out/index.js",
6
6
  "scripts": {