@fedify/fedify 0.9.0-dev.177 → 0.9.0-dev.181
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of @fedify/fedify might be problematic. Click here for more details.
- package/CHANGES.md +13 -0
- package/esm/deps/jsr.io/@std/encoding/{0.224.2 → 0.224.3}/base64.js +14 -7
- package/esm/deps/jsr.io/@std/encoding/{0.224.2 → 0.224.3}/hex.js +24 -7
- package/esm/deps/jsr.io/@std/semver/0.224.1/can_parse.js +30 -0
- package/esm/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/compare.js +17 -0
- package/esm/deps/jsr.io/@std/semver/0.224.1/difference.js +37 -0
- package/esm/deps/jsr.io/@std/semver/0.224.1/equals.js +27 -0
- package/esm/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/format.js +14 -1
- package/esm/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/format_range.js +9 -1
- package/esm/deps/jsr.io/@std/semver/0.224.1/greater_or_equal.js +25 -0
- package/esm/deps/jsr.io/@std/semver/0.224.1/greater_than.js +27 -0
- package/esm/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/greater_than_range.js +19 -1
- package/esm/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/increment.js +18 -2
- package/esm/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/is_range.js +10 -0
- package/esm/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/is_semver.js +16 -0
- package/esm/deps/jsr.io/@std/semver/0.224.1/less_or_equal.js +25 -0
- package/esm/deps/jsr.io/@std/semver/0.224.1/less_than.js +25 -0
- package/esm/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/less_than_range.js +21 -3
- package/esm/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/max_satisfying.js +12 -0
- package/esm/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/min_satisfying.js +12 -0
- package/esm/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/mod.js +3 -2
- package/esm/deps/jsr.io/@std/semver/0.224.1/not_equals.js +24 -0
- package/esm/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/parse.js +16 -0
- package/esm/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/parse_range.js +18 -0
- package/esm/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/range_intersects.js +16 -1
- package/esm/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/range_max.js +16 -5
- package/esm/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/range_min.js +16 -5
- package/esm/deps/jsr.io/@std/semver/0.224.1/satisfies.js +26 -0
- package/esm/deps/jsr.io/@std/semver/0.224.1/test_range.js +28 -0
- package/esm/deps/jsr.io/@std/semver/0.224.1/try_parse.js +30 -0
- package/esm/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/try_parse_range.js +16 -1
- package/esm/federation/collection.js +1 -1
- package/esm/federation/handler.js +1 -1
- package/esm/federation/middleware.js +7 -3
- package/esm/httpsig/mod.js +60 -283
- package/esm/nodeinfo/types.js +1 -1
- package/esm/runtime/docloader.js +3 -3
- package/esm/runtime/key.js +1 -1
- package/esm/sig/http.js +229 -0
- package/esm/{httpsig → sig}/key.js +0 -3
- package/esm/sig/mod.js +8 -0
- package/esm/sig/owner.js +94 -0
- package/esm/vocab/tombstone.yaml +20 -0
- package/esm/vocab/vocab.js +165 -0
- package/package.json +7 -1
- package/types/deps/jsr.io/@std/assert/0.225.3/assert.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/0.225.3/assertion_error.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/encoding/{0.224.2/_util.d.ts → 0.224.3/_validate_binary_like.d.ts} +1 -1
- package/types/deps/jsr.io/@std/encoding/0.224.3/_validate_binary_like.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/encoding/{0.224.2 → 0.224.3}/base64.d.ts +9 -4
- package/types/deps/jsr.io/@std/encoding/0.224.3/base64.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/encoding/0.224.3/hex.d.ts +37 -0
- package/types/deps/jsr.io/@std/encoding/0.224.3/hex.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/http/{0.224.1 → 0.224.2}/_negotiation/common.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/http/{0.224.1 → 0.224.2}/_negotiation/encoding.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/http/{0.224.1 → 0.224.2}/_negotiation/language.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/http/{0.224.1 → 0.224.2}/_negotiation/media_type.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/http/{0.224.1 → 0.224.2}/negotiation.d.ts +27 -6
- package/types/deps/jsr.io/@std/http/0.224.2/negotiation.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/0.224.1/_constants.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/_shared.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/_test_comparator_set.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/semver/0.224.1/can_parse.d.ts +17 -0
- package/types/deps/jsr.io/@std/semver/0.224.1/can_parse.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/0.224.1/compare.d.ts +28 -0
- package/types/deps/jsr.io/@std/semver/0.224.1/compare.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/constants.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/semver/0.224.1/difference.d.ts +27 -0
- package/types/deps/jsr.io/@std/semver/0.224.1/difference.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/0.224.1/equals.d.ts +24 -0
- package/types/deps/jsr.io/@std/semver/0.224.1/equals.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/format.d.ts +14 -1
- package/types/deps/jsr.io/@std/semver/0.224.1/format.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/0.224.1/format_range.d.ts +17 -0
- package/types/deps/jsr.io/@std/semver/0.224.1/format_range.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/0.224.1/greater_or_equal.d.ts +24 -0
- package/types/deps/jsr.io/@std/semver/0.224.1/greater_or_equal.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/0.224.1/greater_than.d.ts +24 -0
- package/types/deps/jsr.io/@std/semver/0.224.1/greater_than.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/0.224.1/greater_than_range.d.ts +22 -0
- package/types/deps/jsr.io/@std/semver/0.224.1/greater_than_range.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/increment.d.ts +18 -2
- package/types/deps/jsr.io/@std/semver/0.224.1/increment.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/is_range.d.ts +10 -0
- package/types/deps/jsr.io/@std/semver/0.224.1/is_range.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/is_semver.d.ts +16 -0
- package/types/deps/jsr.io/@std/semver/0.224.1/is_semver.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/0.224.1/less_or_equal.d.ts +24 -0
- package/types/deps/jsr.io/@std/semver/0.224.1/less_or_equal.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/0.224.1/less_than.d.ts +24 -0
- package/types/deps/jsr.io/@std/semver/0.224.1/less_than.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/0.224.1/less_than_range.d.ts +22 -0
- package/types/deps/jsr.io/@std/semver/0.224.1/less_than_range.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/max_satisfying.d.ts +12 -0
- package/types/deps/jsr.io/@std/semver/0.224.1/max_satisfying.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/min_satisfying.d.ts +12 -0
- package/types/deps/jsr.io/@std/semver/0.224.1/min_satisfying.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/mod.d.ts +3 -2
- package/types/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/mod.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/semver/0.224.1/not_equals.d.ts +23 -0
- package/types/deps/jsr.io/@std/semver/0.224.1/not_equals.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/0.224.1/parse.d.ts +25 -0
- package/types/deps/jsr.io/@std/semver/0.224.1/parse.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/0.224.1/parse_range.d.ts +26 -0
- package/types/deps/jsr.io/@std/semver/0.224.1/parse_range.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/0.224.1/range_intersects.d.ts +24 -0
- package/types/deps/jsr.io/@std/semver/0.224.1/range_intersects.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/range_max.d.ts +16 -5
- package/types/deps/jsr.io/@std/semver/0.224.1/range_max.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/range_min.d.ts +16 -5
- package/types/deps/jsr.io/@std/semver/0.224.1/range_min.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/0.224.1/satisfies.d.ts +24 -0
- package/types/deps/jsr.io/@std/semver/0.224.1/satisfies.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/0.224.1/test_range.d.ts +27 -0
- package/types/deps/jsr.io/@std/semver/0.224.1/test_range.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/0.224.1/try_parse.d.ts +21 -0
- package/types/deps/jsr.io/@std/semver/0.224.1/try_parse.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/0.224.1/try_parse_range.d.ts +23 -0
- package/types/deps/jsr.io/@std/semver/0.224.1/try_parse_range.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/types.d.ts +7 -2
- package/types/deps/jsr.io/@std/semver/0.224.1/types.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/text/{0.224.0 → 0.224.1}/_util.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/text/{0.224.0 → 0.224.1}/case.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/text/0.224.1/closest_string.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/text/0.224.1/compare_similarity.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/text/{0.224.0 → 0.224.1}/levenshtein_distance.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/text/0.224.1/mod.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/text/0.224.1/word_similarity_sort.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_dumper/dumper.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_dumper/dumper_state.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_error.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_loader/loader.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_loader/loader_state.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_mark.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_state.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_type/binary.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_type/bool.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_type/float.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_type/function.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_type/int.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_type/map.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_type/merge.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_type/mod.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_type/nil.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_type/omap.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_type/pairs.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_type/regexp.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_type/seq.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_type/set.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_type/str.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_type/timestamp.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_type/undefined.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/0.224.1/_utils.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/mod.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/parse.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/schema/core.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/schema/default.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/schema/extended.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/schema/failsafe.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/schema/json.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/schema/mod.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/schema.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/stringify.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/type.d.ts.map +1 -1
- package/types/federation/middleware.d.ts.map +1 -1
- package/types/httpsig/mod.d.ts +45 -48
- package/types/httpsig/mod.d.ts.map +1 -1
- package/types/nodeinfo/types.d.ts +1 -1
- package/types/sig/http.d.ts +54 -0
- package/types/sig/http.d.ts.map +1 -0
- package/types/sig/http.test.d.ts.map +1 -0
- package/types/{httpsig → sig}/key.d.ts +0 -3
- package/types/sig/key.d.ts.map +1 -0
- package/types/sig/key.test.d.ts.map +1 -0
- package/types/sig/mod.d.ts +9 -0
- package/types/sig/mod.d.ts.map +1 -0
- package/types/sig/owner.d.ts +50 -0
- package/types/sig/owner.d.ts.map +1 -0
- package/types/sig/owner.test.d.ts.map +1 -0
- package/types/vocab/vocab.d.ts +143 -0
- package/types/vocab/vocab.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/semver/0.224.0/can_parse.js +0 -15
- package/esm/deps/jsr.io/@std/semver/0.224.0/difference.js +0 -16
- package/esm/deps/jsr.io/@std/semver/0.224.0/equals.js +0 -11
- package/esm/deps/jsr.io/@std/semver/0.224.0/greater_or_equal.js +0 -9
- package/esm/deps/jsr.io/@std/semver/0.224.0/greater_than.js +0 -11
- package/esm/deps/jsr.io/@std/semver/0.224.0/less_or_equal.js +0 -9
- package/esm/deps/jsr.io/@std/semver/0.224.0/less_than.js +0 -9
- package/esm/deps/jsr.io/@std/semver/0.224.0/not_equals.js +0 -9
- package/esm/deps/jsr.io/@std/semver/0.224.0/satisfies.js +0 -11
- package/esm/deps/jsr.io/@std/semver/0.224.0/test_range.js +0 -13
- package/esm/deps/jsr.io/@std/semver/0.224.0/try_parse.js +0 -17
- package/types/deps/jsr.io/@std/encoding/0.224.2/_util.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/encoding/0.224.2/base64.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/encoding/0.224.2/hex.d.ts +0 -24
- package/types/deps/jsr.io/@std/encoding/0.224.2/hex.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/http/0.224.1/negotiation.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.224.0/_constants.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.224.0/can_parse.d.ts +0 -2
- package/types/deps/jsr.io/@std/semver/0.224.0/can_parse.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.224.0/compare.d.ts +0 -11
- package/types/deps/jsr.io/@std/semver/0.224.0/compare.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.224.0/difference.d.ts +0 -6
- package/types/deps/jsr.io/@std/semver/0.224.0/difference.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.224.0/equals.d.ts +0 -8
- package/types/deps/jsr.io/@std/semver/0.224.0/equals.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.224.0/format.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.224.0/format_range.d.ts +0 -9
- package/types/deps/jsr.io/@std/semver/0.224.0/format_range.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.224.0/greater_or_equal.d.ts +0 -8
- package/types/deps/jsr.io/@std/semver/0.224.0/greater_or_equal.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.224.0/greater_than.d.ts +0 -8
- package/types/deps/jsr.io/@std/semver/0.224.0/greater_than.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.224.0/greater_than_range.d.ts +0 -4
- package/types/deps/jsr.io/@std/semver/0.224.0/greater_than_range.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.224.0/increment.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.224.0/is_range.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.224.0/is_semver.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.224.0/less_or_equal.d.ts +0 -8
- package/types/deps/jsr.io/@std/semver/0.224.0/less_or_equal.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.224.0/less_than.d.ts +0 -8
- package/types/deps/jsr.io/@std/semver/0.224.0/less_than.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.224.0/less_than_range.d.ts +0 -4
- package/types/deps/jsr.io/@std/semver/0.224.0/less_than_range.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.224.0/max_satisfying.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.224.0/min_satisfying.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.224.0/not_equals.d.ts +0 -8
- package/types/deps/jsr.io/@std/semver/0.224.0/not_equals.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.224.0/parse.d.ts +0 -9
- package/types/deps/jsr.io/@std/semver/0.224.0/parse.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.224.0/parse_range.d.ts +0 -8
- package/types/deps/jsr.io/@std/semver/0.224.0/parse_range.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.224.0/range_intersects.d.ts +0 -9
- package/types/deps/jsr.io/@std/semver/0.224.0/range_intersects.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.224.0/range_max.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.224.0/range_min.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.224.0/satisfies.d.ts +0 -9
- package/types/deps/jsr.io/@std/semver/0.224.0/satisfies.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.224.0/test_range.d.ts +0 -12
- package/types/deps/jsr.io/@std/semver/0.224.0/test_range.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.224.0/try_parse.d.ts +0 -8
- package/types/deps/jsr.io/@std/semver/0.224.0/try_parse.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.224.0/try_parse_range.d.ts +0 -8
- package/types/deps/jsr.io/@std/semver/0.224.0/try_parse_range.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/semver/0.224.0/types.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/text/0.224.0/closest_string.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/text/0.224.0/compare_similarity.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/text/0.224.0/mod.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/text/0.224.0/word_similarity_sort.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/yaml/0.224.0/_utils.d.ts.map +0 -1
- package/types/httpsig/key.d.ts.map +0 -1
- package/types/httpsig/key.test.d.ts.map +0 -1
- /package/esm/deps/jsr.io/@std/encoding/{0.224.2/_util.js → 0.224.3/_validate_binary_like.js} +0 -0
- /package/esm/deps/jsr.io/@std/http/{0.224.1 → 0.224.2}/_negotiation/common.js +0 -0
- /package/esm/deps/jsr.io/@std/http/{0.224.1 → 0.224.2}/_negotiation/encoding.js +0 -0
- /package/esm/deps/jsr.io/@std/http/{0.224.1 → 0.224.2}/_negotiation/language.js +0 -0
- /package/esm/deps/jsr.io/@std/http/{0.224.1 → 0.224.2}/_negotiation/media_type.js +0 -0
- /package/esm/deps/jsr.io/@std/http/{0.224.1 → 0.224.2}/negotiation.js +0 -0
- /package/esm/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/_constants.js +0 -0
- /package/esm/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/_shared.js +0 -0
- /package/esm/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/_test_comparator_set.js +0 -0
- /package/esm/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/constants.js +0 -0
- /package/esm/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/types.js +0 -0
- /package/types/deps/jsr.io/@std/http/{0.224.1 → 0.224.2}/_negotiation/common.d.ts +0 -0
- /package/types/deps/jsr.io/@std/http/{0.224.1 → 0.224.2}/_negotiation/encoding.d.ts +0 -0
- /package/types/deps/jsr.io/@std/http/{0.224.1 → 0.224.2}/_negotiation/language.d.ts +0 -0
- /package/types/deps/jsr.io/@std/http/{0.224.1 → 0.224.2}/_negotiation/media_type.d.ts +0 -0
- /package/types/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/_constants.d.ts +0 -0
- /package/types/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/_shared.d.ts +0 -0
- /package/types/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/_test_comparator_set.d.ts +0 -0
- /package/types/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/constants.d.ts +0 -0
@@ -325,6 +325,24 @@ function parseOperatorRanges(string) {
|
|
325
325
|
}
|
326
326
|
/**
|
327
327
|
* Parses a range string into a Range object or throws a TypeError.
|
328
|
+
*
|
329
|
+
* @example Usage
|
330
|
+
* ```ts
|
331
|
+
* import { parseRange } from "@std/semver/parse-range";
|
332
|
+
* import { assertEquals } from "@std/assert/assert-equals";
|
333
|
+
*
|
334
|
+
* const range = parseRange(">=1.0.0 <2.0.0 || >=3.0.0");
|
335
|
+
* assertEquals(range, [
|
336
|
+
* [
|
337
|
+
* { operator: ">=", major: 1, minor: 0, patch: 0, prerelease: [], build: [] },
|
338
|
+
* { operator: "<", major: 2, minor: 0, patch: 0, prerelease: [], build: [] },
|
339
|
+
* ],
|
340
|
+
* [
|
341
|
+
* { operator: ">=", major: 3, minor: 0, patch: 0, prerelease: [], build: [] },
|
342
|
+
* ]
|
343
|
+
* ]);
|
344
|
+
* ```
|
345
|
+
*
|
328
346
|
* @param range The range set string
|
329
347
|
* @returns A valid semantic range
|
330
348
|
*/
|
@@ -57,9 +57,24 @@ function comparatorsSatisfiable(comparators) {
|
|
57
57
|
}
|
58
58
|
/**
|
59
59
|
* The ranges intersect every range of AND comparators intersects with a least one range of OR ranges.
|
60
|
+
*
|
61
|
+
* @example Usage
|
62
|
+
* ```ts
|
63
|
+
* import { parseRange, rangeIntersects } from "@std/semver";
|
64
|
+
* import { assert, assertFalse } from "@std/assert";
|
65
|
+
*
|
66
|
+
* const r0 = parseRange(">=1.0.0 <2.0.0");
|
67
|
+
* const r1 = parseRange(">=1.0.0 <1.2.3");
|
68
|
+
* const r2 = parseRange(">=1.2.3 <2.0.0");
|
69
|
+
*
|
70
|
+
* assert(rangeIntersects(r0, r1));
|
71
|
+
* assert(rangeIntersects(r0, r2));
|
72
|
+
* assertFalse(rangeIntersects(r1, r2));
|
73
|
+
* ```
|
74
|
+
*
|
60
75
|
* @param r0 range 0
|
61
76
|
* @param r1 range 1
|
62
|
-
* @returns returns true if
|
77
|
+
* @returns returns true if the given ranges intersect, false otherwise
|
63
78
|
*/
|
64
79
|
export function rangeIntersects(r0, r1) {
|
65
80
|
return rangesSatisfiable([r0, r1]) &&
|
@@ -42,15 +42,26 @@ function comparatorMax(comparator) {
|
|
42
42
|
}
|
43
43
|
}
|
44
44
|
/**
|
45
|
+
* The maximum valid SemVer for a given range or INVALID
|
46
|
+
*
|
47
|
+
* @example Usage
|
48
|
+
* ```ts
|
49
|
+
* import { parseRange } from "@std/semver/parse-range";
|
50
|
+
* import { rangeMax } from "@std/semver/range-max";
|
51
|
+
* import { equals } from "@std/semver/equals";
|
52
|
+
* import { assert } from "@std/assert/assert";
|
53
|
+
*
|
54
|
+
* assert(equals(rangeMax(parseRange(">1.0.0 <=2.0.0")), { major: 2, minor: 0, patch: 0 }));
|
55
|
+
* ```
|
56
|
+
*
|
57
|
+
* @param range The range to calculate the max for
|
58
|
+
* @returns A valid SemVer or INVALID
|
59
|
+
*
|
45
60
|
* @deprecated This will be removed in 1.0.0. Use {@linkcode greaterThanRange} or
|
46
|
-
* {@linkcode lessThanRange} for comparing ranges and
|
61
|
+
* {@linkcode lessThanRange} for comparing ranges and SemVers. The maximum
|
47
62
|
* version of a range is often not well defined, and therefore this API
|
48
63
|
* shouldn't be used. See
|
49
64
|
* {@link https://github.com/denoland/deno_std/issues/4365} for details.
|
50
|
-
*
|
51
|
-
* The maximum valid SemVer for a given range or INVALID
|
52
|
-
* @param range The range to calculate the max for
|
53
|
-
* @returns A valid SemVer or INVALID
|
54
65
|
*/
|
55
66
|
export function rangeMax(range) {
|
56
67
|
let max;
|
@@ -33,15 +33,26 @@ function comparatorMin(comparator) {
|
|
33
33
|
}
|
34
34
|
}
|
35
35
|
/**
|
36
|
+
* The minimum valid SemVer for a given range or INVALID
|
37
|
+
*
|
38
|
+
* @example Usage
|
39
|
+
* ```ts
|
40
|
+
* import { parseRange } from "@std/semver/parse-range";
|
41
|
+
* import { rangeMin } from "@std/semver/range-min";
|
42
|
+
* import { equals } from "@std/semver/equals";
|
43
|
+
* import { assert } from "@std/assert/assert";
|
44
|
+
*
|
45
|
+
* assert(equals(rangeMin(parseRange(">=1.0.0 <2.0.0")), { major: 1, minor: 0, patch: 0 }));
|
46
|
+
* ```
|
47
|
+
*
|
48
|
+
* @param range The range to calculate the min for
|
49
|
+
* @returns A valid SemVer or INVALID
|
50
|
+
*
|
36
51
|
* @deprecated This will be removed in 1.0.0. Use {@linkcode greaterThanRange} or
|
37
|
-
* {@linkcode lessThanRange} for comparing ranges and
|
52
|
+
* {@linkcode lessThanRange} for comparing ranges and SemVers. The minimum
|
38
53
|
* version of a range is often not well defined, and therefore this API
|
39
54
|
* shouldn't be used. See
|
40
55
|
* {@link https://github.com/denoland/deno_std/issues/4365} for details.
|
41
|
-
*
|
42
|
-
* The minimum valid SemVer for a given range or INVALID
|
43
|
-
* @param range The range to calculate the min for
|
44
|
-
* @returns A valid SemVer or INVALID
|
45
56
|
*/
|
46
57
|
export function rangeMin(range) {
|
47
58
|
let min;
|
@@ -0,0 +1,26 @@
|
|
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
|
+
*
|
6
|
+
* @example Usage
|
7
|
+
* ```ts
|
8
|
+
* import { parse, parseRange, satisfies } from "@std/semver";
|
9
|
+
* import { assert, assertFalse } from "@std/assert";
|
10
|
+
*
|
11
|
+
* const version = parse("1.2.3");
|
12
|
+
* const range0 = parseRange(">=1.0.0 <2.0.0");
|
13
|
+
* const range1 = parseRange(">=1.0.0 <1.3.0");
|
14
|
+
* const range2 = parseRange(">=1.0.0 <1.2.3");
|
15
|
+
*
|
16
|
+
* assert(satisfies(version, range0));
|
17
|
+
* assert(satisfies(version, range1));
|
18
|
+
* assertFalse(satisfies(version, range2));
|
19
|
+
* ```
|
20
|
+
* @param version The version to test
|
21
|
+
* @param range The range to check
|
22
|
+
* @returns true if the version is in the range
|
23
|
+
*/
|
24
|
+
export function satisfies(version, range) {
|
25
|
+
return range.some((set) => testComparatorSet(version, set));
|
26
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import { satisfies } from "./satisfies.js";
|
2
|
+
/**
|
3
|
+
* Test to see if the version satisfies the range.
|
4
|
+
*
|
5
|
+
* @example Usage
|
6
|
+
* ```ts
|
7
|
+
* import { parse, parseRange, testRange } from "@std/semver";
|
8
|
+
* import { assert, assertFalse } from "@std/assert";
|
9
|
+
*
|
10
|
+
* const version = parse("1.2.3");
|
11
|
+
* const range0 = parseRange(">=1.0.0 <2.0.0");
|
12
|
+
* const range1 = parseRange(">=1.0.0 <1.3.0");
|
13
|
+
* const range2 = parseRange(">=1.0.0 <1.2.3");
|
14
|
+
*
|
15
|
+
* assert(testRange(version, range0));
|
16
|
+
* assert(testRange(version, range1));
|
17
|
+
* assertFalse(testRange(version, range2));
|
18
|
+
* ```
|
19
|
+
* @param version The version to test
|
20
|
+
* @param range The range to check
|
21
|
+
* @returns true if the version is in the range
|
22
|
+
*
|
23
|
+
* @deprecated This will be removed in 1.0.0. Use {@linkcode satisfies}
|
24
|
+
* instead. See https://github.com/denoland/deno_std/pull/4364.
|
25
|
+
*/
|
26
|
+
export function testRange(version, range) {
|
27
|
+
return satisfies(version, range);
|
28
|
+
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import { parse } from "./parse.js";
|
2
|
+
/**
|
3
|
+
* Returns the parsed version, or undefined if it's not valid.
|
4
|
+
*
|
5
|
+
* @example Usage
|
6
|
+
* ```ts
|
7
|
+
* import { tryParse } from "@std/semver/try-parse";
|
8
|
+
* import { assertEquals } from "@std/assert/assert-equals";
|
9
|
+
*
|
10
|
+
* assertEquals(tryParse("1.2.3"), { major: 1, minor: 2, patch: 3, prerelease: [], build: [] });
|
11
|
+
* assertEquals(tryParse("1.2.3-alpha"), { major: 1, minor: 2, patch: 3, prerelease: ["alpha"], build: [] });
|
12
|
+
* assertEquals(tryParse("1.2.3+build"), { major: 1, minor: 2, patch: 3, prerelease: [], build: ["build"] });
|
13
|
+
* assertEquals(tryParse("1.2.3-alpha.1+build.1"), { major: 1, minor: 2, patch: 3, prerelease: ["alpha", 1], build: ["build", "1"] });
|
14
|
+
* assertEquals(tryParse(" invalid "), undefined);
|
15
|
+
* ```
|
16
|
+
*
|
17
|
+
* @param version The version string to parse
|
18
|
+
* @returns A valid SemVer or `undefined`
|
19
|
+
*/
|
20
|
+
export function tryParse(version) {
|
21
|
+
if (version === undefined) {
|
22
|
+
return undefined;
|
23
|
+
}
|
24
|
+
try {
|
25
|
+
return parse(version);
|
26
|
+
}
|
27
|
+
catch {
|
28
|
+
return undefined;
|
29
|
+
}
|
30
|
+
}
|
@@ -2,7 +2,22 @@
|
|
2
2
|
// This module is browser compatible.
|
3
3
|
import { parseRange } from "./parse_range.js";
|
4
4
|
/**
|
5
|
-
*
|
5
|
+
* Parses the given range string and returns a Range object. If the range string
|
6
|
+
* is invalid, `undefined` is returned.
|
7
|
+
*
|
8
|
+
* @example Usage
|
9
|
+
* ```ts
|
10
|
+
* import { tryParseRange } from "@std/semver";
|
11
|
+
* import { assertEquals } from "@std/assert";
|
12
|
+
*
|
13
|
+
* assertEquals(tryParseRange(">=1.2.3 <1.2.4"), [
|
14
|
+
* [
|
15
|
+
* { operator: ">=", major: 1, minor: 2, patch: 3, prerelease: [], build: [] },
|
16
|
+
* { operator: "<", major: 1, minor: 2, patch: 4, prerelease: [], build: [] },
|
17
|
+
* ],
|
18
|
+
* ]);
|
19
|
+
* ```
|
20
|
+
*
|
6
21
|
* @param range The range string
|
7
22
|
* @returns A Range object if valid otherwise `undefined`
|
8
23
|
*/
|
@@ -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.224.
|
3
|
+
import { accepts } from "../deps/jsr.io/@std/http/0.224.2/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) {
|
@@ -1,7 +1,8 @@
|
|
1
1
|
import * as dntShim from "../_dnt.shims.js";
|
2
2
|
import { getLogger } from "@logtape/logtape";
|
3
|
-
import {
|
4
|
-
import {
|
3
|
+
import { verifyRequest } from "../sig/http.js";
|
4
|
+
import { exportJwk, importJwk, validateCryptoKey } from "../sig/key.js";
|
5
|
+
import { getKeyOwner } from "../sig/owner.js";
|
5
6
|
import { handleNodeInfo, handleNodeInfoJrd } from "../nodeinfo/handler.js";
|
6
7
|
import { fetchDocumentLoader, getAuthenticatedDocumentLoader, kvCache, } from "../runtime/docloader.js";
|
7
8
|
import { Activity, CryptographicKey } from "../vocab/mod.js";
|
@@ -381,7 +382,10 @@ export class Federation {
|
|
381
382
|
async getSignedKey() {
|
382
383
|
if (signedKey !== undefined)
|
383
384
|
return signedKey;
|
384
|
-
return signedKey = await
|
385
|
+
return signedKey = await verifyRequest(request, {
|
386
|
+
...context,
|
387
|
+
timeWindow,
|
388
|
+
});
|
385
389
|
},
|
386
390
|
async getSignedKeyOwner() {
|
387
391
|
if (signedKeyOwner !== undefined)
|
package/esm/httpsig/mod.js
CHANGED
@@ -1,18 +1,7 @@
|
|
1
|
-
/**
|
2
|
-
* The implementation of the [HTTP
|
3
|
-
* Signatures](https://datatracker.ietf.org/doc/html/draft-cavage-http-signatures-12).
|
4
|
-
*
|
5
|
-
* @module
|
6
|
-
*/
|
7
|
-
import * as dntShim from "../_dnt.shims.js";
|
8
1
|
import { getLogger } from "@logtape/logtape";
|
9
|
-
import {
|
10
|
-
import {
|
11
|
-
import {
|
12
|
-
import { isActor } from "../vocab/actor.js";
|
13
|
-
import { CryptographicKey, Object as ASObject, } from "../vocab/vocab.js";
|
14
|
-
import { validateCryptoKey } from "./key.js";
|
15
|
-
export { exportJwk, generateCryptoKeyPair, importJwk } from "./key.js";
|
2
|
+
import { signRequest, verifyRequest, } from "../sig/http.js";
|
3
|
+
import { exportJwk as newExportJwk, generateCryptoKeyPair as newGenerateCryptoKeyPair, importJwk as newImportJwk, } from "../sig/key.js";
|
4
|
+
import { doesActorOwnKey as newDoesActorOwnKey, getKeyOwner as newGetKeyOwner, } from "../sig/owner.js";
|
16
5
|
/**
|
17
6
|
* Signs a request using the given private key.
|
18
7
|
* @param request The request to sign.
|
@@ -21,45 +10,12 @@ export { exportJwk, generateCryptoKeyPair, importJwk } from "./key.js";
|
|
21
10
|
* verifier.
|
22
11
|
* @returns The signed request.
|
23
12
|
* @throws {TypeError} If the private key is invalid or unsupported.
|
13
|
+
* @deprecated
|
24
14
|
*/
|
25
|
-
export
|
26
|
-
|
27
|
-
|
28
|
-
const body = request.method !== "GET" && request.method !== "HEAD"
|
29
|
-
? await request.arrayBuffer()
|
30
|
-
: null;
|
31
|
-
const headers = new Headers(request.headers);
|
32
|
-
if (!headers.has("Host")) {
|
33
|
-
headers.set("Host", url.host);
|
34
|
-
}
|
35
|
-
if (!headers.has("Digest") && body != null) {
|
36
|
-
const digest = await dntShim.crypto.subtle.digest("SHA-256", body);
|
37
|
-
headers.set("Digest", `sha-256=${encodeBase64(digest)}`);
|
38
|
-
}
|
39
|
-
if (!headers.has("Date")) {
|
40
|
-
headers.set("Date", new Date().toUTCString());
|
41
|
-
}
|
42
|
-
const serialized = [
|
43
|
-
["(request-target)", `${request.method.toLowerCase()} ${url.pathname}`],
|
44
|
-
...headers,
|
45
|
-
];
|
46
|
-
const headerNames = serialized.map(([name]) => name);
|
47
|
-
const message = serialized
|
48
|
-
.map(([name, value]) => `${name}: ${value.trim()}`).join("\n");
|
49
|
-
// TODO: support other than RSASSA-PKCS1-v1_5:
|
50
|
-
const signature = await dntShim.crypto.subtle.sign("RSASSA-PKCS1-v1_5", privateKey, new TextEncoder().encode(message));
|
51
|
-
const sigHeader = `keyId="${keyId.href}",headers="${headerNames.join(" ")}",signature="${encodeBase64(signature)}"`;
|
52
|
-
headers.set("Signature", sigHeader);
|
53
|
-
return new Request(request, {
|
54
|
-
headers,
|
55
|
-
body,
|
56
|
-
});
|
15
|
+
export function sign(request, privateKey, keyId) {
|
16
|
+
getLogger(["fedify", "httpsig", "sign"]).warn("The sign() function is deprecated. Use signRequest() instead.");
|
17
|
+
return signRequest(request, privateKey, keyId);
|
57
18
|
}
|
58
|
-
const supportedHashAlgorithms = {
|
59
|
-
"sha": "SHA-1",
|
60
|
-
"sha-256": "SHA-256",
|
61
|
-
"sha-512": "SHA-512",
|
62
|
-
};
|
63
19
|
/**
|
64
20
|
* Verifies the signature of a request.
|
65
21
|
*
|
@@ -72,167 +28,11 @@ const supportedHashAlgorithms = {
|
|
72
28
|
* @param options Options for verifying the request.
|
73
29
|
* @returns The public key of the verified signature, or `null` if the signature
|
74
30
|
* could not be verified.
|
31
|
+
* @deprecated
|
75
32
|
*/
|
76
|
-
export
|
77
|
-
|
78
|
-
request
|
79
|
-
const dateHeader = request.headers.get("Date");
|
80
|
-
if (dateHeader == null) {
|
81
|
-
logger.debug("Failed to verify; no Date header found.", { headers: Object.fromEntries(request.headers.entries()) });
|
82
|
-
return null;
|
83
|
-
}
|
84
|
-
const sigHeader = request.headers.get("Signature");
|
85
|
-
if (sigHeader == null) {
|
86
|
-
logger.debug("Failed to verify; no Signature header found.", { headers: Object.fromEntries(request.headers.entries()) });
|
87
|
-
return null;
|
88
|
-
}
|
89
|
-
const digestHeader = request.headers.get("Digest");
|
90
|
-
if (request.method !== "GET" && request.method !== "HEAD" &&
|
91
|
-
digestHeader == null) {
|
92
|
-
logger.debug("Failed to verify; no Digest header found.", { headers: Object.fromEntries(request.headers.entries()) });
|
93
|
-
return null;
|
94
|
-
}
|
95
|
-
let body = null;
|
96
|
-
if (digestHeader != null) {
|
97
|
-
body = await request.arrayBuffer();
|
98
|
-
const digests = digestHeader.split(",").map((pair) => pair.includes("=") ? pair.split("=", 2) : [pair, ""]);
|
99
|
-
let matched = false;
|
100
|
-
for (let [algo, digestBase64] of digests) {
|
101
|
-
algo = algo.trim().toLowerCase();
|
102
|
-
if (!(algo in supportedHashAlgorithms))
|
103
|
-
continue;
|
104
|
-
const digest = decodeBase64(digestBase64);
|
105
|
-
const expectedDigest = await dntShim.crypto.subtle.digest(supportedHashAlgorithms[algo], body);
|
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
|
-
});
|
113
|
-
return null;
|
114
|
-
}
|
115
|
-
matched = true;
|
116
|
-
}
|
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
|
-
});
|
123
|
-
return null;
|
124
|
-
}
|
125
|
-
}
|
126
|
-
const date = dntShim.Temporal.Instant.from(new Date(dateHeader).toISOString());
|
127
|
-
const now = currentTime ?? dntShim.Temporal.Now.instant();
|
128
|
-
const tw = timeWindow ?? { minutes: 1 };
|
129
|
-
if (dntShim.Temporal.Instant.compare(date, now.add(tw)) > 0) {
|
130
|
-
logger.debug("Failed to verify; Date is too far in the future.", { date: date.toString(), now: now.toString() });
|
131
|
-
return null;
|
132
|
-
}
|
133
|
-
else if (dntShim.Temporal.Instant.compare(date, now.subtract(tw)) < 0) {
|
134
|
-
logger.debug("Failed to verify; Date is too far in the past.", { date: date.toString(), now: now.toString() });
|
135
|
-
return null;
|
136
|
-
}
|
137
|
-
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)));
|
138
|
-
if (!("keyId" in sigValues)) {
|
139
|
-
logger.debug("Failed to verify; no keyId field found in the Signature header.", { signature: sigHeader });
|
140
|
-
return null;
|
141
|
-
}
|
142
|
-
else if (!("headers" in sigValues)) {
|
143
|
-
logger.debug("Failed to verify; no headers field found in the Signature header.", { signature: sigHeader });
|
144
|
-
return null;
|
145
|
-
}
|
146
|
-
else if (!("signature" in sigValues)) {
|
147
|
-
logger.debug("Failed to verify; no signature field found in the Signature header.", { signature: sigHeader });
|
148
|
-
return null;
|
149
|
-
}
|
150
|
-
const { keyId, headers, signature } = sigValues;
|
151
|
-
logger.debug("Fetching key {keyId} to verify signature...", { keyId });
|
152
|
-
let document;
|
153
|
-
try {
|
154
|
-
const remoteDocument = await (documentLoader ?? fetchDocumentLoader)(keyId);
|
155
|
-
document = remoteDocument.document;
|
156
|
-
}
|
157
|
-
catch (_) {
|
158
|
-
logger.debug("Failed to fetch key {keyId}.", { keyId });
|
159
|
-
return null;
|
160
|
-
}
|
161
|
-
let object;
|
162
|
-
try {
|
163
|
-
object = await ASObject.fromJsonLd(document, {
|
164
|
-
documentLoader,
|
165
|
-
contextLoader,
|
166
|
-
});
|
167
|
-
}
|
168
|
-
catch (e) {
|
169
|
-
if (!(e instanceof TypeError))
|
170
|
-
throw e;
|
171
|
-
try {
|
172
|
-
object = await CryptographicKey.fromJsonLd(document, {
|
173
|
-
documentLoader,
|
174
|
-
contextLoader,
|
175
|
-
});
|
176
|
-
}
|
177
|
-
catch (e) {
|
178
|
-
if (e instanceof TypeError) {
|
179
|
-
logger.debug("Failed to verify; key {keyId} returned an invalid object.", { keyId });
|
180
|
-
return null;
|
181
|
-
}
|
182
|
-
throw e;
|
183
|
-
}
|
184
|
-
}
|
185
|
-
let key = null;
|
186
|
-
if (object instanceof CryptographicKey)
|
187
|
-
key = object;
|
188
|
-
else if (isActor(object)) {
|
189
|
-
for await (const k of object.getPublicKeys({ documentLoader, contextLoader })) {
|
190
|
-
if (k.id?.href === keyId) {
|
191
|
-
key = k;
|
192
|
-
break;
|
193
|
-
}
|
194
|
-
}
|
195
|
-
if (key == null) {
|
196
|
-
logger.debug("Failed to verify; object {keyId} returned an {actorType}, " +
|
197
|
-
"but has no key matching {keyId}.", { keyId, actorType: object.constructor.name });
|
198
|
-
return null;
|
199
|
-
}
|
200
|
-
}
|
201
|
-
else {
|
202
|
-
logger.debug("Failed to verify; key {keyId} returned an invalid object.", { keyId });
|
203
|
-
return null;
|
204
|
-
}
|
205
|
-
if (key.publicKey == null) {
|
206
|
-
logger.debug("Failed to verify; key {keyId} has no publicKeyPem field.", { keyId });
|
207
|
-
return null;
|
208
|
-
}
|
209
|
-
const headerNames = headers.split(/\s+/g);
|
210
|
-
if (!headerNames.includes("(request-target)") || !headerNames.includes("date")) {
|
211
|
-
logger.debug("Failed to verify; required headers missing in the Signature header: " +
|
212
|
-
"{headers}.", { headers });
|
213
|
-
return null;
|
214
|
-
}
|
215
|
-
if (body != null && !headerNames.includes("digest")) {
|
216
|
-
logger.debug("Failed to verify; required headers missing in the Signature header: " +
|
217
|
-
"{headers}.", { headers });
|
218
|
-
return null;
|
219
|
-
}
|
220
|
-
const message = headerNames.map((name) => `${name}: ` +
|
221
|
-
(name == "(request-target)"
|
222
|
-
? `${request.method.toLowerCase()} ${new URL(request.url).pathname}`
|
223
|
-
: name == "host"
|
224
|
-
? request.headers.get("host") ?? new URL(request.url).host
|
225
|
-
: request.headers.get(name))).join("\n");
|
226
|
-
const sig = decodeBase64(signature);
|
227
|
-
// TODO: support other than RSASSA-PKCS1-v1_5:
|
228
|
-
const verified = await dntShim.crypto.subtle.verify("RSASSA-PKCS1-v1_5", key.publicKey, sig, new TextEncoder().encode(message));
|
229
|
-
if (!verified) {
|
230
|
-
logger.debug("Failed to verify; signature {signature} is invalid. " +
|
231
|
-
"Check if the key is correct or if the signed message is correct. " +
|
232
|
-
"The message to sign is:\n{message}", { signature, message });
|
233
|
-
return null;
|
234
|
-
}
|
235
|
-
return key;
|
33
|
+
export function verify(request, options = {}) {
|
34
|
+
getLogger(["fedify", "httpsig", "verify"]).warn("The verify() function is deprecated. Use verifyRequest() instead.");
|
35
|
+
return verifyRequest(request, options);
|
236
36
|
}
|
237
37
|
/**
|
238
38
|
* Checks if the actor of the given activity owns the specified key.
|
@@ -240,19 +40,12 @@ export async function verify(request, { documentLoader, contextLoader, timeWindo
|
|
240
40
|
* @param key The public key to check.
|
241
41
|
* @param options Options for checking the key ownership.
|
242
42
|
* @returns Whether the actor is the owner of the key.
|
43
|
+
* @deprecated
|
243
44
|
*/
|
244
|
-
export
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
const actor = await activity.getActor(options);
|
249
|
-
if (actor == null || !isActor(actor))
|
250
|
-
return false;
|
251
|
-
for (const publicKeyId of actor.publicKeyIds) {
|
252
|
-
if (key.id != null && publicKeyId.href === key.id.href)
|
253
|
-
return true;
|
254
|
-
}
|
255
|
-
return false;
|
45
|
+
export function doesActorOwnKey(activity, key, options) {
|
46
|
+
getLogger(["fedify", "httpsig"]).warn("The doesActorOwnKey() function from @fedify/fedify/httpsig is deprecated. " +
|
47
|
+
"Use doesActorOwnKey() from @fedify/fedify/sig instead.");
|
48
|
+
return newDoesActorOwnKey(activity, key, options);
|
256
49
|
}
|
257
50
|
/**
|
258
51
|
* Gets the actor that owns the specified key. Returns `null` if the key has no
|
@@ -263,65 +56,49 @@ export async function doesActorOwnKey(activity, key, options) {
|
|
263
56
|
* @returns The actor that owns the key, or `null` if the key has no known
|
264
57
|
* owner.
|
265
58
|
* @since 0.7.0
|
59
|
+
* @deprecated
|
60
|
+
*/
|
61
|
+
export function getKeyOwner(keyId, options) {
|
62
|
+
getLogger(["fedify", "httpsig"]).warn("The getKeyOwner() function from @fedify/fedify/httpsig is deprecated. " +
|
63
|
+
"Use getKeyOwner() from @fedify/fedify/sig instead.");
|
64
|
+
return newGetKeyOwner(keyId, options);
|
65
|
+
}
|
66
|
+
/**
|
67
|
+
* Generates a key pair which is appropriate for Fedify.
|
68
|
+
* @returns The generated key pair.
|
69
|
+
* @since 0.3.0
|
70
|
+
* @deprecated
|
71
|
+
*/
|
72
|
+
export function generateCryptoKeyPair() {
|
73
|
+
getLogger(["fedify", "httpsig", "key"]).warn("The generateCryptoKeyPair() from @fedify/fedify/httpsig is deprecated. " +
|
74
|
+
"Please use generateKeyPair() from @fedify/fedify/sig instead.");
|
75
|
+
return newGenerateCryptoKeyPair();
|
76
|
+
}
|
77
|
+
/**
|
78
|
+
* Exports a key in JWK format.
|
79
|
+
* @param key The key to export. Either public or private key.
|
80
|
+
* @returns The exported key in JWK format. The key is suitable for
|
81
|
+
* serialization and storage.
|
82
|
+
* @throws {TypeError} If the key is invalid or unsupported.
|
83
|
+
* @since 0.3.0
|
84
|
+
* @deprecated
|
85
|
+
*/
|
86
|
+
export function exportJwk(key) {
|
87
|
+
getLogger(["fedify", "httpsig", "key"]).warn("The exportJwk() function from @fedify/fedify/httpsig is deprecated. " +
|
88
|
+
"Please use exportJwk() from @fedify/fedify/sig instead.");
|
89
|
+
return newExportJwk(key);
|
90
|
+
}
|
91
|
+
/**
|
92
|
+
* Imports a key from JWK format.
|
93
|
+
* @param jwk The key in JWK format.
|
94
|
+
* @param type Which type of key to import, either `"public"`" or `"private"`".
|
95
|
+
* @returns The imported key.
|
96
|
+
* @throws {TypeError} If the key is invalid or unsupported.
|
97
|
+
* @since 0.3.0
|
98
|
+
* @deprecated
|
266
99
|
*/
|
267
|
-
export
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
if (keyId instanceof CryptographicKey) {
|
272
|
-
object = keyId;
|
273
|
-
if (object.id == null)
|
274
|
-
return null;
|
275
|
-
keyId = object.id;
|
276
|
-
}
|
277
|
-
else {
|
278
|
-
let keyDoc;
|
279
|
-
try {
|
280
|
-
const { document } = await documentLoader(keyId.href);
|
281
|
-
keyDoc = document;
|
282
|
-
}
|
283
|
-
catch (_) {
|
284
|
-
return null;
|
285
|
-
}
|
286
|
-
try {
|
287
|
-
object = await ASObject.fromJsonLd(keyDoc, {
|
288
|
-
documentLoader,
|
289
|
-
contextLoader,
|
290
|
-
});
|
291
|
-
}
|
292
|
-
catch (e) {
|
293
|
-
if (!(e instanceof TypeError))
|
294
|
-
throw e;
|
295
|
-
try {
|
296
|
-
object = await CryptographicKey.fromJsonLd(keyDoc, {
|
297
|
-
documentLoader,
|
298
|
-
contextLoader,
|
299
|
-
});
|
300
|
-
}
|
301
|
-
catch (e) {
|
302
|
-
if (e instanceof TypeError)
|
303
|
-
return null;
|
304
|
-
throw e;
|
305
|
-
}
|
306
|
-
}
|
307
|
-
}
|
308
|
-
let owner = null;
|
309
|
-
if (object instanceof CryptographicKey) {
|
310
|
-
if (object.ownerId == null)
|
311
|
-
return null;
|
312
|
-
owner = await object.getOwner({ documentLoader, contextLoader });
|
313
|
-
}
|
314
|
-
else if (isActor(object)) {
|
315
|
-
owner = object;
|
316
|
-
}
|
317
|
-
else {
|
318
|
-
return null;
|
319
|
-
}
|
320
|
-
if (owner == null)
|
321
|
-
return null;
|
322
|
-
for (const kid of owner.publicKeyIds) {
|
323
|
-
if (kid.href === keyId.href)
|
324
|
-
return owner;
|
325
|
-
}
|
326
|
-
return null;
|
100
|
+
export function importJwk(jwk, type) {
|
101
|
+
getLogger(["fedify", "httpsig", "key"]).warn("The importJwk() function from @fedify/fedify/httpsig is deprecated. " +
|
102
|
+
"Please use importJwk() from @fedify/fedify/sig instead.");
|
103
|
+
return newImportJwk(jwk, type);
|
327
104
|
}
|
package/esm/nodeinfo/types.js
CHANGED
package/esm/runtime/docloader.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import * as dntShim from "../_dnt.shims.js";
|
2
2
|
import { getLogger } from "@logtape/logtape";
|
3
|
-
import {
|
4
|
-
import {
|
3
|
+
import { signRequest } from "../sig/http.js";
|
4
|
+
import { validateCryptoKey } from "../sig/key.js";
|
5
5
|
const logger = getLogger(["fedify", "runtime", "docloader"]);
|
6
6
|
/**
|
7
7
|
* Error thrown when fetching a JSON-LD document failed.
|
@@ -94,7 +94,7 @@ export function getAuthenticatedDocumentLoader(identity) {
|
|
94
94
|
validateCryptoKey(identity.privateKey);
|
95
95
|
async function load(url) {
|
96
96
|
let request = createRequest(url);
|
97
|
-
request = await
|
97
|
+
request = await signRequest(request, identity.privateKey, identity.keyId);
|
98
98
|
logRequest(request);
|
99
99
|
const response = await fetch(request, {
|
100
100
|
// Since Bun has a bug that ignores the `Request.redirect` option,
|