Commit graph

13 commits

Author SHA1 Message Date
Felix Ableitner 071218396b clippy 2023-10-24 10:54:16 +02:00
Felix Ableitner 13f96d05f7 Support different alphabets in webfinger username 2023-10-23 13:01:05 +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
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
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
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
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
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 3f70586e63.
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 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
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
Renamed from src/webfinger.rs (Browse further)