MCPcopy Create free account
hub / github.com/daodst/chat / TestTransactionFailAuthChecks

Function TestTransactionFailAuthChecks

federationapi/routing/send_test.go:271–280  ·  view source on GitHub ↗

The purpose of this test is to check that if the event received fails auth checks the event is still sent to the roomserver as it does the auth check.

(t *testing.T)

Source from the content-addressed store, hash-verified

269// The purpose of this test is to check that if the event received fails auth checks the event is still sent to the roomserver
270// as it does the auth check.
271func TestTransactionFailAuthChecks(t *testing.T) {
272 rsAPI := &testRoomserverAPI{}
273 pdus := []json.RawMessage{
274 testData[len(testData)-1], // a message event
275 }
276 txn := mustCreateTransaction(rsAPI, &txnFedClient{}, pdus)
277 mustProcessTransaction(t, txn, []string{})
278 // expect message to be sent to the roomserver
279 assertInputRoomEvents(t, rsAPI.inputRoomEvents, []*gomatrixserverlib.HeaderedEvent{testEvents[len(testEvents)-1]})
280}
281
282// The purpose of this test is to make sure that when an event is received for which we do not know the prev_events,
283// we request them from /get_missing_events. It works by setting PrevEventsExist=false in the roomserver query response,

Callers

nothing calls this directly

Calls 3

mustCreateTransactionFunction · 0.85
mustProcessTransactionFunction · 0.85
assertInputRoomEventsFunction · 0.85

Tested by

no test coverage detected