@fedify/fedify 0.8.0-dev.152 → 0.8.0-dev.154
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/CHANGES.md +1 -0
- package/esm/deps/jsr.io/@std/bytes/{0.220.1 → 0.224.0}/concat.js +12 -8
- package/esm/deps/jsr.io/@std/bytes/0.224.0/copy.js +48 -0
- package/esm/deps/jsr.io/@std/bytes/0.224.0/ends_with.js +32 -0
- package/esm/deps/jsr.io/@std/bytes/0.224.0/equals.js +81 -0
- package/esm/deps/jsr.io/@std/bytes/0.224.0/includes_needle.js +39 -0
- package/esm/deps/jsr.io/@std/bytes/0.224.0/index_of_needle.js +66 -0
- package/esm/deps/jsr.io/@std/bytes/0.224.0/last_index_of_needle.js +63 -0
- package/esm/deps/jsr.io/@std/bytes/0.224.0/mod.js +151 -0
- package/esm/deps/jsr.io/@std/bytes/0.224.0/repeat.js +36 -0
- package/esm/deps/jsr.io/@std/bytes/0.224.0/starts_with.js +30 -0
- package/esm/deps/jsr.io/@std/encoding/{0.220.1 → 0.224.0}/base64.js +19 -2
- package/esm/deps/jsr.io/@std/encoding/{0.220.1 → 0.224.0}/hex.js +2 -7
- package/esm/deps/jsr.io/@std/semver/{0.220.1/test_range.js → 0.224.0/_test_comparator_set.js} +5 -16
- package/esm/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/can_parse.js +1 -0
- package/esm/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/constants.js +0 -2
- package/esm/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/equals.js +1 -0
- package/esm/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/format.js +2 -3
- package/esm/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/format_range.js +3 -2
- package/esm/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/greater_than.js +1 -0
- package/esm/deps/jsr.io/@std/semver/0.224.0/greater_than_range.js +39 -0
- package/esm/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/increment.js +1 -0
- package/esm/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/is_range.js +2 -2
- package/esm/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/is_semver.js +1 -0
- package/esm/deps/jsr.io/@std/semver/0.224.0/less_than_range.js +39 -0
- package/esm/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/max_satisfying.js +2 -2
- package/esm/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/min_satisfying.js +2 -2
- package/esm/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/mod.js +3 -0
- package/esm/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/parse_range.js +2 -1
- package/esm/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/range_intersects.js +4 -3
- package/esm/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/range_max.js +13 -5
- package/esm/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/range_min.js +13 -5
- package/esm/deps/jsr.io/@std/semver/0.224.0/satisfies.js +11 -0
- package/esm/deps/jsr.io/@std/semver/0.224.0/test_range.js +13 -0
- package/esm/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/try_parse_range.js +1 -0
- package/esm/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/types.js +1 -0
- package/esm/federation/collection.js +1 -1
- package/esm/federation/handler.js +1 -1
- package/esm/federation/send.js +7 -1
- package/esm/httpsig/mod.js +74 -17
- package/esm/nodeinfo/types.js +1 -1
- package/esm/runtime/docloader.js +1 -1
- package/esm/runtime/key.js +1 -1
- package/package.json +2 -2
- package/types/deps/jsr.io/@std/assert/0.224.0/_constants.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/0.224.0/assert.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/0.224.0/assert_almost_equals.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/0.224.0/assert_array_includes.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/0.224.0/assert_equals.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/0.224.0/assert_exists.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/0.224.0/assert_false.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/0.224.0/assert_greater.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/0.224.0/assert_greater_or_equal.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/0.224.0/assert_instance_of.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/0.224.0/assert_is_error.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/0.224.0/assert_less.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/0.224.0/assert_less_or_equal.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/0.224.0/assert_match.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/0.224.0/assert_not_equals.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/0.224.0/assert_not_instance_of.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/0.224.0/assert_not_match.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/0.224.0/assert_not_strict_equals.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/0.224.0/assert_object_match.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/0.224.0/assert_rejects.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/0.224.0/assert_strict_equals.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/0.224.0/assert_string_includes.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/0.224.0/assert_throws.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/0.224.0/assertion_error.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/0.224.0/equal.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/0.224.0/fail.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/0.224.0/mod.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/0.224.0/unimplemented.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/0.224.0/unreachable.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/async/{0.220.1 → 0.224.0}/delay.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/bytes/0.224.0/concat.d.ts +18 -0
- package/types/deps/jsr.io/@std/bytes/0.224.0/concat.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/bytes/0.224.0/copy.d.ts +39 -0
- package/types/deps/jsr.io/@std/bytes/0.224.0/copy.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/bytes/0.224.0/ends_with.d.ts +23 -0
- package/types/deps/jsr.io/@std/bytes/0.224.0/ends_with.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/bytes/0.224.0/equals.d.ts +21 -0
- package/types/deps/jsr.io/@std/bytes/0.224.0/equals.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/bytes/0.224.0/includes_needle.d.ts +35 -0
- package/types/deps/jsr.io/@std/bytes/0.224.0/includes_needle.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/bytes/0.224.0/index_of_needle.d.ts +43 -0
- package/types/deps/jsr.io/@std/bytes/0.224.0/index_of_needle.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/bytes/0.224.0/last_index_of_needle.d.ts +40 -0
- package/types/deps/jsr.io/@std/bytes/0.224.0/last_index_of_needle.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/bytes/0.224.0/mod.d.ts +150 -0
- package/types/deps/jsr.io/@std/bytes/0.224.0/mod.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/bytes/0.224.0/repeat.d.ts +24 -0
- package/types/deps/jsr.io/@std/bytes/0.224.0/repeat.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/bytes/0.224.0/starts_with.d.ts +23 -0
- package/types/deps/jsr.io/@std/bytes/0.224.0/starts_with.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/encoding/{0.220.1 → 0.224.0}/_util.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/encoding/{0.220.1 → 0.224.0}/base64.d.ts +8 -2
- package/types/deps/jsr.io/@std/encoding/0.224.0/base64.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/encoding/0.224.0/hex.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/fmt/0.224.0/colors.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/fs/{0.220.1 → 0.224.0}/_get_file_info_type.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/fs/{0.220.1 → 0.224.0}/_to_path_string.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/fs/0.224.0/ensure_dir.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/fs/0.224.0/ensure_file.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/http/{0.220.1 → 0.224.0}/_negotiation/common.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/http/{0.220.1 → 0.224.0}/_negotiation/encoding.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/http/{0.220.1 → 0.224.0}/_negotiation/language.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/http/{0.220.1 → 0.224.0}/_negotiation/media_type.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/http/{0.220.1 → 0.224.0}/negotiation.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/internal/0.224.0/diff.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/internal/0.224.0/format.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/internal/0.224.0/mod.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/_common/assert_path.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/_common/basename.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/_common/common.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/_common/constants.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/_common/dirname.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/_common/format.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/_common/from_file_url.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/_common/glob_to_reg_exp.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/_common/normalize.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/_common/normalize_string.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/_common/relative.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/_common/strip_trailing_separators.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/_common/to_file_url.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/0.224.0/_interface.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/_os.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/0.224.0/basename.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/common.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/constants.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/dirname.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/extname.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/0.224.0/format.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/from_file_url.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/glob_to_regexp.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/is_absolute.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/is_glob.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/join.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/join_globs.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/mod.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/normalize.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/normalize_glob.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/0.224.0/parse.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/posix/_util.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/posix/basename.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/posix/common.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/posix/constants.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/posix/dirname.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/posix/extname.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/posix/format.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/posix/from_file_url.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/posix/glob_to_regexp.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/posix/is_absolute.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/posix/is_glob.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/posix/join.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/posix/join_globs.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/posix/mod.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/posix/normalize.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/posix/normalize_glob.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/0.224.0/posix/parse.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/posix/relative.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/posix/resolve.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/posix/to_file_url.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/posix/to_namespaced_path.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/relative.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/resolve.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/to_file_url.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/to_namespaced_path.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/windows/_util.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/0.224.0/windows/basename.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/windows/common.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/windows/constants.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/windows/dirname.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/windows/extname.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/windows/format.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/windows/from_file_url.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/windows/glob_to_regexp.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/windows/is_absolute.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/windows/is_glob.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/windows/join.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/windows/join_globs.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/windows/mod.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/windows/normalize.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/windows/normalize_glob.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/0.224.0/windows/parse.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/windows/relative.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/windows/resolve.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/windows/to_file_url.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/path/{0.220.1 → 0.224.0}/windows/to_namespaced_path.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/semver/0.224.0/_constants.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/_shared.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/semver/0.224.0/_test_comparator_set.d.ts +3 -0
- package/types/deps/jsr.io/@std/semver/0.224.0/_test_comparator_set.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/0.224.0/can_parse.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/0.224.0/compare.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/constants.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/semver/0.224.0/difference.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/0.224.0/equals.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/0.224.0/format.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/0.224.0/format_range.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/0.224.0/greater_or_equal.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/0.224.0/greater_than.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/0.224.0/greater_than_range.d.ts +4 -0
- package/types/deps/jsr.io/@std/semver/0.224.0/greater_than_range.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/increment.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/semver/0.224.0/is_range.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/0.224.0/is_semver.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/0.224.0/less_or_equal.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/0.224.0/less_than.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/0.224.0/less_than_range.d.ts +4 -0
- package/types/deps/jsr.io/@std/semver/0.224.0/less_than_range.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/max_satisfying.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/min_satisfying.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/mod.d.ts +3 -0
- package/types/deps/jsr.io/@std/semver/0.224.0/mod.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/0.224.0/not_equals.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/0.224.0/parse.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/0.224.0/parse_range.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/0.224.0/range_intersects.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/0.224.0/range_max.d.ts +14 -0
- package/types/deps/jsr.io/@std/semver/0.224.0/range_max.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/0.224.0/range_min.d.ts +14 -0
- package/types/deps/jsr.io/@std/semver/0.224.0/range_min.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/{0.220.1/test_range.d.ts → 0.224.0/satisfies.d.ts} +2 -2
- package/types/deps/jsr.io/@std/semver/0.224.0/satisfies.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/0.224.0/test_range.d.ts +12 -0
- package/types/deps/jsr.io/@std/semver/0.224.0/test_range.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/0.224.0/try_parse.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/0.224.0/try_parse_range.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/types.d.ts +0 -4
- package/types/deps/jsr.io/@std/semver/0.224.0/types.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/testing/{0.220.1 → 0.224.0}/snapshot.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/text/{0.220.1 → 0.224.0}/_util.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/text/{0.220.1 → 0.224.0}/case.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/text/{0.220.1 → 0.224.0}/closest_string.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/text/{0.220.1 → 0.224.0}/compare_similarity.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/text/0.224.0/levenshtein_distance.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/text/{0.220.1 → 0.224.0}/mod.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/text/{0.220.1 → 0.224.0}/word_similarity_sort.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/url/{0.220.1 → 0.224.0}/_strip.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/url/0.224.0/basename.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/url/0.224.0/dirname.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/url/0.224.0/extname.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/url/0.224.0/join.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/url/0.224.0/mod.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/url/{0.220.1 → 0.224.0}/normalize.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.220.1 → 0.224.0}/_dumper/dumper.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.220.1 → 0.224.0}/_dumper/dumper_state.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.220.1 → 0.224.0}/_error.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.220.1 → 0.224.0}/_loader/loader.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.220.1 → 0.224.0}/_loader/loader_state.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.220.1 → 0.224.0}/_mark.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.220.1 → 0.224.0}/_state.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.220.1 → 0.224.0}/_type/binary.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.220.1 → 0.224.0}/_type/bool.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.220.1 → 0.224.0}/_type/float.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.220.1 → 0.224.0}/_type/function.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.220.1 → 0.224.0}/_type/int.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.220.1 → 0.224.0}/_type/map.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.220.1 → 0.224.0}/_type/merge.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.220.1 → 0.224.0}/_type/mod.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.220.1 → 0.224.0}/_type/nil.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.220.1 → 0.224.0}/_type/omap.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.220.1 → 0.224.0}/_type/pairs.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.220.1 → 0.224.0}/_type/regexp.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.220.1 → 0.224.0}/_type/seq.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.220.1 → 0.224.0}/_type/set.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.220.1 → 0.224.0}/_type/str.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.220.1 → 0.224.0}/_type/timestamp.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.220.1 → 0.224.0}/_type/undefined.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.220.1 → 0.224.0}/_utils.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.220.1 → 0.224.0}/mod.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.220.1 → 0.224.0}/parse.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/0.224.0/schema/core.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/yaml/0.224.0/schema/default.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/yaml/{0.220.1 → 0.224.0}/schema/extended.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/0.224.0/schema/failsafe.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/yaml/{0.220.1 → 0.224.0}/schema/json.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/0.224.0/schema/mod.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/yaml/{0.220.1 → 0.224.0}/schema.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.220.1 → 0.224.0}/stringify.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.220.1 → 0.224.0}/type.d.ts.map +1 -1
- package/types/federation/send.d.ts.map +1 -1
- package/types/httpsig/mod.d.ts.map +1 -1
- package/types/nodeinfo/types.d.ts +1 -1
- package/esm/deps/jsr.io/@std/bytes/0.220.1/copy.js +0 -37
- package/esm/deps/jsr.io/@std/bytes/0.220.1/ends_with.js +0 -23
- package/esm/deps/jsr.io/@std/bytes/0.220.1/equals.js +0 -44
- package/esm/deps/jsr.io/@std/bytes/0.220.1/includes_needle.js +0 -21
- package/esm/deps/jsr.io/@std/bytes/0.220.1/index_of_needle.js +0 -45
- package/esm/deps/jsr.io/@std/bytes/0.220.1/last_index_of_needle.js +0 -45
- package/esm/deps/jsr.io/@std/bytes/0.220.1/mod.js +0 -25
- package/esm/deps/jsr.io/@std/bytes/0.220.1/repeat.js +0 -33
- package/esm/deps/jsr.io/@std/bytes/0.220.1/starts_with.js +0 -21
- package/types/deps/jsr.io/@std/bytes/0.220.1/concat.d.ts +0 -14
- package/types/deps/jsr.io/@std/bytes/0.220.1/concat.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/bytes/0.220.1/copy.d.ts +0 -28
- package/types/deps/jsr.io/@std/bytes/0.220.1/copy.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/bytes/0.220.1/ends_with.d.ts +0 -14
- package/types/deps/jsr.io/@std/bytes/0.220.1/ends_with.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/bytes/0.220.1/equals.d.ts +0 -6
- package/types/deps/jsr.io/@std/bytes/0.220.1/equals.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/bytes/0.220.1/includes_needle.d.ts +0 -17
- package/types/deps/jsr.io/@std/bytes/0.220.1/includes_needle.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/bytes/0.220.1/index_of_needle.d.ts +0 -18
- package/types/deps/jsr.io/@std/bytes/0.220.1/index_of_needle.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/bytes/0.220.1/last_index_of_needle.d.ts +0 -18
- package/types/deps/jsr.io/@std/bytes/0.220.1/last_index_of_needle.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/bytes/0.220.1/mod.d.ts +0 -24
- package/types/deps/jsr.io/@std/bytes/0.220.1/mod.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/bytes/0.220.1/repeat.d.ts +0 -15
- package/types/deps/jsr.io/@std/bytes/0.220.1/repeat.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/bytes/0.220.1/starts_with.d.ts +0 -14
- package/types/deps/jsr.io/@std/bytes/0.220.1/starts_with.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/encoding/0.220.1/base64.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/encoding/0.220.1/hex.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/fs/0.220.1/ensure_dir.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/fs/0.220.1/ensure_file.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/path/0.220.1/_interface.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/path/0.220.1/basename.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/path/0.220.1/format.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/path/0.220.1/parse.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/path/0.220.1/posix/parse.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/path/0.220.1/windows/basename.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/path/0.220.1/windows/parse.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.220.1/_constants.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.220.1/can_parse.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.220.1/compare.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.220.1/difference.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.220.1/equals.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.220.1/format.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.220.1/format_range.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.220.1/greater_or_equal.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.220.1/greater_than.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.220.1/is_range.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.220.1/is_semver.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.220.1/less_or_equal.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.220.1/less_than.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.220.1/mod.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.220.1/not_equals.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.220.1/parse.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.220.1/parse_range.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.220.1/range_intersects.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.220.1/range_max.d.ts +0 -8
- package/types/deps/jsr.io/@std/semver/0.220.1/range_max.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.220.1/range_min.d.ts +0 -8
- package/types/deps/jsr.io/@std/semver/0.220.1/range_min.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.220.1/test_range.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.220.1/try_parse.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.220.1/try_parse_range.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.220.1/types.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/text/0.220.1/levenshtein_distance.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/url/0.220.1/basename.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/url/0.220.1/dirname.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/url/0.220.1/extname.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/url/0.220.1/join.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/url/0.220.1/mod.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/yaml/0.220.1/schema/core.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/yaml/0.220.1/schema/default.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/yaml/0.220.1/schema/failsafe.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/yaml/0.220.1/schema/mod.d.ts.map +0 -1
- /package/esm/deps/jsr.io/@std/encoding/{0.220.1 → 0.224.0}/_util.js +0 -0
- /package/esm/deps/jsr.io/@std/http/{0.220.1 → 0.224.0}/_negotiation/common.js +0 -0
- /package/esm/deps/jsr.io/@std/http/{0.220.1 → 0.224.0}/_negotiation/encoding.js +0 -0
- /package/esm/deps/jsr.io/@std/http/{0.220.1 → 0.224.0}/_negotiation/language.js +0 -0
- /package/esm/deps/jsr.io/@std/http/{0.220.1 → 0.224.0}/_negotiation/media_type.js +0 -0
- /package/esm/deps/jsr.io/@std/http/{0.220.1 → 0.224.0}/negotiation.js +0 -0
- /package/esm/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/_constants.js +0 -0
- /package/esm/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/_shared.js +0 -0
- /package/esm/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/compare.js +0 -0
- /package/esm/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/difference.js +0 -0
- /package/esm/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/greater_or_equal.js +0 -0
- /package/esm/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/less_or_equal.js +0 -0
- /package/esm/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/less_than.js +0 -0
- /package/esm/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/not_equals.js +0 -0
- /package/esm/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/parse.js +0 -0
- /package/esm/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/try_parse.js +0 -0
- /package/types/deps/jsr.io/@std/encoding/{0.220.1 → 0.224.0}/_util.d.ts +0 -0
- /package/types/deps/jsr.io/@std/encoding/{0.220.1 → 0.224.0}/hex.d.ts +0 -0
- /package/types/deps/jsr.io/@std/http/{0.220.1 → 0.224.0}/_negotiation/common.d.ts +0 -0
- /package/types/deps/jsr.io/@std/http/{0.220.1 → 0.224.0}/_negotiation/encoding.d.ts +0 -0
- /package/types/deps/jsr.io/@std/http/{0.220.1 → 0.224.0}/_negotiation/language.d.ts +0 -0
- /package/types/deps/jsr.io/@std/http/{0.220.1 → 0.224.0}/_negotiation/media_type.d.ts +0 -0
- /package/types/deps/jsr.io/@std/http/{0.220.1 → 0.224.0}/negotiation.d.ts +0 -0
- /package/types/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/_constants.d.ts +0 -0
- /package/types/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/_shared.d.ts +0 -0
- /package/types/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/can_parse.d.ts +0 -0
- /package/types/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/compare.d.ts +0 -0
- /package/types/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/constants.d.ts +0 -0
- /package/types/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/difference.d.ts +0 -0
- /package/types/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/equals.d.ts +0 -0
- /package/types/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/format.d.ts +0 -0
- /package/types/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/format_range.d.ts +0 -0
- /package/types/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/greater_or_equal.d.ts +0 -0
- /package/types/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/greater_than.d.ts +0 -0
- /package/types/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/increment.d.ts +0 -0
- /package/types/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/is_range.d.ts +0 -0
- /package/types/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/is_semver.d.ts +0 -0
- /package/types/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/less_or_equal.d.ts +0 -0
- /package/types/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/less_than.d.ts +0 -0
- /package/types/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/max_satisfying.d.ts +0 -0
- /package/types/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/min_satisfying.d.ts +0 -0
- /package/types/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/not_equals.d.ts +0 -0
- /package/types/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/parse.d.ts +0 -0
- /package/types/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/parse_range.d.ts +0 -0
- /package/types/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/range_intersects.d.ts +0 -0
- /package/types/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/try_parse.d.ts +0 -0
- /package/types/deps/jsr.io/@std/semver/{0.220.1 → 0.224.0}/try_parse_range.d.ts +0 -0
package/esm/deps/jsr.io/@std/semver/{0.220.1/test_range.js → 0.224.0/_test_comparator_set.js}
RENAMED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
2
2
|
import { isWildcardComparator } from "./_shared.js";
|
|
3
|
+
import { compare } from "./compare.js";
|
|
3
4
|
function testComparator(version, comparator) {
|
|
4
5
|
if (isWildcardComparator(comparator)) {
|
|
5
6
|
return true;
|
|
6
7
|
}
|
|
7
|
-
const cmp = compare(version, comparator
|
|
8
|
+
const cmp = compare(version, comparator);
|
|
8
9
|
switch (comparator.operator) {
|
|
9
10
|
case "=":
|
|
10
11
|
case undefined: {
|
|
@@ -27,7 +28,7 @@ function testComparator(version, comparator) {
|
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
|
-
function testComparatorSet(version, set) {
|
|
31
|
+
export function testComparatorSet(version, set) {
|
|
31
32
|
for (const comparator of set) {
|
|
32
33
|
if (!testComparator(version, comparator)) {
|
|
33
34
|
return false;
|
|
@@ -43,11 +44,8 @@ function testComparatorSet(version, set) {
|
|
|
43
44
|
if (isWildcardComparator(comparator)) {
|
|
44
45
|
continue;
|
|
45
46
|
}
|
|
46
|
-
const { prerelease } = comparator
|
|
47
|
+
const { major, minor, patch, prerelease } = comparator;
|
|
47
48
|
if (prerelease && prerelease.length > 0) {
|
|
48
|
-
const major = comparator.semver?.major ?? comparator.major;
|
|
49
|
-
const minor = comparator.semver?.minor ?? comparator.minor;
|
|
50
|
-
const patch = comparator.semver?.patch ?? comparator.patch;
|
|
51
49
|
if (version.major === major && version.minor === minor &&
|
|
52
50
|
version.patch === patch) {
|
|
53
51
|
return true;
|
|
@@ -58,12 +56,3 @@ function testComparatorSet(version, set) {
|
|
|
58
56
|
}
|
|
59
57
|
return true;
|
|
60
58
|
}
|
|
61
|
-
/**
|
|
62
|
-
* Test to see if the version satisfies the range.
|
|
63
|
-
* @param version The version to test
|
|
64
|
-
* @param range The range to check
|
|
65
|
-
* @returns true if the version is in the range
|
|
66
|
-
*/
|
|
67
|
-
export function testRange(version, range) {
|
|
68
|
-
return range.some((set) => testComparatorSet(version, set));
|
|
69
|
-
}
|
|
@@ -61,7 +61,6 @@ export const ANY = {
|
|
|
61
61
|
export const ALL = {
|
|
62
62
|
operator: undefined,
|
|
63
63
|
...ANY,
|
|
64
|
-
semver: ANY,
|
|
65
64
|
};
|
|
66
65
|
/**
|
|
67
66
|
* A comparator which will not span any semantic versions
|
|
@@ -69,5 +68,4 @@ export const ALL = {
|
|
|
69
68
|
export const NONE = {
|
|
70
69
|
operator: "<",
|
|
71
70
|
...MIN,
|
|
72
|
-
semver: MIN,
|
|
73
71
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
2
3
|
import { compare } from "./compare.js";
|
|
3
4
|
/**
|
|
4
5
|
* Returns `true` if both semantic versions are logically equivalent, even if they're not the exact same version object.
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { ANY } from "./constants.js";
|
|
1
|
+
import { isWildcardComparator } from "./_shared.js";
|
|
3
2
|
function formatNumber(value) {
|
|
4
3
|
if (value === Number.POSITIVE_INFINITY) {
|
|
5
4
|
return "∞";
|
|
@@ -22,7 +21,7 @@ function formatNumber(value) {
|
|
|
22
21
|
* @returns The string representation of a semantic version.
|
|
23
22
|
*/
|
|
24
23
|
export function format(semver) {
|
|
25
|
-
if (semver
|
|
24
|
+
if (isWildcardComparator(semver)) {
|
|
26
25
|
return "*";
|
|
27
26
|
}
|
|
28
27
|
const major = formatNumber(semver.major);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
2
3
|
import { format } from "./format.js";
|
|
3
4
|
function formatComparator(comparator) {
|
|
4
|
-
const {
|
|
5
|
-
return `${operator === undefined ? "" : operator}${format(
|
|
5
|
+
const { operator } = comparator;
|
|
6
|
+
return `${operator === undefined ? "" : operator}${format(comparator)}`;
|
|
6
7
|
}
|
|
7
8
|
/**
|
|
8
9
|
* Formats the range into a string
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
import { testComparatorSet } from "./_test_comparator_set.js";
|
|
4
|
+
import { isWildcardComparator } from "./_shared.js";
|
|
5
|
+
import { compare } from "./compare.js";
|
|
6
|
+
/** Check if the semver is greater than the range. */
|
|
7
|
+
export function greaterThanRange(semver, range) {
|
|
8
|
+
return range.every((comparatorSet) => greaterThanComparatorSet(semver, comparatorSet));
|
|
9
|
+
}
|
|
10
|
+
function greaterThanComparatorSet(semver, comparatorSet) {
|
|
11
|
+
// If the comparator set contains wildcard, then the semver is not greater than the range.
|
|
12
|
+
if (comparatorSet.some(isWildcardComparator))
|
|
13
|
+
return false;
|
|
14
|
+
// If the semver satisfies the comparator set, then it's not greater than the range.
|
|
15
|
+
if (testComparatorSet(semver, comparatorSet))
|
|
16
|
+
return false;
|
|
17
|
+
// If the semver is less than any of the comparator set, then it's not greater than the range.
|
|
18
|
+
if (comparatorSet.some((comparator) => lessThanComparator(semver, comparator)))
|
|
19
|
+
return false;
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
function lessThanComparator(semver, comparator) {
|
|
23
|
+
const cmp = compare(semver, comparator);
|
|
24
|
+
switch (comparator.operator) {
|
|
25
|
+
case "=":
|
|
26
|
+
case undefined:
|
|
27
|
+
return cmp < 0;
|
|
28
|
+
case "!=":
|
|
29
|
+
return false;
|
|
30
|
+
case ">":
|
|
31
|
+
return cmp <= 0;
|
|
32
|
+
case "<":
|
|
33
|
+
return false;
|
|
34
|
+
case ">=":
|
|
35
|
+
return cmp < 0;
|
|
36
|
+
case "<=":
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -7,10 +7,10 @@ function isComparator(value) {
|
|
|
7
7
|
return false;
|
|
8
8
|
if (value === NONE || value === ALL)
|
|
9
9
|
return true;
|
|
10
|
-
const { operator
|
|
10
|
+
const { operator } = value;
|
|
11
11
|
return ((operator === undefined ||
|
|
12
12
|
OPERATORS.includes(operator)) &&
|
|
13
|
-
isSemVer(
|
|
13
|
+
isSemVer(value));
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
16
|
* Does a deep check on the object to determine if its a valid range.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
import { testComparatorSet } from "./_test_comparator_set.js";
|
|
4
|
+
import { isWildcardComparator } from "./_shared.js";
|
|
5
|
+
import { compare } from "./compare.js";
|
|
6
|
+
/** Check if the semver is less than the range. */
|
|
7
|
+
export function lessThanRange(semver, range) {
|
|
8
|
+
return range.every((comparatorSet) => lessThanComparatorSet(semver, comparatorSet));
|
|
9
|
+
}
|
|
10
|
+
function lessThanComparatorSet(semver, comparatorSet) {
|
|
11
|
+
// If the comparator set contains wildcard, then the semver is not greater than the range.
|
|
12
|
+
if (comparatorSet.some(isWildcardComparator))
|
|
13
|
+
return false;
|
|
14
|
+
// If the semver satisfies the comparator set, then it's not less than the range.
|
|
15
|
+
if (testComparatorSet(semver, comparatorSet))
|
|
16
|
+
return false;
|
|
17
|
+
// If the semver is greater than any of the comparator set, then it's not less than the range.
|
|
18
|
+
if (comparatorSet.some((comparator) => greaterThanComparator(semver, comparator)))
|
|
19
|
+
return false;
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
function greaterThanComparator(semver, comparator) {
|
|
23
|
+
const cmp = compare(semver, comparator);
|
|
24
|
+
switch (comparator.operator) {
|
|
25
|
+
case "=":
|
|
26
|
+
case undefined:
|
|
27
|
+
return cmp > 0;
|
|
28
|
+
case "!=":
|
|
29
|
+
return false;
|
|
30
|
+
case ">":
|
|
31
|
+
return false;
|
|
32
|
+
case "<":
|
|
33
|
+
return cmp >= 0;
|
|
34
|
+
case ">=":
|
|
35
|
+
return false;
|
|
36
|
+
case "<=":
|
|
37
|
+
return cmp > 0;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { satisfies } from "./satisfies.js";
|
|
2
2
|
import { greaterThan } from "./greater_than.js";
|
|
3
3
|
/**
|
|
4
4
|
* Returns the highest version in the list that satisfies the range, or `undefined`
|
|
@@ -10,7 +10,7 @@ import { greaterThan } from "./greater_than.js";
|
|
|
10
10
|
export function maxSatisfying(versions, range) {
|
|
11
11
|
let max;
|
|
12
12
|
for (const version of versions) {
|
|
13
|
-
if (!
|
|
13
|
+
if (!satisfies(version, range))
|
|
14
14
|
continue;
|
|
15
15
|
max = max && greaterThan(max, version) ? max : version;
|
|
16
16
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { satisfies } from "./satisfies.js";
|
|
2
2
|
import { lessThan } from "./less_than.js";
|
|
3
3
|
/**
|
|
4
4
|
* Returns the lowest version in the list that satisfies the range, or `undefined` if
|
|
@@ -10,7 +10,7 @@ import { lessThan } from "./less_than.js";
|
|
|
10
10
|
export function minSatisfying(versions, range) {
|
|
11
11
|
let min;
|
|
12
12
|
for (const version of versions) {
|
|
13
|
-
if (!
|
|
13
|
+
if (!satisfies(version, range))
|
|
14
14
|
continue;
|
|
15
15
|
min = min && lessThan(min, version) ? min : version;
|
|
16
16
|
}
|
|
@@ -269,6 +269,7 @@ export * from "./constants.js";
|
|
|
269
269
|
export * from "./difference.js";
|
|
270
270
|
export * from "./format.js";
|
|
271
271
|
export * from "./test_range.js";
|
|
272
|
+
export * from "./satisfies.js";
|
|
272
273
|
export * from "./increment.js";
|
|
273
274
|
export * from "./is_semver.js";
|
|
274
275
|
export * from "./max_satisfying.js";
|
|
@@ -287,7 +288,9 @@ export * from "./format_range.js";
|
|
|
287
288
|
export * from "./equals.js";
|
|
288
289
|
export * from "./not_equals.js";
|
|
289
290
|
export * from "./greater_than.js";
|
|
291
|
+
export * from "./greater_than_range.js";
|
|
290
292
|
export * from "./greater_or_equal.js";
|
|
291
293
|
export * from "./less_than.js";
|
|
294
|
+
export * from "./less_than_range.js";
|
|
292
295
|
export * from "./less_or_equal.js";
|
|
293
296
|
export const SEMVER_SPEC_VERSION = "2.0.0";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
2
3
|
import { COMPARATOR_REGEXP, OPERATOR_XRANGE_REGEXP, parseBuild, parseNumber, parsePrerelease, XRANGE, } from "./_shared.js";
|
|
3
4
|
import { ALL, ANY, NONE } from "./constants.js";
|
|
4
5
|
function parseComparator(comparator) {
|
|
@@ -16,7 +17,7 @@ function parseComparator(comparator) {
|
|
|
16
17
|
build: buildmetadata ? parseBuild(buildmetadata) : [],
|
|
17
18
|
}
|
|
18
19
|
: ANY;
|
|
19
|
-
return { operator: operator || undefined, ...semver
|
|
20
|
+
return { operator: operator || undefined, ...semver };
|
|
20
21
|
}
|
|
21
22
|
function isWildcard(id) {
|
|
22
23
|
return !id || id.toLowerCase() === "x" || id === "*";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
2
3
|
import { isWildcardComparator } from "./_shared.js";
|
|
3
4
|
import { compare } from "./compare.js";
|
|
4
|
-
import {
|
|
5
|
+
import { satisfies } from "./satisfies.js";
|
|
5
6
|
function comparatorIntersects(c0, c1) {
|
|
6
7
|
const op0 = c0.operator;
|
|
7
8
|
const op1 = c1.operator;
|
|
@@ -9,12 +10,12 @@ function comparatorIntersects(c0, c1) {
|
|
|
9
10
|
// if c0 is empty comparator, then returns true
|
|
10
11
|
if (isWildcardComparator(c0))
|
|
11
12
|
return true;
|
|
12
|
-
return
|
|
13
|
+
return satisfies(c0, [[c1]]);
|
|
13
14
|
}
|
|
14
15
|
if (op1 === undefined) {
|
|
15
16
|
if (isWildcardComparator(c1))
|
|
16
17
|
return true;
|
|
17
|
-
return
|
|
18
|
+
return satisfies(c1, [[c0]]);
|
|
18
19
|
}
|
|
19
20
|
const cmp = compare(c0, c1);
|
|
20
21
|
const sameDirectionIncreasing = (op0 === ">=" || op0 === ">") &&
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
2
|
-
|
|
3
|
-
import {
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
import { INVALID, MAX } from "./constants.js";
|
|
4
|
+
import { satisfies } from "./satisfies.js";
|
|
4
5
|
import { greaterThan } from "./greater_than.js";
|
|
6
|
+
import { isWildcardComparator } from "./_shared.js";
|
|
5
7
|
function comparatorMax(comparator) {
|
|
6
|
-
const semver = comparator
|
|
7
|
-
if (
|
|
8
|
+
const semver = comparator;
|
|
9
|
+
if (isWildcardComparator(comparator))
|
|
8
10
|
return MAX;
|
|
9
11
|
switch (comparator.operator) {
|
|
10
12
|
case "!=":
|
|
@@ -40,6 +42,12 @@ function comparatorMax(comparator) {
|
|
|
40
42
|
}
|
|
41
43
|
}
|
|
42
44
|
/**
|
|
45
|
+
* @deprecated This will be removed in 1.0.0. Use {@linkcode greaterThanRange} or
|
|
46
|
+
* {@linkcode lessThanRange} for comparing ranges and semvers. The maximum
|
|
47
|
+
* version of a range is often not well defined, and therefore this API
|
|
48
|
+
* shouldn't be used. See
|
|
49
|
+
* {@link https://github.com/denoland/deno_std/issues/4365} for details.
|
|
50
|
+
*
|
|
43
51
|
* The maximum valid SemVer for a given range or INVALID
|
|
44
52
|
* @param range The range to calculate the max for
|
|
45
53
|
* @returns A valid SemVer or INVALID
|
|
@@ -49,7 +57,7 @@ export function rangeMax(range) {
|
|
|
49
57
|
for (const comparators of range) {
|
|
50
58
|
for (const comparator of comparators) {
|
|
51
59
|
const candidate = comparatorMax(comparator);
|
|
52
|
-
if (!
|
|
60
|
+
if (!satisfies(candidate, range))
|
|
53
61
|
continue;
|
|
54
62
|
max = (max && greaterThan(max, candidate)) ? max : candidate;
|
|
55
63
|
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
2
|
-
|
|
3
|
-
import {
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
import { INVALID, MAX, MIN } from "./constants.js";
|
|
4
|
+
import { satisfies } from "./satisfies.js";
|
|
4
5
|
import { lessThan } from "./less_than.js";
|
|
5
6
|
import { greaterThan } from "./greater_than.js";
|
|
6
7
|
import { increment } from "./increment.js";
|
|
8
|
+
import { isWildcardComparator } from "./_shared.js";
|
|
7
9
|
function comparatorMin(comparator) {
|
|
8
|
-
const semver = comparator
|
|
9
|
-
if (semver
|
|
10
|
+
const semver = comparator;
|
|
11
|
+
if (isWildcardComparator(semver))
|
|
10
12
|
return MIN;
|
|
11
13
|
switch (comparator.operator) {
|
|
12
14
|
case ">":
|
|
@@ -31,6 +33,12 @@ function comparatorMin(comparator) {
|
|
|
31
33
|
}
|
|
32
34
|
}
|
|
33
35
|
/**
|
|
36
|
+
* @deprecated This will be removed in 1.0.0. Use {@linkcode greaterThanRange} or
|
|
37
|
+
* {@linkcode lessThanRange} for comparing ranges and semvers. The minimum
|
|
38
|
+
* version of a range is often not well defined, and therefore this API
|
|
39
|
+
* shouldn't be used. See
|
|
40
|
+
* {@link https://github.com/denoland/deno_std/issues/4365} for details.
|
|
41
|
+
*
|
|
34
42
|
* The minimum valid SemVer for a given range or INVALID
|
|
35
43
|
* @param range The range to calculate the min for
|
|
36
44
|
* @returns A valid SemVer or INVALID
|
|
@@ -40,7 +48,7 @@ export function rangeMin(range) {
|
|
|
40
48
|
for (const comparators of range) {
|
|
41
49
|
for (const comparator of comparators) {
|
|
42
50
|
const candidate = comparatorMin(comparator);
|
|
43
|
-
if (!
|
|
51
|
+
if (!satisfies(candidate, range))
|
|
44
52
|
continue;
|
|
45
53
|
min = (min && lessThan(min, candidate)) ? min : candidate;
|
|
46
54
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
import { testComparatorSet } from "./_test_comparator_set.js";
|
|
3
|
+
/**
|
|
4
|
+
* Test to see if the version satisfies the range.
|
|
5
|
+
* @param version The version to test
|
|
6
|
+
* @param range The range to check
|
|
7
|
+
* @returns true if the version is in the range
|
|
8
|
+
*/
|
|
9
|
+
export function satisfies(version, range) {
|
|
10
|
+
return range.some((set) => testComparatorSet(version, set));
|
|
11
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { satisfies } from "./satisfies.js";
|
|
2
|
+
/**
|
|
3
|
+
* Test to see if the version satisfies the range.
|
|
4
|
+
* @param version The version to test
|
|
5
|
+
* @param range The range to check
|
|
6
|
+
* @returns true if the version is in the range
|
|
7
|
+
*
|
|
8
|
+
* @deprecated This will be removed in 1.0.0. Use {@linkcode satisfies}
|
|
9
|
+
* instead. See https://github.com/denoland/deno_std/pull/4364.
|
|
10
|
+
*/
|
|
11
|
+
export function testRange(version, range) {
|
|
12
|
+
return satisfies(version, range);
|
|
13
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as dntShim from "../_dnt.shims.js";
|
|
2
2
|
import { getLogger } from "@logtape/logtape";
|
|
3
|
-
import { accepts } from "../deps/jsr.io/@std/http/0.
|
|
3
|
+
import { accepts } from "../deps/jsr.io/@std/http/0.224.0/negotiation.js";
|
|
4
4
|
import { doesActorOwnKey, verify } from "../httpsig/mod.js";
|
|
5
5
|
import { Activity, Link, Object, OrderedCollection, OrderedCollectionPage, } from "../vocab/vocab.js";
|
|
6
6
|
export function acceptsJsonLd(request) {
|
package/esm/federation/send.js
CHANGED
|
@@ -42,7 +42,13 @@ export async function sendActivity({ activity, privateKey, keyId, inbox, documen
|
|
|
42
42
|
request = await sign(request, privateKey, keyId);
|
|
43
43
|
const response = await fetch(request);
|
|
44
44
|
if (!response.ok) {
|
|
45
|
-
|
|
45
|
+
let error;
|
|
46
|
+
try {
|
|
47
|
+
error = await response.text();
|
|
48
|
+
}
|
|
49
|
+
catch (_) {
|
|
50
|
+
error = "";
|
|
51
|
+
}
|
|
46
52
|
logger.error("Failed to send activity {activityId} to {inbox} ({status} " +
|
|
47
53
|
"{statusText}):\n{error}", {
|
|
48
54
|
activityId: activity.id?.href,
|
package/esm/httpsig/mod.js
CHANGED
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
* @module
|
|
6
6
|
*/
|
|
7
7
|
import * as dntShim from "../_dnt.shims.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { getLogger } from "@logtape/logtape";
|
|
9
|
+
import { equals } from "../deps/jsr.io/@std/bytes/0.224.0/mod.js";
|
|
10
|
+
import { decodeBase64, encodeBase64 } from "../deps/jsr.io/@std/encoding/0.224.0/base64.js";
|
|
10
11
|
import { isActor } from "../vocab/actor.js";
|
|
11
12
|
import { CryptographicKey, Object as ASObject, } from "../vocab/vocab.js";
|
|
12
13
|
import { validateCryptoKey } from "./key.js";
|
|
@@ -73,16 +74,22 @@ const supportedHashAlgorithms = {
|
|
|
73
74
|
* could not be verified.
|
|
74
75
|
*/
|
|
75
76
|
export async function verify(request, documentLoader, currentTime) {
|
|
77
|
+
const logger = getLogger(["fedify", "httpsig", "verify"]);
|
|
76
78
|
request = request.clone();
|
|
77
79
|
const dateHeader = request.headers.get("Date");
|
|
78
|
-
if (dateHeader == null)
|
|
80
|
+
if (dateHeader == null) {
|
|
81
|
+
logger.debug("Failed to verify; no Date header found.", { headers: Object.fromEntries(request.headers.entries()) });
|
|
79
82
|
return null;
|
|
83
|
+
}
|
|
80
84
|
const sigHeader = request.headers.get("Signature");
|
|
81
|
-
if (sigHeader == null)
|
|
85
|
+
if (sigHeader == null) {
|
|
86
|
+
logger.debug("Failed to verify; no Signature header found.", { headers: Object.fromEntries(request.headers.entries()) });
|
|
82
87
|
return null;
|
|
88
|
+
}
|
|
83
89
|
const digestHeader = request.headers.get("Digest");
|
|
84
90
|
if (request.method !== "GET" && request.method !== "HEAD" &&
|
|
85
91
|
digestHeader == null) {
|
|
92
|
+
logger.debug("Failed to verify; no Digest header found.", { headers: Object.fromEntries(request.headers.entries()) });
|
|
86
93
|
return null;
|
|
87
94
|
}
|
|
88
95
|
let body = null;
|
|
@@ -96,30 +103,60 @@ export async function verify(request, documentLoader, currentTime) {
|
|
|
96
103
|
continue;
|
|
97
104
|
const digest = decodeBase64(digestBase64);
|
|
98
105
|
const expectedDigest = await dntShim.crypto.subtle.digest(supportedHashAlgorithms[algo], body);
|
|
99
|
-
if (!equals(digest, new Uint8Array(expectedDigest)))
|
|
106
|
+
if (!equals(digest, new Uint8Array(expectedDigest))) {
|
|
107
|
+
logger.debug("Failed to verify; digest mismatch ({algorithm}): " +
|
|
108
|
+
"{digest} != {expectedDigest}.", {
|
|
109
|
+
algorithm: algo,
|
|
110
|
+
digest: digestBase64,
|
|
111
|
+
expectedDigest: encodeBase64(expectedDigest),
|
|
112
|
+
});
|
|
100
113
|
return null;
|
|
114
|
+
}
|
|
101
115
|
matched = true;
|
|
102
116
|
}
|
|
103
|
-
if (!matched)
|
|
117
|
+
if (!matched) {
|
|
118
|
+
logger.debug("Failed to verify; no supported digest algorithm found. " +
|
|
119
|
+
"Supported: {supportedAlgorithms}; found: {algorithms}.", {
|
|
120
|
+
supportedAlgorithms: Object.keys(supportedHashAlgorithms),
|
|
121
|
+
algorithms: digests.map(([algo]) => algo),
|
|
122
|
+
});
|
|
104
123
|
return null;
|
|
124
|
+
}
|
|
105
125
|
}
|
|
106
126
|
const date = dntShim.Temporal.Instant.from(new Date(dateHeader).toISOString());
|
|
107
127
|
const now = currentTime ?? dntShim.Temporal.Now.instant();
|
|
108
128
|
if (dntShim.Temporal.Instant.compare(date, now.add({ seconds: 30 })) > 0) {
|
|
109
|
-
|
|
129
|
+
logger.debug("Failed to verify; Date is too far in the future.", { date: date.toString(), now: now.toString() });
|
|
110
130
|
return null;
|
|
111
131
|
}
|
|
112
132
|
else if (dntShim.Temporal.Instant.compare(date, now.subtract({ seconds: 30 })) < 0) {
|
|
113
|
-
|
|
133
|
+
logger.debug("Failed to verify; Date is too far in the past.", { date: date.toString(), now: now.toString() });
|
|
114
134
|
return null;
|
|
115
135
|
}
|
|
116
136
|
const sigValues = Object.fromEntries(sigHeader.split(",").map((pair) => pair.match(/^\s*([A-Za-z]+)="([^"]*)"\s*$/)).filter((m) => m != null).map((m) => m.slice(1, 3)));
|
|
117
|
-
if (!("keyId" in sigValues
|
|
118
|
-
"
|
|
137
|
+
if (!("keyId" in sigValues)) {
|
|
138
|
+
logger.debug("Failed to verify; no keyId field found in the Signature header.", { signature: sigHeader });
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
141
|
+
else if (!("headers" in sigValues)) {
|
|
142
|
+
logger.debug("Failed to verify; no headers field found in the Signature header.", { signature: sigHeader });
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
else if (!("signature" in sigValues)) {
|
|
146
|
+
logger.debug("Failed to verify; no signature field found in the Signature header.", { signature: sigHeader });
|
|
119
147
|
return null;
|
|
120
148
|
}
|
|
121
149
|
const { keyId, headers, signature } = sigValues;
|
|
122
|
-
|
|
150
|
+
logger.debug("Fetching key {keyId} to verify signature...", { keyId });
|
|
151
|
+
let document;
|
|
152
|
+
try {
|
|
153
|
+
const remoteDocument = await documentLoader(keyId);
|
|
154
|
+
document = remoteDocument.document;
|
|
155
|
+
}
|
|
156
|
+
catch (_) {
|
|
157
|
+
logger.debug("Failed to fetch key {keyId}.", { keyId });
|
|
158
|
+
return null;
|
|
159
|
+
}
|
|
123
160
|
let object;
|
|
124
161
|
try {
|
|
125
162
|
object = await ASObject.fromJsonLd(document, { documentLoader });
|
|
@@ -131,8 +168,10 @@ export async function verify(request, documentLoader, currentTime) {
|
|
|
131
168
|
object = await CryptographicKey.fromJsonLd(document, { documentLoader });
|
|
132
169
|
}
|
|
133
170
|
catch (e) {
|
|
134
|
-
if (e instanceof TypeError)
|
|
171
|
+
if (e instanceof TypeError) {
|
|
172
|
+
logger.debug("Failed to verify; key {keyId} returned an invalid object.", { keyId });
|
|
135
173
|
return null;
|
|
174
|
+
}
|
|
136
175
|
throw e;
|
|
137
176
|
}
|
|
138
177
|
}
|
|
@@ -146,19 +185,31 @@ export async function verify(request, documentLoader, currentTime) {
|
|
|
146
185
|
break;
|
|
147
186
|
}
|
|
148
187
|
}
|
|
149
|
-
if (key == null)
|
|
188
|
+
if (key == null) {
|
|
189
|
+
logger.debug("Failed to verify; object {keyId} returned an {actorType}, " +
|
|
190
|
+
"but has no key matching {keyId}.", { keyId, actorType: object.constructor.name });
|
|
150
191
|
return null;
|
|
192
|
+
}
|
|
151
193
|
}
|
|
152
|
-
else
|
|
194
|
+
else {
|
|
195
|
+
logger.debug("Failed to verify; key {keyId} returned an invalid object.", { keyId });
|
|
153
196
|
return null;
|
|
154
|
-
|
|
197
|
+
}
|
|
198
|
+
if (key.publicKey == null) {
|
|
199
|
+
logger.debug("Failed to verify; key {keyId} has no publicKeyPem field.", { keyId });
|
|
155
200
|
return null;
|
|
201
|
+
}
|
|
156
202
|
const headerNames = headers.split(/\s+/g);
|
|
157
203
|
if (!headerNames.includes("(request-target)") || !headerNames.includes("date")) {
|
|
204
|
+
logger.debug("Failed to verify; required headers missing in the Signature header: " +
|
|
205
|
+
"{headers}.", { headers });
|
|
158
206
|
return null;
|
|
159
207
|
}
|
|
160
|
-
if (body != null && !headerNames.includes("digest"))
|
|
208
|
+
if (body != null && !headerNames.includes("digest")) {
|
|
209
|
+
logger.debug("Failed to verify; required headers missing in the Signature header: " +
|
|
210
|
+
"{headers}.", { headers });
|
|
161
211
|
return null;
|
|
212
|
+
}
|
|
162
213
|
const message = headerNames.map((name) => `${name}: ` +
|
|
163
214
|
(name == "(request-target)"
|
|
164
215
|
? `${request.method.toLowerCase()} ${new URL(request.url).pathname}`
|
|
@@ -168,7 +219,13 @@ export async function verify(request, documentLoader, currentTime) {
|
|
|
168
219
|
const sig = decodeBase64(signature);
|
|
169
220
|
// TODO: support other than RSASSA-PKCS1-v1_5:
|
|
170
221
|
const verified = await dntShim.crypto.subtle.verify("RSASSA-PKCS1-v1_5", key.publicKey, sig, new TextEncoder().encode(message));
|
|
171
|
-
|
|
222
|
+
if (!verified) {
|
|
223
|
+
logger.debug("Failed to verify; signature {signature} is invalid. " +
|
|
224
|
+
"Check if the key is correct or if the signed message is correct. " +
|
|
225
|
+
"The message to sign is:\n{message}", { signature, message });
|
|
226
|
+
return null;
|
|
227
|
+
}
|
|
228
|
+
return key;
|
|
172
229
|
}
|
|
173
230
|
/**
|
|
174
231
|
* Checks if the actor of the given activity owns the specified key.
|
package/esm/nodeinfo/types.js
CHANGED