@zlink-systems/stream-connector 0.30.1 → 0.30.3
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/dist/browser/index.global.js +11 -3
- package/dist/browser/index.mjs +11 -3
- package/package.json +2 -2
|
@@ -871,9 +871,9 @@ var ZlinkStreamConnectorBundle = (() => {
|
|
|
871
871
|
if (typeof value !== "string" || !BASE64_PATTERN.test(value)) {
|
|
872
872
|
schemaFailure(path, "padded RFC 4648 base64");
|
|
873
873
|
}
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
return decode ?
|
|
874
|
+
if (!hasCanonicalBase64Padding(value))
|
|
875
|
+
schemaFailure(path, "canonical padded RFC 4648 base64");
|
|
876
|
+
return decode ? decodeBase64(value) : value;
|
|
877
877
|
}
|
|
878
878
|
case "enum":
|
|
879
879
|
if (typeof value !== "string" || !schema.names.includes(value)) {
|
|
@@ -1059,6 +1059,14 @@ var ZlinkStreamConnectorBundle = (() => {
|
|
|
1059
1059
|
}
|
|
1060
1060
|
};
|
|
1061
1061
|
var BASE64_STRING_CHUNK_BYTES = 8192;
|
|
1062
|
+
var BASE64_ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
1063
|
+
function hasCanonicalBase64Padding(value) {
|
|
1064
|
+
if (value.endsWith("=="))
|
|
1065
|
+
return (BASE64_ALPHABET.indexOf(value.charAt(value.length - 3)) & 15) === 0;
|
|
1066
|
+
if (value.endsWith("="))
|
|
1067
|
+
return (BASE64_ALPHABET.indexOf(value.charAt(value.length - 2)) & 3) === 0;
|
|
1068
|
+
return true;
|
|
1069
|
+
}
|
|
1062
1070
|
function encodeBase64(bytes) {
|
|
1063
1071
|
let binary = "";
|
|
1064
1072
|
for (let offset = 0; offset < bytes.length; offset += BASE64_STRING_CHUNK_BYTES) {
|
package/dist/browser/index.mjs
CHANGED
|
@@ -826,9 +826,9 @@ function validateFrameworkJsonV1Value(value, schema, path, decode) {
|
|
|
826
826
|
if (typeof value !== "string" || !BASE64_PATTERN.test(value)) {
|
|
827
827
|
schemaFailure(path, "padded RFC 4648 base64");
|
|
828
828
|
}
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
return decode ?
|
|
829
|
+
if (!hasCanonicalBase64Padding(value))
|
|
830
|
+
schemaFailure(path, "canonical padded RFC 4648 base64");
|
|
831
|
+
return decode ? decodeBase64(value) : value;
|
|
832
832
|
}
|
|
833
833
|
case "enum":
|
|
834
834
|
if (typeof value !== "string" || !schema.names.includes(value)) {
|
|
@@ -1013,6 +1013,14 @@ var JsonPropertyScanner = class {
|
|
|
1013
1013
|
}
|
|
1014
1014
|
};
|
|
1015
1015
|
var BASE64_STRING_CHUNK_BYTES = 8192;
|
|
1016
|
+
var BASE64_ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
1017
|
+
function hasCanonicalBase64Padding(value) {
|
|
1018
|
+
if (value.endsWith("=="))
|
|
1019
|
+
return (BASE64_ALPHABET.indexOf(value.charAt(value.length - 3)) & 15) === 0;
|
|
1020
|
+
if (value.endsWith("="))
|
|
1021
|
+
return (BASE64_ALPHABET.indexOf(value.charAt(value.length - 2)) & 3) === 0;
|
|
1022
|
+
return true;
|
|
1023
|
+
}
|
|
1016
1024
|
function encodeBase64(bytes) {
|
|
1017
1025
|
let binary = "";
|
|
1018
1026
|
for (let offset = 0; offset < bytes.length; offset += BASE64_STRING_CHUNK_BYTES) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zlink-systems/stream-connector",
|
|
3
|
-
"version": "0.30.
|
|
3
|
+
"version": "0.30.3",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -22,6 +22,6 @@
|
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@zlink-systems/stream-wire": "0.30.
|
|
25
|
+
"@zlink-systems/stream-wire": "0.30.3"
|
|
26
26
|
}
|
|
27
27
|
}
|