@cardanowall/poe-standard 0.0.0 → 0.2.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/README.md +19 -14
- package/dist/encoder.cjs.map +1 -1
- package/dist/encoder.js.map +1 -1
- package/dist/error-codes.cjs.map +1 -1
- package/dist/error-codes.js.map +1 -1
- package/dist/index.cjs +6 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -18
- package/dist/index.js.map +1 -1
- package/dist/schema.cjs.map +1 -1
- package/dist/schema.js.map +1 -1
- package/dist/validator.cjs +6 -18
- package/dist/validator.cjs.map +1 -1
- package/dist/validator.js +6 -18
- package/dist/validator.js.map +1 -1
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -1735,7 +1735,7 @@ function decodeCanonicalCbor(bytes) {
|
|
|
1735
1735
|
...r,
|
|
1736
1736
|
rejectStreaming: true,
|
|
1737
1737
|
rejectDuplicateKeys: true,
|
|
1738
|
-
// A
|
|
1738
|
+
// A Label 309 record carries integers, byte/text strings, arrays, maps and
|
|
1739
1739
|
// `null` — and nothing else. Without these rejections the major-type-7
|
|
1740
1740
|
// surface leaks into the decoder: a float16/32/64 that happens to hold an
|
|
1741
1741
|
// integral value (e.g. 1.0) silently decodes to the integer 1 and passes
|
|
@@ -2281,7 +2281,7 @@ function decodeCanonicalCbor2(bytes) {
|
|
|
2281
2281
|
...r,
|
|
2282
2282
|
rejectStreaming: true,
|
|
2283
2283
|
rejectDuplicateKeys: true,
|
|
2284
|
-
// A
|
|
2284
|
+
// A Label 309 record carries integers, byte/text strings, arrays, maps and
|
|
2285
2285
|
// `null` — and nothing else. Without these rejections the major-type-7
|
|
2286
2286
|
// surface leaks into the decoder: a float16/32/64 that happens to hold an
|
|
2287
2287
|
// integral value (e.g. 1.0) silently decodes to the integer 1 and passes
|
|
@@ -2808,11 +2808,7 @@ function validateOneUri(chunks, path, errors) {
|
|
|
2808
2808
|
const uri = reconstructed.uri;
|
|
2809
2809
|
if (uri.includes("#")) {
|
|
2810
2810
|
errors.push(
|
|
2811
|
-
issue(
|
|
2812
|
-
"INVALID_URI",
|
|
2813
|
-
path,
|
|
2814
|
-
"URI contains a fragment identifier ('#'), which is forbidden"
|
|
2815
|
-
)
|
|
2811
|
+
issue("INVALID_URI", path, "URI contains a fragment identifier ('#'), which is forbidden")
|
|
2816
2812
|
);
|
|
2817
2813
|
return;
|
|
2818
2814
|
}
|
|
@@ -2842,21 +2838,13 @@ function validateOneUri(chunks, path, errors) {
|
|
|
2842
2838
|
const cid = slashIdx === -1 ? rest : rest.slice(0, slashIdx);
|
|
2843
2839
|
if (!validateCidProfile(cid)) {
|
|
2844
2840
|
errors.push(
|
|
2845
|
-
issue(
|
|
2846
|
-
"INVALID_URI",
|
|
2847
|
-
path,
|
|
2848
|
-
"ipfs:// URI is not a valid CID under the CIP-309 profile"
|
|
2849
|
-
)
|
|
2841
|
+
issue("INVALID_URI", path, "ipfs:// URI is not a valid CID under the Label 309 profile")
|
|
2850
2842
|
);
|
|
2851
2843
|
}
|
|
2852
2844
|
return;
|
|
2853
2845
|
}
|
|
2854
2846
|
errors.push(
|
|
2855
|
-
issue(
|
|
2856
|
-
"INVALID_URI",
|
|
2857
|
-
path,
|
|
2858
|
-
"unsupported URI scheme; v1 PoE URI set is {ar://, ipfs://}"
|
|
2859
|
-
)
|
|
2847
|
+
issue("INVALID_URI", path, "unsupported URI scheme; v1 PoE URI set is {ar://, ipfs://}")
|
|
2860
2848
|
);
|
|
2861
2849
|
}
|
|
2862
2850
|
function checkItemEnc(item, idx, errors) {
|
|
@@ -2898,7 +2886,7 @@ function checkItemEnc(item, idx, errors) {
|
|
|
2898
2886
|
issue(
|
|
2899
2887
|
"UNAUTHENTICATED_CIPHER_FORBIDDEN",
|
|
2900
2888
|
[...basePath, "aead"],
|
|
2901
|
-
`'${enc.aead}' is an unauthenticated cipher;
|
|
2889
|
+
`'${enc.aead}' is an unauthenticated cipher; Label 309 mandates an authenticated (AEAD) cipher`
|
|
2902
2890
|
)
|
|
2903
2891
|
);
|
|
2904
2892
|
return;
|