[[package]]
name = "activitystreams"
-version = "0.7.0-alpha.11"
+version = "0.7.0-alpha.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3a5da1d857ec9ca65ef8d0469cdd64e7b93b59d6cad26f1444bf84b62f3eadd4"
+checksum = "6bcc3fbb392890a1942b1e5cca76cba93c8ed24b5ff50004cc3289afaab3f92c"
dependencies = [
+ "activitystreams-kinds",
"chrono",
"mime",
"serde",
[[package]]
name = "actix-http"
-version = "3.0.0-beta.13"
+version = "3.0.0-beta.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1bc3f9d97e32d75fae3ad7d955ac005eea3fd3ea60a89132768700911a60fd94"
+checksum = "055b723746f19534fc5c9a210788686542986d6f1b9cb2900a297bb4c6619f3b"
dependencies = [
"actix-codec",
"actix-rt",
checksum = "465a6172cf69b960917811022d8f29bc0b7fa1398bc4f78b3c466673db1213b6"
dependencies = [
"quote 1.0.10",
- "syn 1.0.81",
+ "syn 1.0.82",
]
[[package]]
[[package]]
name = "actix-server"
-version = "2.0.0-beta.9"
+version = "2.0.0-rc.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "411dd3296dd317ff5eff50baa13f31923ea40ec855dd7f2d3ed8639948f0195f"
+checksum = "78c9b22794b8af1c2e02434873ef858f2a7db40dbbf861ce77a04cd81ac6b767"
dependencies = [
"actix-rt",
"actix-service",
"futures-core",
"futures-util",
"log",
- "mio",
+ "mio 0.8.0",
"num_cpus",
"socket2",
"tokio",
[[package]]
name = "actix-tls"
-version = "3.0.0-beta.9"
+version = "3.0.0-rc.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "53d4739910b49c77ea88308a9fbfae544524b34884161527f9978c0102052da0"
+checksum = "4a78e066ef965e3501b0710f0722d0741e025b09e01f1af13afba0774efc2f40"
dependencies = [
"actix-codec",
"actix-rt",
[[package]]
name = "actix-web"
-version = "4.0.0-beta.12"
+version = "4.0.0-beta.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e87cfc4efaad42f8a054e269d1b85046397ff4e8707e49128dea3f99a512a9d6"
+checksum = "1657eb2ed5e8ef246b6e951bafb38644ca433042a65a44f02e5601083b71b895"
dependencies = [
"actix-codec",
"actix-http",
"mime",
"once_cell",
"paste",
- "pin-project",
+ "pin-project-lite",
"regex",
"serde",
"serde_json",
checksum = "dfe80a8828fa88a0420dc8fdd4c16b8207326c917f17701881b063eadc2a8d3b"
dependencies = [
"actix-router",
- "proc-macro2 1.0.32",
+ "proc-macro2 1.0.33",
"quote 1.0.10",
- "syn 1.0.81",
+ "syn 1.0.82",
]
[[package]]
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d44b8fee1ced9671ba043476deddef739dd0959bf77030b26b738cc591737a7"
dependencies = [
- "proc-macro2 1.0.32",
+ "proc-macro2 1.0.33",
"quote 1.0.10",
- "syn 1.0.81",
+ "syn 1.0.82",
]
[[package]]
[[package]]
name = "anyhow"
-version = "1.0.45"
+version = "1.0.51"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ee10e43ae4a853c0a3591d4e2ada1719e553be18199d9da9d4a83f5927c2f5c7"
+checksum = "8b26702f315f53b6071259e15dd9d64528213b44d61de1ec926eca7715d62203"
[[package]]
name = "arrayvec"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "44318e776df68115a881de9a8fd1b9e53368d7a4a5ce4cc48517da3393233a5e"
dependencies = [
- "proc-macro2 1.0.32",
+ "proc-macro2 1.0.33",
"quote 1.0.10",
- "syn 1.0.81",
+ "syn 1.0.82",
]
[[package]]
[[package]]
name = "awc"
-version = "3.0.0-beta.11"
+version = "3.0.0-beta.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f9f7d0c472987e454f41c3f4c7fa336ca139707ab255644b0480144c2060c800"
+checksum = "e9fef22345ed9fc111adf13c3b1e48473136a2669a73680b82d18d6e71e720fe"
dependencies = [
"actix-codec",
"actix-http",
[[package]]
name = "bitvec"
-version = "0.19.5"
+version = "0.19.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8942c8d352ae1838c9dda0b0ca2ab657696ef2232a20147cf1b30ae1a9cb4321"
+checksum = "55f93d0ef3363c364d5976646a38f04cf67cfe1d4c8d160cdea02cab2c116b33"
dependencies = [
"funty",
"radium",
[[package]]
name = "crc32fast"
-version = "1.2.1"
+version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a"
+checksum = "738c290dfaea84fc1ca15ad9c168d083b05a714e1efddd8edaab678dc28d2836"
dependencies = [
"cfg-if",
]
dependencies = [
"fnv",
"ident_case",
- "proc-macro2 1.0.32",
+ "proc-macro2 1.0.33",
"quote 1.0.10",
"strsim 0.9.3",
- "syn 1.0.81",
+ "syn 1.0.82",
]
[[package]]
dependencies = [
"fnv",
"ident_case",
- "proc-macro2 1.0.32",
+ "proc-macro2 1.0.33",
"quote 1.0.10",
"strsim 0.10.0",
- "syn 1.0.81",
+ "syn 1.0.82",
]
[[package]]
dependencies = [
"darling_core 0.10.2",
"quote 1.0.10",
- "syn 1.0.81",
+ "syn 1.0.82",
]
[[package]]
dependencies = [
"darling_core 0.13.0",
"quote 1.0.10",
- "syn 1.0.81",
+ "syn 1.0.82",
]
[[package]]
dependencies = [
"darling 0.10.2",
"derive_builder_core",
- "proc-macro2 1.0.32",
+ "proc-macro2 1.0.33",
"quote 1.0.10",
- "syn 1.0.81",
+ "syn 1.0.82",
]
[[package]]
checksum = "2791ea3e372c8495c0bc2033991d76b512cd799d07491fbd6890124db9458bef"
dependencies = [
"darling 0.10.2",
- "proc-macro2 1.0.32",
+ "proc-macro2 1.0.33",
"quote 1.0.10",
- "syn 1.0.81",
+ "syn 1.0.82",
]
[[package]]
name = "derive_more"
-version = "0.99.16"
+version = "0.99.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "40eebddd2156ce1bb37b20bbe5151340a31828b1f2d22ba4141f3531710e38df"
+checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321"
dependencies = [
"convert_case",
- "proc-macro2 1.0.32",
+ "proc-macro2 1.0.33",
"quote 1.0.10",
- "rustc_version 0.3.3",
- "syn 1.0.81",
+ "rustc_version 0.4.0",
+ "syn 1.0.82",
]
[[package]]
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "45f5098f628d02a7a0f68ddba586fb61e80edec3bdc1be3b921f4ceec60858d3"
dependencies = [
- "proc-macro2 1.0.32",
+ "proc-macro2 1.0.33",
"quote 1.0.10",
- "syn 1.0.81",
+ "syn 1.0.82",
]
[[package]]
checksum = "366b1ae88672638e08f97cc9037ce4e5dca6c2b37699a50c72b846a4c654d4bb"
dependencies = [
"darling 0.13.0",
- "proc-macro2 1.0.32",
+ "proc-macro2 1.0.33",
"quote 1.0.10",
- "syn 1.0.81",
+ "syn 1.0.82",
]
[[package]]
[[package]]
name = "futures"
-version = "0.3.17"
+version = "0.3.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a12aa0eb539080d55c3f2d45a67c3b58b6b0773c1a3ca2dfec66d58c97fd66ca"
+checksum = "8cd0210d8c325c245ff06fd95a3b13689a1a276ac8cfa8e8720cb840bfb84b9e"
dependencies = [
"futures-channel",
"futures-core",
[[package]]
name = "futures-channel"
-version = "0.3.17"
+version = "0.3.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5da6ba8c3bb3c165d3c7319fc1cc8304facf1fb8db99c5de877183c08a273888"
+checksum = "7fc8cd39e3dbf865f7340dce6a2d401d24fd37c6fe6c4f0ee0de8bfca2252d27"
dependencies = [
"futures-core",
"futures-sink",
[[package]]
name = "futures-core"
-version = "0.3.17"
+version = "0.3.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "88d1c26957f23603395cd326b0ffe64124b818f4449552f960d815cfba83a53d"
+checksum = "629316e42fe7c2a0b9a65b47d159ceaa5453ab14e8f0a3c5eedbb8cd55b4a445"
[[package]]
name = "futures-executor"
-version = "0.3.17"
+version = "0.3.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "45025be030969d763025784f7f355043dc6bc74093e4ecc5000ca4dc50d8745c"
+checksum = "7b808bf53348a36cab739d7e04755909b9fcaaa69b7d7e588b37b6ec62704c97"
dependencies = [
"futures-core",
"futures-task",
[[package]]
name = "futures-io"
-version = "0.3.17"
+version = "0.3.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "522de2a0fe3e380f1bc577ba0474108faf3f6b18321dbf60b3b9c39a75073377"
+checksum = "e481354db6b5c353246ccf6a728b0c5511d752c08da7260546fc0933869daa11"
[[package]]
name = "futures-macro"
-version = "0.3.17"
+version = "0.3.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "18e4a4b95cea4b4ccbcf1c5675ca7c4ee4e9e75eb79944d07defde18068f79bb"
+checksum = "a89f17b21645bc4ed773c69af9c9a0effd4a3f1a3876eadd453469f8854e7fdd"
dependencies = [
- "autocfg 1.0.1",
- "proc-macro-hack",
- "proc-macro2 1.0.32",
+ "proc-macro2 1.0.33",
"quote 1.0.10",
- "syn 1.0.81",
+ "syn 1.0.82",
]
[[package]]
name = "futures-sink"
-version = "0.3.17"
+version = "0.3.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "36ea153c13024fe480590b3e3d4cad89a0cfacecc24577b68f86c6ced9c2bc11"
+checksum = "996c6442437b62d21a32cd9906f9c41e7dc1e19a9579843fad948696769305af"
[[package]]
name = "futures-task"
-version = "0.3.17"
+version = "0.3.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1d3d00f4eddb73e498a54394f228cd55853bdf059259e8e7bc6e69d408892e99"
+checksum = "dabf1872aaab32c886832f2276d2f5399887e2bd613698a02359e4ea83f8de12"
[[package]]
name = "futures-util"
-version = "0.3.17"
+version = "0.3.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "36568465210a3a6ee45e1f165136d68671471a501e632e9a98d96872222b5481"
+checksum = "41d22213122356472061ac0f1ab2cee28d2bac8491410fd68c2af53d1cedb83e"
dependencies = [
- "autocfg 1.0.1",
"futures-channel",
"futures-core",
"futures-io",
"memchr",
"pin-project-lite",
"pin-utils",
- "proc-macro-hack",
- "proc-macro-nested",
"slab",
]
"log",
"mac",
"markup5ever 0.10.1",
- "proc-macro2 1.0.32",
+ "proc-macro2 1.0.33",
"quote 1.0.10",
- "syn 1.0.81",
+ "syn 1.0.82",
]
[[package]]
[[package]]
name = "http-signature-normalization-reqwest"
-version = "0.2.0"
+version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4a1e24f3c8b2c8b5eddb82d4cdf07dafe01f5b87f92b81a369dd520a107d33e8"
+checksum = "faa064da2f51cd57c8b95492cbd647ca6a21486de7e6b707e776ab33be76aa31"
dependencies = [
"base64 0.13.0",
"bytes",
"http",
"http-signature-normalization",
"reqwest",
+ "reqwest-middleware",
"sha2",
"thiserror",
"tokio",
"percent-encoding",
"rand 0.8.4",
"reqwest",
+ "reqwest-middleware",
"serde",
"serde_json",
"serde_with",
"once_cell",
"openssl",
"reqwest",
+ "reqwest-middleware",
"serde",
"serde_json",
"sha2",
name = "lemmy_apub_lib_derive"
version = "0.14.4-rc.4"
dependencies = [
- "proc-macro2 1.0.32",
+ "proc-macro2 1.0.33",
"quote 1.0.10",
- "syn 1.0.81",
+ "syn 1.0.82",
"trybuild",
]
"lemmy_websocket",
"openssl",
"reqwest",
+ "reqwest-middleware",
+ "reqwest-tracing",
"serde",
"serde_json",
"strum",
"rand 0.8.4",
"regex",
"reqwest",
+ "reqwest-middleware",
"serde",
"serde_json",
"smart-default",
"lemmy_utils",
"rand 0.8.4",
"reqwest",
+ "reqwest-middleware",
"serde",
"serde_json",
"strum",
[[package]]
name = "libc"
-version = "0.2.107"
+version = "0.2.109"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fbe5e23404da5b4f555ef85ebed98fb4083e55a00c317800bc2a50ede9f3d219"
+checksum = "f98a04dce437184842841303488f70d0188c5f51437d2a834dc097eafa909a01"
[[package]]
name = "local-channel"
[[package]]
name = "lodepng"
-version = "3.4.6"
+version = "3.4.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e1f7ef1b146a329001ccc6ad5fc1def8300281dda5176e8336b7fd44e440fb96"
+checksum = "24844d5c0b922ddd52fb5bf0964a4c7f8e799a946ec01bb463771eb04fc1a323"
dependencies = [
"fallible_collections",
"flate2",
[[package]]
name = "memoffset"
-version = "0.6.4"
+version = "0.6.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9"
+checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce"
dependencies = [
"autocfg 1.0.1",
]
checksum = "9753f12909fd8d923f75ae5c3258cae1ed3c8ec052e1b38c93c21a6d157f789c"
dependencies = [
"migrations_internals",
- "proc-macro2 1.0.32",
+ "proc-macro2 1.0.33",
"quote 1.0.10",
- "syn 1.0.81",
+ "syn 1.0.82",
]
[[package]]
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d"
+[[package]]
+name = "mime_guess"
+version = "2.0.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2684d4c2e97d99848d30b324b00c8fcc7e5c897b7cbb5819b09e7c90e8baf212"
+dependencies = [
+ "mime",
+ "unicase",
+]
+
[[package]]
name = "minimal-lexical"
version = "0.2.1"
"winapi",
]
+[[package]]
+name = "mio"
+version = "0.8.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ba272f85fa0b41fc91872be579b3bbe0f56b792aa361a380eb669469f68dafb2"
+dependencies = [
+ "libc",
+ "log",
+ "miow",
+ "ntapi",
+ "winapi",
+]
+
[[package]]
name = "miow"
version = "0.3.7"
dependencies = [
"pest",
"pest_meta",
- "proc-macro2 1.0.32",
+ "proc-macro2 1.0.33",
"quote 1.0.10",
- "syn 1.0.81",
+ "syn 1.0.82",
]
[[package]]
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e8fe8163d14ce7f0cdac2e040116f22eac817edabff0be91e8aff7e9accf389"
dependencies = [
- "proc-macro2 1.0.32",
+ "proc-macro2 1.0.33",
"quote 1.0.10",
- "syn 1.0.81",
+ "syn 1.0.82",
]
[[package]]
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5"
-[[package]]
-name = "proc-macro-nested"
-version = "0.1.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086"
-
[[package]]
name = "proc-macro2"
version = "0.4.30"
[[package]]
name = "proc-macro2"
-version = "1.0.32"
+version = "1.0.33"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ba508cc11742c0dc5c1659771673afbab7a0efab23aa17e854cbab0837ed0b43"
+checksum = "fb37d2df5df740e582f28f8560cf425f52bb267d872fe58358eadb554909f07a"
dependencies = [
"unicode-xid 0.2.2",
]
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05"
dependencies = [
- "proc-macro2 1.0.32",
+ "proc-macro2 1.0.33",
]
[[package]]
name = "quoted_printable"
-version = "0.4.3"
+version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1238256b09923649ec89b08104c4dfe9f6cb2fea734a5db5384e44916d59e9c5"
+checksum = "3fee2dce59f7a43418e3382c766554c614e06a552d53a8f07ef499ea4b332c0f"
[[package]]
name = "r2d2"
[[package]]
name = "reqwest"
-version = "0.11.6"
+version = "0.11.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "66d2927ca2f685faf0fc620ac4834690d29e7abb153add10f5812eef20b5e280"
+checksum = "07bea77bc708afa10e59905c3d4af7c8fd43c9214251673095ff8b14345fcbc5"
dependencies = [
"base64 0.13.0",
"bytes",
"lazy_static",
"log",
"mime",
+ "mime_guess",
"native-tls",
"percent-encoding",
"pin-project-lite",
"winreg",
]
+[[package]]
+name = "reqwest-middleware"
+version = "0.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4eb4bd0c419665f9266097de27649a7723140acd100f2676245e0461278ca97a"
+dependencies = [
+ "anyhow",
+ "async-trait",
+ "futures",
+ "http",
+ "reqwest",
+ "serde",
+ "task-local-extensions",
+ "thiserror",
+]
+
+[[package]]
+name = "reqwest-tracing"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "89af431b8c46776b5071a9a739c2b5fadbed6be2c6158d1ac5f71c4da3d2261c"
+dependencies = [
+ "async-trait",
+ "reqwest",
+ "reqwest-middleware",
+ "task-local-extensions",
+ "tokio",
+ "tracing",
+]
+
[[package]]
name = "rgb"
version = "0.8.29"
[[package]]
name = "rustc_version"
-version = "0.3.3"
+version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee"
+checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366"
dependencies = [
- "semver 0.11.0",
+ "semver 1.0.4",
]
[[package]]
name = "rustls"
-version = "0.20.1"
+version = "0.20.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dac4581f0fc0e0efd529d069e8189ec7b90b8e7680e21beb35141bdc45f36040"
+checksum = "d37e5e2290f3e040b594b1a9e04377c2c671f1a1cfd9bfdef82106ac1c113f84"
dependencies = [
"log",
"ring",
[[package]]
name = "rustversion"
-version = "1.0.5"
+version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "61b3909d758bb75c79f23d4736fac9433868679d3ad2ea7a61e3c25cfda9a088"
+checksum = "f2cc38e8fa666e2de3c4aba7edeb5ffc5246c1c2ed0e3d17e560aeeba736b23f"
[[package]]
name = "ryu"
-version = "1.0.5"
+version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e"
+checksum = "3c9613b5a66ab9ba26415184cfc41156594925a9cf3a2057e57f31ff145f6568"
[[package]]
name = "same-file"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
dependencies = [
- "semver-parser 0.7.0",
+ "semver-parser",
]
[[package]]
name = "semver"
-version = "0.11.0"
+version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6"
-dependencies = [
- "semver-parser 0.10.2",
-]
+checksum = "568a8e6258aa33c13358f81fd834adb854c6f7c9468520910a9b1e8fac068012"
[[package]]
name = "semver-parser"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
-[[package]]
-name = "semver-parser"
-version = "0.10.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7"
-dependencies = [
- "pest",
-]
-
[[package]]
name = "serde"
version = "1.0.130"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d7bc1a1ab1961464eae040d96713baa5a724a8152c1222492465b54322ec508b"
dependencies = [
- "proc-macro2 1.0.32",
+ "proc-macro2 1.0.33",
"quote 1.0.10",
- "syn 1.0.81",
+ "syn 1.0.82",
]
[[package]]
name = "serde_json"
-version = "1.0.70"
+version = "1.0.72"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e277c495ac6cd1a01a58d0a0c574568b4d1ddf14f59965c6a58b8d96400b54f3"
+checksum = "d0ffa0837f2dfa6fb90868c2b5468cad482e175f7dad97e7421951e663f2b527"
dependencies = [
"indexmap",
"itoa",
checksum = "12e47be9471c72889ebafb5e14d5ff930d89ae7a67bbdb5f8abb564f845a927e"
dependencies = [
"darling 0.13.0",
- "proc-macro2 1.0.32",
+ "proc-macro2 1.0.33",
"quote 1.0.10",
- "syn 1.0.81",
+ "syn 1.0.82",
]
[[package]]
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b2acd6defeddb41eb60bb468f8825d0cfd0c2a76bc03bfd235b6a1dc4f6a1ad5"
dependencies = [
- "proc-macro2 1.0.32",
+ "proc-macro2 1.0.33",
"quote 1.0.10",
- "syn 1.0.81",
+ "syn 1.0.82",
]
[[package]]
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "133659a15339456eeeb07572eb02a91c91e9815e9cbc89566944d2c8d3efdbf6"
dependencies = [
- "proc-macro2 1.0.32",
+ "proc-macro2 1.0.33",
"quote 1.0.10",
- "syn 1.0.81",
+ "syn 1.0.82",
]
[[package]]
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef"
dependencies = [
- "proc-macro2 1.0.32",
+ "proc-macro2 1.0.33",
"quote 1.0.10",
"serde",
"serde_derive",
- "syn 1.0.81",
+ "syn 1.0.82",
]
[[package]]
checksum = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11"
dependencies = [
"base-x",
- "proc-macro2 1.0.32",
+ "proc-macro2 1.0.33",
"quote 1.0.10",
"serde",
"serde_derive",
"serde_json",
"sha1",
- "syn 1.0.81",
+ "syn 1.0.82",
]
[[package]]
dependencies = [
"phf_generator 0.7.24",
"phf_shared 0.7.24",
- "proc-macro2 1.0.32",
+ "proc-macro2 1.0.33",
"quote 1.0.10",
"string_cache_shared",
]
dependencies = [
"phf_generator 0.8.0",
"phf_shared 0.8.0",
- "proc-macro2 1.0.32",
+ "proc-macro2 1.0.33",
"quote 1.0.10",
]
checksum = "d06aaeeee809dbc59eb4556183dd927df67db1540de5be8d3ec0b6636358a5ec"
dependencies = [
"heck",
- "proc-macro2 1.0.32",
+ "proc-macro2 1.0.33",
"quote 1.0.10",
- "syn 1.0.81",
+ "syn 1.0.82",
]
[[package]]
[[package]]
name = "syn"
-version = "1.0.81"
+version = "1.0.82"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f2afee18b8beb5a596ecb4a2dce128c719b4ba399d34126b9e4396e3f9860966"
+checksum = "8daf5dd0bb60cbd4137b1b587d2fc0ae729bc07cf01cd70b36a1ed5ade3b9d59"
dependencies = [
- "proc-macro2 1.0.32",
+ "proc-macro2 1.0.33",
"quote 1.0.10",
"unicode-xid 0.2.2",
]
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369"
+[[package]]
+name = "task-local-extensions"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "36794203e10c86e5998179e260869d156e0674f02d5451b4a3fb9fd86d02aaab"
+dependencies = [
+ "tokio",
+]
+
[[package]]
name = "tempfile"
version = "3.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b"
dependencies = [
- "proc-macro2 1.0.32",
+ "proc-macro2 1.0.33",
"quote 1.0.10",
- "syn 1.0.81",
+ "syn 1.0.82",
]
[[package]]
checksum = "fd3c141a1b43194f3f56a1411225df8646c55781d5f26db825b3d98507eb482f"
dependencies = [
"proc-macro-hack",
- "proc-macro2 1.0.32",
+ "proc-macro2 1.0.33",
"quote 1.0.10",
"standback",
- "syn 1.0.81",
+ "syn 1.0.82",
]
[[package]]
"bytes",
"libc",
"memchr",
- "mio",
+ "mio 0.7.14",
"once_cell",
"parking_lot",
"pin-project-lite",
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c9efc1aba077437943f7515666aa2b882dfabfbfdf89c819ea75a8d6e9eaba5e"
dependencies = [
- "proc-macro2 1.0.32",
+ "proc-macro2 1.0.33",
"quote 1.0.10",
- "syn 1.0.81",
+ "syn 1.0.82",
]
[[package]]
[[package]]
name = "tracing-actix-web"
-version = "0.5.0-beta.3"
+version = "0.5.0-beta.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "994e4a59135823bdca121a8d086e3fcc71741c8677b47fa95a6afdd15e8f646f"
+checksum = "a90ef8ed903a84ce2c0cf35bd2896e55e22eaa5e2b49c4f16167f4615bb204ac"
dependencies = [
"actix-web",
"pin-project",
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f4f480b8f81512e825f337ad51e94c1eb5d3bbdf2b363dcd01e2b19a9ffe3f8e"
dependencies = [
- "proc-macro2 1.0.32",
+ "proc-macro2 1.0.33",
"quote 1.0.10",
- "syn 1.0.81",
+ "syn 1.0.82",
]
[[package]]
[[package]]
name = "tracing-subscriber"
-version = "0.3.2"
+version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7507ec620f809cdf07cccb5bc57b13069a88031b795efd4079b1c71b66c1613d"
+checksum = "245da694cc7fc4729f3f418b304cb57789f1bed2a78c575407ab8a23f53cb4d3"
dependencies = [
"ansi_term",
"lazy_static",
[[package]]
name = "trybuild"
-version = "1.0.52"
+version = "1.0.53"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "150e726dc059e6fbd4fce3288f5bb3cf70128cf63b0dde23b938a3cad810fb23"
+checksum = "9d664de8ea7e531ad4c0f5a834f20b8cb2b8e6dfe88d05796ee7887518ed67b9"
dependencies = [
"dissimilar",
"glob",
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eeba86d422ce181a719445e51872fa30f1f7413b62becb52e95ec91aa262d85c"
+[[package]]
+name = "unicase"
+version = "2.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6"
+dependencies = [
+ "version_check",
+]
+
[[package]]
name = "unicode-bidi"
version = "0.3.7"
"bumpalo",
"lazy_static",
"log",
- "proc-macro2 1.0.32",
+ "proc-macro2 1.0.33",
"quote 1.0.10",
- "syn 1.0.81",
+ "syn 1.0.82",
"wasm-bindgen-shared",
]
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab"
dependencies = [
- "proc-macro2 1.0.32",
+ "proc-macro2 1.0.33",
"quote 1.0.10",
- "syn 1.0.81",
+ "syn 1.0.82",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
tokio = { version = "1.12.0", features = ["sync"] }
anyhow = "1.0.44"
reqwest = { version = "0.11.4", features = ["json"] }
+reqwest-middleware = "0.1.2"
+reqwest-tracing = "0.2.0"
activitystreams = "0.7.0-alpha.11"
actix-rt = { version = "2.2.0", default-features = false }
serde_json = { version = "1.0.68", features = ["preserve_order"] }
.await?;
ObjectId::<ApubCommunity>::new(community_actor_id)
- .dereference(context, &mut 0)
+ .dereference(context, context.client(), &mut 0)
.await
.map_err(LemmyError::from)
.map_err(|e| e.with_message("couldnt_find_community"))?
webfinger_resolve::<ApubPerson>(&name, EndpointType::Person, context, &mut 0).await?;
let person = ObjectId::<ApubPerson>::new(actor_id)
- .dereference(context, &mut 0)
+ .dereference(context, context.client(), &mut 0)
.await;
person
.map_err(LemmyError::from)
[dev-dependencies]
serial_test = "0.5.1"
assert-json-diff = "2.0.1"
+reqwest-middleware = "0.1.2"
.collect();
let mut inboxes = vec![];
for t in tagged_users {
- let person = t.dereference(context, request_counter).await?;
+ let person = t
+ .dereference(context, context.client(), request_counter)
+ .await?;
inboxes.push(person.shared_inbox_or_inbox_url());
}
) -> Result<Vec<LocalUserId>, LemmyError> {
let post_id = comment.post_id;
let post = blocking(context.pool(), move |conn| Post::read(conn, post_id)).await??;
- let actor = actor.dereference(context, request_counter).await?;
+ let actor = actor
+ .dereference(context, context.client(), request_counter)
+ .await?;
// Note:
// Although mentions could be gotten from the post tags (they are included there), or the ccs,
request_counter: &mut i32,
) -> Result<(), LemmyError> {
let community = self.get_community(context, request_counter).await?;
- let new_mod = self.object.dereference(context, request_counter).await?;
+ let new_mod = self
+ .object
+ .dereference(context, context.client(), request_counter)
+ .await?;
// If we had to refetch the community while parsing the activity, then the new mod has already
// been added. Skip it here as it would result in a duplicate key error.
request_counter: &mut i32,
) -> Result<(), LemmyError> {
let community = self.get_community(context, request_counter).await?;
- let blocked_user = self.object.dereference(context, request_counter).await?;
+ let blocked_user = self
+ .object
+ .dereference(context, context.client(), request_counter)
+ .await?;
let community_user_ban_form = CommunityPersonBanForm {
community_id: community.id,
context: &LemmyContext,
request_counter: &mut i32,
) -> Result<ApubCommunity, LemmyError> {
- self.target.dereference(context, request_counter).await
+ self
+ .target
+ .dereference(context, context.client(), request_counter)
+ .await
}
}
) -> Result<ApubCommunity, LemmyError> {
let community_id = Url::parse(&moderators.to_string().replace("/moderators", ""))?;
ObjectId::new(community_id)
- .dereference(context, request_counter)
+ .dereference(context, context.client(), request_counter)
.await
}
request_counter: &mut i32,
) -> Result<(), LemmyError> {
let community = self.get_community(context, request_counter).await?;
- let remove_mod = self.object.dereference(context, request_counter).await?;
+ let remove_mod = self
+ .object
+ .dereference(context, context.client(), request_counter)
+ .await?;
let form = CommunityModeratorForm {
community_id: community.id,
request_counter: &mut i32,
) -> Result<(), LemmyError> {
verify_activity(&self.id, self.actor.inner(), &context.settings())?;
- let community = self.to[0].dereference(context, request_counter).await?;
+ let community = self.to[0]
+ .dereference(context, context.client(), request_counter)
+ .await?;
verify_person_in_community(&self.actor, &community, context, request_counter).await?;
Ok(())
}
context: &Data<LemmyContext>,
request_counter: &mut i32,
) -> Result<(), LemmyError> {
- let actor = self.actor.dereference(context, request_counter).await?;
- match self.object.dereference(context, request_counter).await? {
+ let actor = self
+ .actor
+ .dereference(context, context.client(), request_counter)
+ .await?;
+ match self
+ .object
+ .dereference(context, context.client(), request_counter)
+ .await?
+ {
PostOrComment::Post(post) => {
let report_form = PostReportForm {
creator_id: actor.id,
let blocked_user = self
.object
.object
- .dereference(context, request_counter)
+ .dereference(context, context.client(), request_counter)
.await?;
let community_user_ban_form = CommunityPersonBanForm {
request_counter: &mut i32,
) -> Result<ApubCommunity, LemmyError> {
let cid = ObjectId::new(self.object.id.clone());
- cid.dereference(context, request_counter).await
+ cid
+ .dereference(context, context.client(), request_counter)
+ .await
}
}
context: &LemmyContext,
request_counter: &mut i32,
) -> Result<(), LemmyError> {
- let actor = actor.dereference(context, request_counter).await?;
+ let actor = actor
+ .dereference(context, context.client(), request_counter)
+ .await?;
use UserOperationCrud::*;
match DeletableObjects::read_from_db(object, context).await? {
DeletableObjects::Community(community) => {
match DeletableObjects::read_from_db(object, context).await? {
DeletableObjects::Community(community) => {
if community.local {
- let mod_ = actor.dereference(context, request_counter).await?;
+ let mod_ = actor
+ .dereference(context, context.client(), request_counter)
+ .await?;
let object = DeletableObjects::Community(community.clone());
send_apub_delete(&mod_, &community.clone(), object, true, context).await?;
}
let person = follow
.actor
.clone()
- .dereference(context, request_counter)
+ .dereference(context, context.client(), request_counter)
.await?;
let accept = AcceptFollowCommunity {
actor: ObjectId::new(community.actor_id()),
context: &Data<LemmyContext>,
request_counter: &mut i32,
) -> Result<(), LemmyError> {
- let person = self.actor.dereference(context, request_counter).await?;
+ let person = self
+ .actor
+ .dereference(context, context.client(), request_counter)
+ .await?;
let community = self
.object
.actor
- .dereference(context, request_counter)
+ .dereference(context, context.client(), request_counter)
.await?;
// This will throw an error if no follow was requested
blocking(context.pool(), move |conn| {
) -> Result<(), LemmyError> {
verify_activity(&self.id, self.actor.inner(), &context.settings())?;
verify_person(&self.actor, context, request_counter).await?;
- let community = self.object.dereference(context, request_counter).await?;
+ let community = self
+ .object
+ .dereference(context, context.client(), request_counter)
+ .await?;
verify_person_in_community(&self.actor, &community, context, request_counter).await?;
Ok(())
}
context: &Data<LemmyContext>,
request_counter: &mut i32,
) -> Result<(), LemmyError> {
- let person = self.actor.dereference(context, request_counter).await?;
- let community = self.object.dereference(context, request_counter).await?;
+ let person = self
+ .actor
+ .dereference(context, context.client(), request_counter)
+ .await?;
+ let community = self
+ .object
+ .dereference(context, context.client(), request_counter)
+ .await?;
let community_follower_form = CommunityFollowerForm {
community_id: community.id,
person_id: person.id,
context: &Data<LemmyContext>,
request_counter: &mut i32,
) -> Result<(), LemmyError> {
- let person = self.actor.dereference(context, request_counter).await?;
+ let person = self
+ .actor
+ .dereference(context, context.client(), request_counter)
+ .await?;
let community = self
.object
.object
- .dereference(context, request_counter)
+ .dereference(context, context.client(), request_counter)
.await?;
let community_follower_form = CommunityFollowerForm {
context: &LemmyContext,
request_counter: &mut i32,
) -> Result<(), LemmyError> {
- let person = person_id.dereference(context, request_counter).await?;
+ let person = person_id
+ .dereference(context, context.client(), request_counter)
+ .await?;
if person.banned {
let error = LemmyError::from(anyhow::anyhow!("Person {} is banned", person_id));
return Err(error.with_message("banned"));
context: &LemmyContext,
request_counter: &mut i32,
) -> Result<(), LemmyError> {
- let person = person_id.dereference(context, request_counter).await?;
+ let person = person_id
+ .dereference(context, context.client(), request_counter)
+ .await?;
if person.banned {
return Err(LemmyError::from_message("Person is banned from site"));
}
request_counter: &mut i32,
) -> Result<(), LemmyError> {
if community.local {
- let actor = actor_id.dereference(context, request_counter).await?;
+ let actor = actor_id
+ .dereference(context, context.client(), request_counter)
+ .await?;
// Note: this will also return true for admins in addition to mods, but as we dont know about
// remote admins, it doesnt make any difference.
context: &Data<LemmyContext>,
request_counter: &mut i32,
) -> Result<(), LemmyError> {
- let actor = self.actor.dereference(context, request_counter).await?;
+ let actor = self
+ .actor
+ .dereference(context, context.client(), request_counter)
+ .await?;
let object = self
.object
.object
- .dereference(context, request_counter)
+ .dereference(context, context.client(), request_counter)
.await?;
match object {
PostOrComment::Post(p) => undo_vote_post(actor, &p, context).await,
context: &Data<LemmyContext>,
request_counter: &mut i32,
) -> Result<(), LemmyError> {
- let actor = self.actor.dereference(context, request_counter).await?;
- let object = self.object.dereference(context, request_counter).await?;
+ let actor = self
+ .actor
+ .dereference(context, context.client(), request_counter)
+ .await?;
+ let object = self
+ .object
+ .dereference(context, context.client(), request_counter)
+ .await?;
match object {
PostOrComment::Post(p) => vote_post(&self.kind, actor, &p, context).await,
PostOrComment::Comment(c) => vote_comment(&self.kind, actor, &c, context).await,
context: &LemmyContext,
request_counter: &mut i32,
) -> Result<ApubCommunity, LemmyError> {
- let object = self.object.dereference(context, request_counter).await?;
+ let object = self
+ .object
+ .dereference(context, context.client(), request_counter)
+ .await?;
let cid = match object {
PostOrComment::Post(p) => p.community_id,
PostOrComment::Comment(c) => {
// Add new mods to database which have been added to moderators collection
for mod_id in apub.ordered_items {
let mod_id = ObjectId::new(mod_id);
- let mod_user: ApubPerson = mod_id.dereference(&data.1, request_counter).await?;
+ let mod_user: ApubPerson = mod_id
+ .dereference(&data.1, data.1.client(), request_counter)
+ .await?;
if !current_moderators
.iter()
#[actix_rt::test]
#[serial]
async fn test_parse_lemmy_community_moderators() {
- let manager = create_activity_queue();
+ let client = reqwest::Client::new().into();
+ let manager = create_activity_queue(client);
let context = init_context(manager.queue_handle().clone());
let community = parse_lemmy_community(&context).await;
let community_id = community.id;
match Url::parse(query) {
Ok(url) => {
ObjectId::new(url)
- .dereference(context, request_counter)
+ .dereference(context, context.client(), request_counter)
.await
}
Err(_) => {
.await?;
Ok(SearchableObjects::Person(
ObjectId::new(id)
- .dereference(context, request_counter)
+ .dereference(context, context.client(), request_counter)
.await?,
))
}
.await?;
Ok(SearchableObjects::Community(
ObjectId::new(id)
- .dereference(context, request_counter)
+ .dereference(context, context.client(), request_counter)
.await?,
))
}
*request_counter += 1;
if *request_counter > context.settings().http_fetch_retry_limit {
- return Err(LemmyError::from(anyhow!("Request retry limit reached")));
+ return Err(LemmyError::from(anyhow::anyhow!(
+ "Request retry limit reached"
+ )));
}
let response = retry(|| context.client().get(&fetch_url).send()).await?;
.collect();
for l in links {
let object = ObjectId::<Kind>::new(l)
- .dereference(context, request_counter)
+ .dereference(context, context.client(), request_counter)
.await;
if object.is_ok() {
return object.map(|o| o.actor_id().into());
.await??;
let id = ObjectId::new(generate_outbox_url(&community.actor_id)?);
let outbox_data = CommunityContext(community.into(), context.get_ref().clone());
- let outbox: ApubCommunityOutbox = id.dereference(&outbox_data, &mut 0).await?;
+ let outbox: ApubCommunityOutbox = id
+ .dereference(&outbox_data, context.client(), &mut 0)
+ .await?;
Ok(create_apub_response(&outbox.into_apub(&outbox_data).await?))
}
.into();
let id = ObjectId::new(generate_outbox_url(&community.actor_id)?);
let outbox_data = CommunityContext(community, context.get_ref().clone());
- let moderators: ApubCommunityModerators = id.dereference(&outbox_data, &mut 0).await?;
+ let moderators: ApubCommunityModerators = id
+ .dereference(&outbox_data, context.client(), &mut 0)
+ .await?;
Ok(create_apub_response(
&moderators.into_apub(&outbox_data).await?,
))
check_is_apub_id_valid(&activity_data.actor, false, &context.settings())?;
let request_counter = &mut 0;
let actor = ObjectId::<UserOrCommunity>::new(activity_data.actor)
- .dereference(context, request_counter)
+ .dereference(context, context.client(), request_counter)
.await?;
verify_signature(&request, &actor.public_key())?;
) -> Result<ApubComment, LemmyError> {
let creator = note
.attributed_to
- .dereference(context, request_counter)
+ .dereference(context, context.client(), request_counter)
.await?;
let (post, parent_comment_id) = note.get_parents(context, request_counter).await?;
#[actix_rt::test]
#[serial]
pub(crate) async fn test_parse_lemmy_comment() {
- let manager = create_activity_queue();
+ let client = reqwest::Client::new().into();
+ let manager = create_activity_queue(client);
let context = init_context(manager.queue_handle().clone());
let url = Url::parse("https://enterprise.lemmy.ml/comment/38741").unwrap();
let data = prepare_comment_test(&url, &context).await;
#[actix_rt::test]
#[serial]
async fn test_parse_pleroma_comment() {
- let manager = create_activity_queue();
+ let client = reqwest::Client::new().into();
+ let manager = create_activity_queue(client);
let context = init_context(manager.queue_handle().clone());
let url = Url::parse("https://enterprise.lemmy.ml/comment/38741").unwrap();
let data = prepare_comment_test(&url, &context).await;
group
.outbox
- .dereference(&outbox_data, request_counter)
+ .dereference(&outbox_data, context.client(), request_counter)
.await
.map_err(|e| debug!("{}", e))
.ok();
if let Some(moderators) = &group.moderators {
moderators
- .dereference(&outbox_data, request_counter)
+ .dereference(&outbox_data, context.client(), request_counter)
.await
.map_err(|e| debug!("{}", e))
.ok();
#[actix_rt::test]
#[serial]
async fn test_parse_lemmy_community() {
- let manager = create_activity_queue();
+ let client = reqwest::Client::new().into();
+ let manager = create_activity_queue(client);
let context = init_context(manager.queue_handle().clone());
let community = parse_lemmy_community(&context).await;
};
use lemmy_websocket::{chat_server::ChatServer, LemmyContext};
use reqwest::Client;
+ use reqwest_middleware::ClientBuilder;
use serde::de::DeserializeOwned;
use std::{fs::File, io::BufReader, sync::Arc};
use tokio::sync::Mutex;
.user_agent(build_user_agent(&settings))
.build()
.unwrap();
+
+ let client = ClientBuilder::new(client).build();
let secret = Secret {
id: 0,
jwt_secret: "".to_string(),
#[actix_rt::test]
#[serial]
async fn test_parse_lemmy_person() {
- let manager = create_activity_queue();
+ let client = reqwest::Client::new().into();
+ let manager = create_activity_queue(client);
let context = init_context(manager.queue_handle().clone());
let person = parse_lemmy_person(&context).await;
#[actix_rt::test]
#[serial]
async fn test_parse_pleroma_person() {
- let manager = create_activity_queue();
+ let client = reqwest::Client::new().into();
+ let manager = create_activity_queue(client);
let context = init_context(manager.queue_handle().clone());
let json = file_to_json_object("assets/pleroma/objects/person.json");
let url = Url::parse("https://queer.hacktivis.me/users/lanodan").unwrap();
) -> Result<ApubPost, LemmyError> {
let creator = page
.attributed_to
- .dereference(context, request_counter)
+ .dereference(context, context.client(), request_counter)
.await?;
let community = page.extract_community(context, request_counter).await?;
#[actix_rt::test]
#[serial]
async fn test_parse_lemmy_post() {
- let manager = create_activity_queue();
+ let client = reqwest::Client::new().into();
+ let manager = create_activity_queue(client);
let context = init_context(manager.queue_handle().clone());
let community = parse_lemmy_community(&context).await;
let person = parse_lemmy_person(&context).await;
verify_domains_match(note.attributed_to.inner(), note.id.inner())?;
let person = note
.attributed_to
- .dereference(context, request_counter)
+ .dereference(context, context.client(), request_counter)
.await?;
if person.banned {
return Err(LemmyError::from_message("Person is banned from site"));
) -> Result<ApubPrivateMessage, LemmyError> {
let creator = note
.attributed_to
- .dereference(context, request_counter)
+ .dereference(context, context.client(), request_counter)
+ .await?;
+ let recipient = note.to[0]
+ .dereference(context, context.client(), request_counter)
.await?;
- let recipient = note.to[0].dereference(context, request_counter).await?;
let content = if let Some(source) = ¬e.source {
source.content.clone()
} else {
#[actix_rt::test]
#[serial]
async fn test_parse_lemmy_pm() {
- let manager = create_activity_queue();
+ let client = reqwest::Client::new().into();
+ let manager = create_activity_queue(client);
let context = init_context(manager.queue_handle().clone());
let url = Url::parse("https://enterprise.lemmy.ml/private_message/1621").unwrap();
let data = prepare_comment_test(&url, &context).await;
#[actix_rt::test]
#[serial]
async fn test_parse_pleroma_pm() {
- let manager = create_activity_queue();
+ let client = reqwest::Client::new().into();
+ let manager = create_activity_queue(client);
let context = init_context(manager.queue_handle().clone());
let url = Url::parse("https://enterprise.lemmy.ml/private_message/1621").unwrap();
let data = prepare_comment_test(&url, &context).await;
let parent = Box::pin(
self
.in_reply_to
- .dereference(context, request_counter)
+ .dereference(context, context.client(), request_counter)
.await?,
);
match parent.deref() {
loop {
if let Some(cid) = to_iter.next() {
let cid = ObjectId::new(cid.clone());
- if let Ok(c) = cid.dereference(context, request_counter).await {
+ if let Ok(c) = cid
+ .dereference(context, context.client(), request_counter)
+ .await
+ {
break Ok(c);
}
} else {
serde_json = { version = "1.0.68", features = ["preserve_order"] }
anyhow = "1.0.44"
reqwest = { version = "0.11.4", features = ["json"] }
+reqwest-middleware = "0.1.2"
tracing = "0.1.29"
base64 = "0.13.0"
openssl = "0.10.36"
sha2 = "0.9.8"
actix-web = { version = "4.0.0-beta.9", default-features = false }
http-signature-normalization-actix = { version = "0.5.0-beta.10", default-features = false, features = ["server", "sha-2"] }
-http-signature-normalization-reqwest = { version = "0.2.0", default-features = false, features = ["sha-2"] }
+http-signature-normalization-reqwest = { version = "0.3.0", default-features = false, features = ["sha-2", "middleware"] }
background-jobs = "0.11.0"
diesel = "1.4.8"
WorkerConfig,
};
use lemmy_utils::{location_info, LemmyError};
-use reqwest::Client;
+use reqwest_middleware::ClientWithMiddleware;
use serde::{Deserialize, Serialize};
use std::{env, fmt::Debug, future::Future, pin::Pin};
use tracing::{info, warn};
actor: &dyn ActorType,
inboxes: Vec<&Url>,
activity: String,
- client: &Client,
+ client: &ClientWithMiddleware,
activity_queue: &QueueHandle,
) -> Result<(), LemmyError> {
for i in inboxes {
}
}
-async fn do_send(task: SendActivityTask, client: &Client) -> Result<(), Error> {
+async fn do_send(task: SendActivityTask, client: &ClientWithMiddleware) -> Result<(), Error> {
info!("Sending {} to {}", task.activity_id, task.inbox);
let result = sign_and_send(
client,
Ok(())
}
-pub fn create_activity_queue() -> Manager {
+pub fn create_activity_queue(client: ClientWithMiddleware) -> Manager {
// Configure and start our workers
- WorkerConfig::new_managed(Storage::new(), |_| MyState {
- client: Client::default(),
+ WorkerConfig::new_managed(Storage::new(), move |_| MyState {
+ client: client.clone(),
})
.register::<SendActivityTask>()
.start()
#[derive(Clone)]
struct MyState {
- pub client: Client,
+ pub client: ClientWithMiddleware,
}
use activitystreams::chrono::{Duration as ChronoDuration, NaiveDateTime, Utc};
use anyhow::anyhow;
use diesel::NotFound;
-use lemmy_utils::{
- request::{build_user_agent, retry},
- settings::structs::Settings,
- LemmyError,
-};
-use once_cell::sync::Lazy;
-use reqwest::{Client, StatusCode};
+use lemmy_utils::{request::retry, settings::structs::Settings, LemmyError};
+use reqwest::StatusCode;
+use reqwest_middleware::ClientWithMiddleware;
use serde::{Deserialize, Serialize};
use std::{
fmt::{Debug, Display, Formatter},
use tracing::info;
use url::Url;
-static CLIENT: Lazy<Client> = Lazy::new(|| {
- Client::builder()
- .user_agent(build_user_agent(&Settings::get()))
- .build()
- .expect("Couldn't build client")
-});
-
/// We store Url on the heap because it is quite large (88 bytes).
#[derive(Clone, PartialEq, Serialize, Deserialize, Debug)]
#[serde(transparent)]
pub async fn dereference(
&self,
data: &<Kind as ApubObject>::DataType,
+ client: &ClientWithMiddleware,
request_counter: &mut i32,
) -> Result<Kind, LemmyError> {
let db_object = self.dereference_from_db(data).await?;
if let Some(last_refreshed_at) = object.last_refreshed_at() {
if should_refetch_object(last_refreshed_at) {
return self
- .dereference_from_http(data, request_counter, Some(object))
+ .dereference_from_http(data, client, request_counter, Some(object))
.await;
}
}
// object not found, need to fetch over http
else {
self
- .dereference_from_http(data, request_counter, None)
+ .dereference_from_http(data, client, request_counter, None)
.await
}
}
async fn dereference_from_http(
&self,
data: &<Kind as ApubObject>::DataType,
+ client: &ClientWithMiddleware,
request_counter: &mut i32,
db_object: Option<Kind>,
) -> Result<Kind, LemmyError> {
}
let res = retry(|| {
- CLIENT
+ client
.get(self.0.as_str())
.header("Accept", APUB_JSON_CONTENT_TYPE)
.timeout(Duration::from_secs(60))
pkey::PKey,
sign::{Signer, Verifier},
};
-use reqwest::{Client, Response};
+use reqwest::Response;
+use reqwest_middleware::ClientWithMiddleware;
use serde::{Deserialize, Serialize};
use sha2::{Digest, Sha256};
use std::str::FromStr;
/// Creates an HTTP post request to `inbox_url`, with the given `client` and `headers`, and
/// `activity` as request body. The request is signed with `private_key` and then sent.
pub async fn sign_and_send(
- client: &Client,
+ client: &ClientWithMiddleware,
inbox_url: &Url,
activity: String,
actor_id: &Url,
);
headers.insert(HeaderName::from_str("Host")?, HeaderValue::from_str(&host)?);
- let response = client
+ let request = client
.post(&inbox_url.to_string())
.headers(headers)
.signature_with_digest(
)
.await?;
+ let response = client.execute(request).await?;
+
Ok(response)
}
actix-rt = { version = "2.2.0", default-features = false }
anyhow = "1.0.44"
reqwest = { version = "0.11.4", features = ["json"] }
+reqwest-middleware = "0.1.2"
tokio = { version = "1.12.0", features = ["sync"] }
strum = "0.21.0"
strum_macros = "0.21.1"
use crate::{settings::structs::Settings, version::VERSION, LemmyError};
use anyhow::anyhow;
use percent_encoding::{utf8_percent_encode, NON_ALPHANUMERIC};
-use reqwest::Client;
+use reqwest_middleware::ClientWithMiddleware;
use serde::{Deserialize, Serialize};
use std::future::Future;
use thiserror::Error;
#[error("Error receiving response, {0}")]
pub struct RecvError(pub String);
-pub async fn retry<F, Fut, T>(f: F) -> Result<T, reqwest::Error>
+pub async fn retry<F, Fut, T>(f: F) -> Result<T, reqwest_middleware::Error>
where
F: Fn() -> Fut,
- Fut: Future<Output = Result<T, reqwest::Error>>,
+ Fut: Future<Output = Result<T, reqwest_middleware::Error>>,
{
retry_custom(|| async { Ok((f)().await) }).await
}
-async fn retry_custom<F, Fut, T>(f: F) -> Result<T, reqwest::Error>
+async fn retry_custom<F, Fut, T>(f: F) -> Result<T, reqwest_middleware::Error>
where
F: Fn() -> Fut,
- Fut: Future<Output = Result<Result<T, reqwest::Error>, reqwest::Error>>,
+ Fut: Future<Output = Result<Result<T, reqwest_middleware::Error>, reqwest_middleware::Error>>,
{
- let mut response: Option<Result<T, reqwest::Error>> = None;
+ let mut response: Option<Result<T, reqwest_middleware::Error>> = None;
for _ in 0u8..3 {
match (f)().await? {
Ok(t) => return Ok(t),
- Err(e) => {
+ Err(reqwest_middleware::Error::Reqwest(e)) => {
if e.is_timeout() {
- response = Some(Err(e));
+ response = Some(Err(reqwest_middleware::Error::Reqwest(e)));
continue;
}
- return Err(e);
+ return Err(reqwest_middleware::Error::Reqwest(e));
+ }
+ Err(otherwise) => {
+ return Err(otherwise);
}
}
}
}
/// Fetches the post link html tags (like title, description, image, etc)
-pub async fn fetch_site_metadata(client: &Client, url: &Url) -> Result<SiteMetadata, LemmyError> {
+pub async fn fetch_site_metadata(
+ client: &ClientWithMiddleware,
+ url: &Url,
+) -> Result<SiteMetadata, LemmyError> {
let response = client.get(url.as_str()).send().await?;
let html = response
}
pub(crate) async fn fetch_pictrs(
- client: &Client,
+ client: &ClientWithMiddleware,
settings: &Settings,
image_url: &Url,
) -> Result<PictrsResponse, LemmyError> {
/// Both are options, since the URL might be either an html page, or an image
/// Returns the SiteMetadata, and a Pictrs URL, if there is a picture associated
pub async fn fetch_site_data(
- client: &Client,
+ client: &ClientWithMiddleware,
settings: &Settings,
url: Option<&Url>,
) -> (Option<SiteMetadata>, Option<Url>) {
}
}
-async fn is_image_content_type(client: &Client, url: &Url) -> Result<(), LemmyError> {
+async fn is_image_content_type(client: &ClientWithMiddleware, url: &Url) -> Result<(), LemmyError> {
let response = client.get(url.as_str()).send().await?;
if response
.headers()
let client = reqwest::Client::builder()
.user_agent(build_user_agent(&settings))
.build()
- .unwrap();
+ .unwrap()
+ .into();
let sample_url = Url::parse("https://www.redspark.nu/en/peoples-war/district-leader-of-chand-led-cpn-arrested-in-bhojpur/").unwrap();
let sample_res = fetch_site_metadata(&client, &sample_url).await.unwrap();
assert_eq!(
lemmy_db_views = { version = "=0.14.4-rc.4", path = "../db_views" }
lemmy_db_views_actor = { version = "=0.14.4-rc.4", path = "../db_views_actor" }
reqwest = { version = "0.11.4", features = ["json"] }
+reqwest-middleware = "0.1.2"
tracing = "0.1.29"
rand = "0.8.4"
serde = { version = "1.0.130", features = ["derive"] }
LemmyError,
};
use rand::rngs::ThreadRng;
-use reqwest::Client;
+use reqwest_middleware::ClientWithMiddleware;
use serde::Serialize;
use serde_json::Value;
use std::{
message_handler_crud: MessageHandlerCrudType,
/// An HTTP Client
- client: Client,
+ client: ClientWithMiddleware,
activity_queue: QueueHandle,
}
rate_limiter: RateLimit,
message_handler: MessageHandlerType,
message_handler_crud: MessageHandlerCrudType,
- client: Client,
+ client: ClientWithMiddleware,
activity_queue: QueueHandle,
settings: Settings,
secret: Secret,
use background_jobs::QueueHandle;
use lemmy_db_schema::{source::secret::Secret, DbPool};
use lemmy_utils::{settings::structs::Settings, LemmyError};
-use reqwest::Client;
+use reqwest_middleware::ClientWithMiddleware;
use serde::Serialize;
pub mod chat_server;
pub struct LemmyContext {
pool: DbPool,
chat_server: Addr<ChatServer>,
- client: Client,
+ client: ClientWithMiddleware,
activity_queue: QueueHandle,
settings: Settings,
secret: Secret,
pub fn create(
pool: DbPool,
chat_server: Addr<ChatServer>,
- client: Client,
+ client: ClientWithMiddleware,
activity_queue: QueueHandle,
settings: Settings,
secret: Secret,
pub fn chat_server(&self) -> &Addr<ChatServer> {
&self.chat_server
}
- pub fn client(&self) -> &Client {
+ pub fn client(&self) -> &ClientWithMiddleware {
&self.client
}
pub fn activity_queue(&self) -> &QueueHandle {
};
use lemmy_websocket::{chat_server::ChatServer, LemmyContext};
use reqwest::Client;
+use reqwest_middleware::ClientBuilder;
+use reqwest_tracing::TracingMiddleware;
use std::{env, sync::Arc, thread};
use tokio::sync::Mutex;
use tracing_actix_web::TracingLogger;
.user_agent(build_user_agent(&settings))
.build()?;
- let queue_manager = create_activity_queue();
+ let client = ClientBuilder::new(client).with(TracingMiddleware).build();
+
+ let queue_manager = create_activity_queue(client.clone());
let activity_queue = queue_manager.queue_handle().clone();