/send auth errors are silent (#1149)

* /send auth errors are silent

* Fix test
This commit is contained in:
Kegsay 2020-06-23 10:31:17 +01:00 committed by GitHub
parent a1352cbd9e
commit 02565c37aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 2 deletions

View File

@ -176,9 +176,17 @@ func (t *txnReq) processTransaction() (*gomatrixserverlib.RespSend, error) {
util.GetLogger(t.context).Warnf("Processing %s failed fatally: %s", e.EventID(), err)
return nil, err
} else {
util.GetLogger(t.context).WithError(err).WithField("event_id", e.EventID()).Warn("Failed to process incoming federation event, skipping")
// Auth errors mean the event is 'rejected' which have to be silent to appease sytest
_, rejected := err.(*gomatrixserverlib.NotAllowed)
errMsg := err.Error()
if rejected {
errMsg = ""
}
util.GetLogger(t.context).WithError(err).WithField("event_id", e.EventID()).WithField("rejected", rejected).Warn(
"Failed to process incoming federation event, skipping",
)
results[e.EventID()] = gomatrixserverlib.PDUResult{
Error: err.Error(),
Error: errMsg,
}
}
} else {

View File

@ -44,3 +44,7 @@ Existing members see new members' join events
Can recv device messages over federation
Device messages over federation wake up /sync
Wildcard device messages over federation wake up /sync
# We don't implement soft-failed events yet, but because the /send response is vague,
# this test thinks it's all fine...
Inbound federation accepts a second soft-failed event