diff options
author | 2022-04-26 18:10:11 +0200 | |
---|---|---|
committer | 2022-04-26 18:10:11 +0200 | |
commit | 9cf66bf29871dad6523f421ae72125d584ac4c9a (patch) | |
tree | 328b62cb9fb8374dee576a3bb0f2ec213c0e93a0 /internal/federation/federator.go | |
parent | [bugfix] Trim log entries to 1700 chars before they enter syslog (#493) (diff) | |
download | gotosocial-9cf66bf29871dad6523f421ae72125d584ac4c9a.tar.xz |
[chore] Return more useful errors from auth failure (#494)v0.3.1
* try rsa_sha256 sig algo first
* return more informative errors from auth
* adapt to reworked auth function
Diffstat (limited to 'internal/federation/federator.go')
-rw-r--r-- | internal/federation/federator.go | 3 |
1 files changed, 2 insertions, 1 deletions
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. |