@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
|
@@ -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
|
|
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
|
}
|