@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/validator.js
CHANGED
|
@@ -1625,7 +1625,7 @@ function decodeCanonicalCbor(bytes) {
|
|
|
1625
1625
|
...r,
|
|
1626
1626
|
rejectStreaming: true,
|
|
1627
1627
|
rejectDuplicateKeys: true,
|
|
1628
|
-
// A
|
|
1628
|
+
// A Label 309 record carries integers, byte/text strings, arrays, maps and
|
|
1629
1629
|
// `null` — and nothing else. Without these rejections the major-type-7
|
|
1630
1630
|
// surface leaks into the decoder: a float16/32/64 that happens to hold an
|
|
1631
1631
|
// integral value (e.g. 1.0) silently decodes to the integer 1 and passes
|
|
@@ -2076,7 +2076,7 @@ function decodeCanonicalCbor2(bytes) {
|
|
|
2076
2076
|
...r,
|
|
2077
2077
|
rejectStreaming: true,
|
|
2078
2078
|
rejectDuplicateKeys: true,
|
|
2079
|
-
// A
|
|
2079
|
+
// A Label 309 record carries integers, byte/text strings, arrays, maps and
|
|
2080
2080
|
// `null` — and nothing else. Without these rejections the major-type-7
|
|
2081
2081
|
// surface leaks into the decoder: a float16/32/64 that happens to hold an
|
|
2082
2082
|
// integral value (e.g. 1.0) silently decodes to the integer 1 and passes
|
|
@@ -2590,11 +2590,7 @@ function validateOneUri(chunks, path, errors) {
|
|
|
2590
2590
|
const uri = reconstructed.uri;
|
|
2591
2591
|
if (uri.includes("#")) {
|
|
2592
2592
|
errors.push(
|
|
2593
|
-
issue(
|
|
2594
|
-
"INVALID_URI",
|
|
2595
|
-
path,
|
|
2596
|
-
"URI contains a fragment identifier ('#'), which is forbidden"
|
|
2597
|
-
)
|
|
2593
|
+
issue("INVALID_URI", path, "URI contains a fragment identifier ('#'), which is forbidden")
|
|
2598
2594
|
);
|
|
2599
2595
|
return;
|
|
2600
2596
|
}
|
|
@@ -2624,21 +2620,13 @@ function validateOneUri(chunks, path, errors) {
|
|
|
2624
2620
|
const cid = slashIdx === -1 ? rest : rest.slice(0, slashIdx);
|
|
2625
2621
|
if (!validateCidProfile(cid)) {
|
|
2626
2622
|
errors.push(
|
|
2627
|
-
issue(
|
|
2628
|
-
"INVALID_URI",
|
|
2629
|
-
path,
|
|
2630
|
-
"ipfs:// URI is not a valid CID under the CIP-309 profile"
|
|
2631
|
-
)
|
|
2623
|
+
issue("INVALID_URI", path, "ipfs:// URI is not a valid CID under the Label 309 profile")
|
|
2632
2624
|
);
|
|
2633
2625
|
}
|
|
2634
2626
|
return;
|
|
2635
2627
|
}
|
|
2636
2628
|
errors.push(
|
|
2637
|
-
issue(
|
|
2638
|
-
"INVALID_URI",
|
|
2639
|
-
path,
|
|
2640
|
-
"unsupported URI scheme; v1 PoE URI set is {ar://, ipfs://}"
|
|
2641
|
-
)
|
|
2629
|
+
issue("INVALID_URI", path, "unsupported URI scheme; v1 PoE URI set is {ar://, ipfs://}")
|
|
2642
2630
|
);
|
|
2643
2631
|
}
|
|
2644
2632
|
function checkItemEnc(item, idx, errors) {
|
|
@@ -2680,7 +2668,7 @@ function checkItemEnc(item, idx, errors) {
|
|
|
2680
2668
|
issue(
|
|
2681
2669
|
"UNAUTHENTICATED_CIPHER_FORBIDDEN",
|
|
2682
2670
|
[...basePath, "aead"],
|
|
2683
|
-
`'${enc.aead}' is an unauthenticated cipher;
|
|
2671
|
+
`'${enc.aead}' is an unauthenticated cipher; Label 309 mandates an authenticated (AEAD) cipher`
|
|
2684
2672
|
)
|
|
2685
2673
|
);
|
|
2686
2674
|
return;
|