Commit graph

42 commits

Author SHA1 Message Date
Nutomic 54e8a1145f
Add function ObjectId.is_local (#106)
* Add function ObjectId.is_local

* add test

* add test
2024-04-10 11:31:55 +02:00
Nutomic 7def01a19a
Avoid running ci checks twice (#105)
* Avoid running ci checks twice

* upgrade rust

* move clippy config to cargo.toml
2024-04-09 11:28:57 +02:00
Nutomic a2ac97db98
Allow fetching from local domain in case it redirects to remote (#104)
* Allow fetching from local domain in case it redirects to remote

* clippy

* fix lemmy tests
2024-04-09 11:28:22 +02:00
Nutomic 636b47c8b2
Add back activity send queue as optional feature (#94)
* Add back activity send queue as optional feature

* fix port collision in tests

* improve docs

* serialize fn

* deduplicate

* more dedup

* more dedup

* dedupupup

* test cleanup

* remove fn
2024-03-04 08:53:33 -05:00
Soso 12aad8bf3c
Webfinger: don't discard consumer errors (#85)
* Improve WebFinger errors

* Improve webfinger extraction

* Fix typo

* Document webfinger parsing

* Reimplement Regex based webfinger parsing

* clippy

* no unwrap

---------

Co-authored-by: Felix Ableitner <me@nutomic.com>
2023-12-11 22:48:32 +01:00
cetra3 098a4299f0
Remove anyhow from trait definitions (#82) 2023-11-20 11:42:47 +01:00
phiresky 51443aa57c
Remove activity queue and add raw sending (#75)
* make prepare_raw, sign_raw, send_raw functions public

* remove in-memory activity queue

* rename module

* comment

* don"t clone

* fix doc comment

* remove send_activity function

---------

Co-authored-by: Nutomic <me@nutomic.com>
2023-09-01 11:19:22 +02:00
Nutomic 426871f5af
Use anyhow::Error for UrlVerifier return type (fixes #61) (#65)
* Use anyhow::Error for UrlVerifier return type (fixes #61)

* fmt

* uncomment
2023-07-26 10:26:22 -04:00
phiresky 32e3cd5574
make time-zone aware (#62)
* make time-zone aware.

* format and revert debug

* better test log

* empty
2023-07-26 16:17:39 +02:00
Colin Atkinson d9f1a4414f
Fix regex error when actix-web feature not enabled (#56)
* Fix formatting for nightly rustfmt

https://github.com/LemmyNet/lemmy/issues/3467

* Fix regex error when actix-web feature not enabled

If the crate is built with only the axum feature, compiling the
webfinger account regex will fail with an error "Unicode-aware case
insensitivity matching is not available..." because of the missing
unicode-case feature. This doesn't happen if actix is installed because
it pulls in the regex crate with all features (via [actix-router][0]).

The failure can be demonstrated by reverting this commit's change to
Cargo.toml and running:

    cargo test --no-default-features --features=axum --doc extract_webfinger_name

Resolve this by adding the unicode-case feature to the regex dependency.

[0]: 0e8ed50e3a/actix-router/Cargo.toml (L25)
2023-07-03 15:05:18 +02:00
phiresky b64f4a8f3f
fix: make "other" error actually transparent (#51)
* fix: make "other" error actually transparent

* cargo fmt
2023-06-29 10:19:49 +02:00
cetra3 c356265cf4
Remove actix-rt and replace with tokio tasks (#42)
* Remove `actix-rt` and replace with tokio tasks

* Include activity queue test

* Use older `Arc` method

* Refactor to not re-process PEM data on each request

* Add retry queue and spawn tokio tasks directly

* Fix doc error

* Remove semaphore and use join set for backpressure

* Fix debug issue with multiple mailboxes
2023-06-20 11:54:14 +02:00
Alex Auvolat 7b0b830597
Secure mode federation support (WIP) (#39)
* First iteration of secure mode federation support

* signing_actor: take request by reference

* Implement secure mode fetch as a global config parameter

* Implement secure mode federation example in actix-web example

* fix clippy lints
2023-06-12 13:32:54 +02:00
Felix Ableitner 072353fc41 Dont use apub in type names 2023-03-16 21:41:43 +01:00
Nutomic 6a65fa7c98
Changes to make Lemmy work with 0.4 (#29)
* Make it work with Lemmy

* working but needs cleanup

* almost everything working

* debug

* stack overflow fix
2023-03-16 02:11:48 +01:00
Nutomic 6b3a4f8942
Add verify methods back in, some more fixes (#28) 2023-03-09 22:09:44 +01:00
Felix Ableitner d94a2ed0fc live federation example 2023-03-08 22:16:43 +01:00
Felix Ableitner 32394696a5 move files 2023-03-06 16:19:43 +01:00
Felix Ableitner d5ecab1b61 finish rustdoc 2023-03-04 23:20:06 +01:00
Felix Ableitner 19c459fc02 Further improvements 2023-03-02 00:19:10 +01:00
Felix Ableitner 69e77dfa74 Various improvements for usability, examples and docs 2023-02-19 21:26:01 +09:00
Felix Ableitner 5a5c015bfc No default feature, rename to actix-web, merge examples 2023-02-11 22:10:48 +09:00
Nutomic 83ad4bfdc1
Merge handler params into single struct (#25) 2023-02-11 13:32:35 +01:00
Nutomic 6611debd6b
Remove verify methods (fixes #15) (#21) 2023-01-16 22:54:23 +01:00
Paul Delafosse 9332c81458
feat: add axum compat (#12)
* feat: add actix feature flag

* (WIP)feat: add axum feature

* WIP: axum veridy digest + example

Note: this does not compile yet

* WIP

* chore: clippy lints

* Use actix rt for axum example

* ci: run example in CI for both actix and axum

* feat: add json wrapper type for axum

* docs: update readme with actix and axum feature flags

* fix: fix ci

* chore: more clippy lints

* refactor: update according to PR comment and factorize 'verify_digest'
2022-11-28 21:19:56 +00:00
Felix Ableitner 0c6dd72328 cargo fmt 2022-11-26 17:12:08 +01:00
Felix Ableitner 96f62b8513 Add missing file 2022-11-24 20:53:07 +01:00
Felix Ableitner 0b603df139 Add some clippy lints 2022-11-24 13:27:38 +01:00
Felix Ableitner 05ad7b2f3a Revert change to take payload in inbox, it wasnt necessary. 2022-11-15 23:18:28 +01:00
Felix Ableitner 11fcb62416 Take dev::Payload for inbox which is more flexible 2022-11-14 16:11:36 +01:00
Nutomic 3a8dd5c6db
In inbox, verify that http signature digest was verified (ref #1) (#6) 2022-11-14 14:23:06 +00:00
Nutomic da32da5a67
Use enum_delegate crate (#5) 2022-11-14 12:04:36 +00:00
Nutomic 472d55a69e
Async verify (#4)
* Add date header when sending activity

* Version 0.2.2

* Make verify url function async
2022-10-28 10:37:51 +00:00
Erin Power 2ebe0436ef Add InstanceSettings::builder 2022-07-02 17:10:37 +02:00
Felix Ableitner 1cdb2b098d Adjustments to make Lemmy compile 2022-06-06 16:36:44 +02:00
Felix Ableitner 68e4cce4ec Improve api for send_activity() 2022-06-03 14:00:16 +02:00
Felix Ableitner d7e401eeed Set worker count 0 in debug mode 2022-06-03 12:37:57 +02:00
Felix Ableitner 31da95af95 Remove generic param error from receive_activity() 2022-06-02 18:23:27 +02:00
Felix Ableitner 3044d819a6 Ignore clippy false positive 2022-06-02 16:10:18 +02:00
Felix Ableitner 5ba09005af Remove generic Error param from ObjectId functions 2022-06-02 14:42:29 +02:00
Felix Ableitner 73d34d8011 Improved url verification, explicit debug mode 2022-06-02 14:40:54 +02:00
Felix Ableitner 5e4bd751aa Initial commit 2022-06-02 13:26:05 +02:00