Commit graph

117 commits

Author SHA1 Message Date
Nutomic
24830070f6
Add diesel feature, add ObjectId::dereference_forced (#88)
* Add diesel feature

This can simplify Lemmy code and avoid converting back and forth
to DbUrl type all the time.

* Also add diesel derives for CollectionId

* Add ObjectId::dereference_forced

* no deprecated code

* fmt
2023-12-11 15:04:18 +01:00
Nutomic
1f7de85a53
Upgrade dependencies (#86) 2023-12-01 15:40:12 +01:00
Nutomic
69b80aa6e1
Change impl of ObjectId::parse (#84)
* Change impl of ObjectId::parse

It should be consistent with Url::parse

* fmt
2023-11-24 11:21:00 +01:00
Felix Ableitner
33649b43b7 Version 0.5.0-beta.5 2023-11-20 14:35:51 +01:00
cetra3
098a4299f0
Remove anyhow from trait definitions (#82) 2023-11-20 11:42:47 +01:00
Nutomic
679228873a
Implement PartialEq for testing (#81) 2023-11-13 10:38:58 +01:00
Felix Ableitner
171d32720e 0.5.0-beta.4 2023-10-24 11:34:42 +02:00
Nutomic
e86330852d
Support different alphabets in webfinger username (#78)
* Support different alphabets in webfinger username

* clippy
2023-10-24 11:08:55 +02:00
Nutomic
ec12fb3830
Support fetches with redirect (#76)
* Support fetches with redirect

* pub
2023-10-24 10:53:59 +02:00
Felix Ableitner
a5102d0633 Version 0.5.0-beta.3 2023-09-01 11:20:36 +02:00
Felix Ableitner
99e2226993 Version 0.5.0-beta.2 2023-09-01 11:20:07 +02: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
9477180b4e
Add webfinger template field, used for remote follow (#74)
https://socialhub.activitypub.rocks/t/what-is-the-current-spec-for-remote-follow/2020/15
2023-08-31 13:42:58 +02:00
Felix Ableitner
b0547e7793 Test that deserialize_one errors on multiple array values 2023-08-09 11:12:30 +02:00
Felix Ableitner
7bb17f21d5 0.5.0-beta.1 2023-07-26 16:27:33 +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
Nutomic
61085a643f
Fix woodpecker badge in readme 2023-07-20 16:39:22 +02:00
Felix Ableitner
9b5d6af8c0 Version 0.4.6 2023-07-20 16:37:20 +02:00
Nutomic
b63445afca
Update reqwest_shim.rs (#72) 2023-07-20 10:27:51 -04:00
Samuel Tardieu
02ab897f4f
Fix webfinger fetching non-compliance (#69)
Allow webfinger to use "jrd+json" instead of "activity+json".
Fix #68.
2023-07-18 16:17:21 -04:00
Nutomic
988450c79f
Fix tests (#71) 2023-07-18 16:10:25 -04:00
phiresky
af92e0d532
add shutdown method (#53)
* add shutdown method

* simplify shutdown interface

* make work on rust < 1.70

* upgrade ci to rust 1.70

* make clippy and linux torvalds happy
2023-07-04 16:08:39 +02:00
phiresky
68f9210d4c
add a separate allow_http flag (#54)
Co-authored-by: Nutomic <me@nutomic.com>
2023-07-03 16:24:11 +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
Felix Ableitner
93b7aa7979 Version 0.4.5 2023-06-27 15:42:50 +02:00
Nutomic
325f66ba32
Fix HTTP signature expiration (ref #46) (#52) 2023-06-27 09:46:41 +02:00
Felix Ableitner
7300940e10 Version 0.4.4 2023-06-22 09:42:27 +02:00
cetra3
5de4a34550
Add a no limit option to the config (#45)
* Add a no limit option to the config

* Set defaults to `0`
2023-06-22 09:40:59 +02:00
Felix Ableitner
607aca7739 Version 0.4.3 2023-06-22 09:21:27 +02:00
Nutomic
cfcde0dcc4
Retry activity send on connection failure (fixes #41) (#48) 2023-06-22 09:21:06 +02:00
Nutomic
3d9d54cf09
Increase HTTP signature expiration time to one day (fixes #46) (#47) 2023-06-22 09:20:57 +02:00
Peter de Witte
8f997ec340
Adding security-considerations to 02_overview.md (#44)
* Adding security-considerations to 02_overview.md

* Updated layout
2023-06-20 13:48:32 +02:00
Felix Ableitner
1aa081713e Version 0.4.2 2023-06-20 12:01:38 +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
Felix Ableitner
6ac6e2d90e Version 0.4.1 2023-06-12 16:25:09 +02:00
Felix Ableitner
2075e99ebb Update dependencies 2023-06-12 16:19:30 +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
Grafcube
19baec2138
Specify in docs that send_activity takes remote inboxes (#40) 2023-05-31 14:18:36 +02:00
Felix Ableitner
51613df9e3 Move actix-rt to dev-dependencies 2023-05-24 12:41:00 +02:00
Grafcube
5181f15499
Change domain to host_str (#37) 2023-05-22 10:53:40 +02:00
Felix Ableitner
9df5bd086f Improved logging for activity send 2023-05-04 23:56:27 +02:00
Nutomic
7885e51599
Fix docs link in readme to point to latest version 2023-04-11 22:07:05 +02:00
Grafcube
99cdbb5d58
Multi webfinger response (#33)
* Add support for building webfinger for multiple URLs with type

Update `build_webfinger_response` to accept `Vec<(Url, Option<&str>)>`
where `Url` is the ActivityPub ID and `&str` is the optional type.

* Update docs for `build_webfinger_response`

* Update tests to use new `build_webfinger_response`

Tests and docs don't cover usage with some `kind` value.

* Run formatter with nightly

* Revert "Add support for building webfinger for multiple URLs with type"

This reverts commits until 3f70586e63d6f5ae6a9c329ae9e9981da4e2eaaf.
This was a breaking change and should be made into a separate function.

* Add `build_webfinger_response_with_type`

* Construct links separately and update `build_webfinger_response`

- `build_webfinger_response` calls `build_webfinger_response_with_type`.
- Links are constructed in a separate variable.
- Update docs for `build_webfinger_response_with_type` to be clearer
about usage.
- TODO: Use `derive_builder` to simplify function.

* Extract properties into variable

* Remove `other` from docs
2023-04-04 21:56:34 +02:00
Grafcube
813d7943e1
Change username regex in webfinger (#34)
* Change username regex in webfinger

Changes the regex used for username in `extract_webfinger_name` to
include additional characters like '.' and '-'. This is the same regex
used in Mastodon.

* Add link to Mastodon regex
2023-04-02 21:32:54 +02:00
Felix Ableitner
c56f526914 Add signature tests, update dependencies, remove Cargo.lock from git 2023-03-30 21:57:18 +02:00
Dessalines
6b4f798f76
Adding woodpecker 1 (#30) 2023-03-24 21:48:51 +01:00
Felix Ableitner
1669a72620 Version 0.4.0 2023-03-16 21:48:17 +01:00
Felix Ableitner
072353fc41 Dont use apub in type names 2023-03-16 21:41:43 +01:00