diff options
author | Neil Alexander <neilalexander@users.noreply.github.com> | 2020-09-29 13:40:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-29 13:40:29 +0100 |
commit | 738b829a23d4e50e68f98acb72f7d10a16009f8b (patch) | |
tree | be4f86b0a3b39f10856499d869721c914d56b65f /roomserver/internal/helpers/auth.go | |
parent | 4ff7ac7b6574d6adec775057dc2c798a1fe10248 (diff) |
Fetch missing auth events, implement QueryMissingAuthPrevEvents, try other servers in room for /event and /get_missing_events (#1450)
* Try to ask other servers in the room for missing events if the origin won't provide them
* Logging
* More logging
* Implement QueryMissingAuthPrevEvents
* Try to get missing auth events badly
* Use processEvent
* Logging
* Update QueryMissingAuthPrevEvents
* Try to find missing auth events
* Patchy fix for test
* Logging tweaks
* Send auth events as outliers
* Update check in QueryMissingAuthPrevEvents
* Error responses
* More return codes
* Don't return error on reject/soft-fail since it was ultimately handled
* More tweaks
* More error tweaks
Diffstat (limited to 'roomserver/internal/helpers/auth.go')
-rw-r--r-- | roomserver/internal/helpers/auth.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/roomserver/internal/helpers/auth.go b/roomserver/internal/helpers/auth.go index 834bc0c6..0fa89d9c 100644 --- a/roomserver/internal/helpers/auth.go +++ b/roomserver/internal/helpers/auth.go @@ -83,7 +83,7 @@ func CheckForSoftFail( // Check if the event is allowed. if err = gomatrixserverlib.Allowed(event.Event, &authEvents); err != nil { // return true, nil - return true, fmt.Errorf("gomatrixserverlib.Allowed: %w", err) + return true, err } return false, nil } @@ -99,7 +99,7 @@ func CheckAuthEvents( // Grab the numeric IDs for the supplied auth state events from the database. authStateEntries, err := db.StateEntriesForEventIDs(ctx, authEventIDs) if err != nil { - return nil, err + return nil, fmt.Errorf("db.StateEntriesForEventIDs: %w", err) } authStateEntries = types.DeduplicateStateEntries(authStateEntries) @@ -109,7 +109,7 @@ func CheckAuthEvents( // Load the actual auth events from the database. authEvents, err := loadAuthEvents(ctx, db, stateNeeded, authStateEntries) if err != nil { - return nil, err + return nil, fmt.Errorf("loadAuthEvents: %w", err) } // Check if the event is allowed. |