]> cat aescling's git repositories - mastodon.git/commit
Improve error reporting and logging when processing remote accounts (#15605)
authorClaire <claire.github-309c@sitedethib.com>
Tue, 20 Sep 2022 21:30:26 +0000 (23:30 +0200)
committeraescling <aescling+gitlab@cat.family>
Thu, 17 Nov 2022 03:03:48 +0000 (22:03 -0500)
commit15fa3c0aa390581c550a636c61f858124d6b3f20
treeeeed5769d3cc5e77a84989a70576d6ea762f2ec1
parent5a976a0f1a413791f7fc2ac2342b3f2bf353dff6
Improve error reporting and logging when processing remote accounts (#15605)

* Add a more descriptive PrivateNetworkAddressError exception class

* Remove unnecessary exception class to rescue clause

* Remove unnecessary include to JsonLdHelper

* Give more neutral error message when too many webfinger redirects

* Remove unnecessary guard condition

* Rework how “ActivityPub::FetchRemoteAccountService” handles errors

Add “suppress_errors” keyword argument to avoid raising errors in
ActivityPub::FetchRemoteAccountService#call (default/previous behavior).

* Rework how “ActivityPub::FetchRemoteKeyService” handles errors

Add “suppress_errors” keyword argument to avoid raising errors in
ActivityPub::FetchRemoteKeyService#call (default/previous behavior).

* Fix Webfinger::RedirectError not being a subclass of Webfinger::Error

* Add suppress_errors option to ResolveAccountService

Defaults to true (to preserve previous behavior). If set to false,
errors will be raised instead of caught, allowing the caller to be
informed of what went wrong.

* Return more precise error when failing to fetch account signing AP payloads

* Add tests

* Fixes

* Refactor error handling a bit

* Fix various issues

* Add specific error when provided Digest is not 256 bits of base64-encoded data

* Please CodeClimate

* Improve webfinger error reporting
app/controllers/concerns/signature_verification.rb
app/lib/request.rb
app/lib/webfinger.rb
app/services/activitypub/fetch_remote_account_service.rb
app/services/activitypub/fetch_remote_key_service.rb
app/services/activitypub/process_account_service.rb
app/services/resolve_account_service.rb
lib/exceptions.rb
spec/services/activitypub/fetch_remote_account_service_spec.rb
spec/services/resolve_account_service_spec.rb