From 9cf66bf29871dad6523f421ae72125d584ac4c9a Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Tue, 26 Apr 2022 18:10:11 +0200 Subject: [chore] Return more useful errors from auth failure (#494) * try rsa_sha256 sig algo first * return more informative errors from auth * adapt to reworked auth function --- internal/federation/federator.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'internal/federation/federator.go') diff --git a/internal/federation/federator.go b/internal/federation/federator.go index 4359e17db..61d7f3e17 100644 --- a/internal/federation/federator.go +++ b/internal/federation/federator.go @@ -27,6 +27,7 @@ import ( "github.com/superseriousbusiness/gotosocial/internal/db" "github.com/superseriousbusiness/gotosocial/internal/federation/dereferencing" "github.com/superseriousbusiness/gotosocial/internal/federation/federatingdb" + "github.com/superseriousbusiness/gotosocial/internal/gtserror" "github.com/superseriousbusiness/gotosocial/internal/gtsmodel" "github.com/superseriousbusiness/gotosocial/internal/media" "github.com/superseriousbusiness/gotosocial/internal/transport" @@ -50,7 +51,7 @@ type Federator interface { // If the request does not pass authentication, or there's a domain block, nil, false, nil will be returned. // // If something goes wrong during authentication, nil, false, and an error will be returned. - AuthenticateFederatedRequest(ctx context.Context, username string) (*url.URL, bool, error) + AuthenticateFederatedRequest(ctx context.Context, username string) (*url.URL, gtserror.WithCode) // FingerRemoteAccount performs a webfinger lookup for a remote account, using the .well-known path. It will return the ActivityPub URI for that // account, or an error if it doesn't exist or can't be retrieved. -- cgit v1.2.3