mirror of
https://github.com/hoernschen/dendrite.git
synced 2024-12-27 23:48:27 +00:00
Disable federation API checking for missing auth events
This commit is contained in:
parent
1bba164bf4
commit
706e5abbc9
2 changed files with 17 additions and 7 deletions
|
@ -665,6 +665,7 @@ func (t *txnReq) processEvent(ctx context.Context, e *gomatrixserverlib.Event) e
|
||||||
t.hadEvent(eventID, false)
|
t.hadEvent(eventID, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
if len(stateResp.MissingAuthEventIDs) > 0 {
|
if len(stateResp.MissingAuthEventIDs) > 0 {
|
||||||
t.work = MetricsWorkMissingAuthEvents
|
t.work = MetricsWorkMissingAuthEvents
|
||||||
logger.Infof("Event refers to %d unknown auth_events", len(stateResp.MissingAuthEventIDs))
|
logger.Infof("Event refers to %d unknown auth_events", len(stateResp.MissingAuthEventIDs))
|
||||||
|
@ -672,6 +673,7 @@ func (t *txnReq) processEvent(ctx context.Context, e *gomatrixserverlib.Event) e
|
||||||
return fmt.Errorf("t.retrieveMissingAuthEvents: %w", err)
|
return fmt.Errorf("t.retrieveMissingAuthEvents: %w", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
if len(stateResp.MissingPrevEventIDs) > 0 {
|
if len(stateResp.MissingPrevEventIDs) > 0 {
|
||||||
t.work = MetricsWorkMissingPrevEvents
|
t.work = MetricsWorkMissingPrevEvents
|
||||||
|
|
|
@ -113,6 +113,7 @@ func (r *Inputer) processRoomEvent(
|
||||||
var rejectionErr error
|
var rejectionErr error
|
||||||
if rejectionErr = gomatrixserverlib.Allowed(event, &authEvents); rejectionErr != nil {
|
if rejectionErr = gomatrixserverlib.Allowed(event, &authEvents); rejectionErr != nil {
|
||||||
isRejected = true
|
isRejected = true
|
||||||
|
logrus.WithError(rejectionErr).Warnf("Event %s rejected", event.EventID())
|
||||||
}
|
}
|
||||||
|
|
||||||
// Accumulate the auth event NIDs.
|
// Accumulate the auth event NIDs.
|
||||||
|
@ -315,8 +316,15 @@ func (r *Inputer) checkForMissingAuthEvents(
|
||||||
return fmt.Errorf("auth.AddEvent: %w", err)
|
return fmt.Errorf("auth.AddEvent: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if the auth event should be rejected.
|
||||||
|
isRejected := false
|
||||||
|
if err := gomatrixserverlib.Allowed(event, auth); err != nil {
|
||||||
|
isRejected = true
|
||||||
|
logrus.WithError(err).Warnf("Auth event %s rejected", event.EventID())
|
||||||
|
}
|
||||||
|
|
||||||
// Finally, store the event in the database.
|
// Finally, store the event in the database.
|
||||||
eventNID, _, _, _, _, err := r.DB.StoreEvent(ctx, event, authEventNIDs, false)
|
eventNID, _, _, _, _, err := r.DB.StoreEvent(ctx, event, authEventNIDs, isRejected)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("r.DB.StoreEvent: %w", err)
|
return fmt.Errorf("r.DB.StoreEvent: %w", err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue