feat: add im home and message action flows
This commit is contained in:
@@ -338,6 +338,27 @@ func TestDispatchLoginRejectsAuthenticatorTenantMismatch(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestPublishSysRequiresRoot(t *testing.T) {
|
||||
s := &Session{
|
||||
send: make(chan any, 1),
|
||||
uid: types.Uid(42),
|
||||
authLvl: auth.LevelAuth,
|
||||
tenantID: 1,
|
||||
tenantCode: "test",
|
||||
}
|
||||
s.publish(&ClientComMessage{
|
||||
Original: "sys",
|
||||
RcptTo: "sys",
|
||||
AsUser: types.Uid(42).UserId(),
|
||||
Timestamp: time.Now(),
|
||||
Pub: &MsgClientPub{Id: "pub-1", Topic: "sys", Content: map[string]any{"type": "system"}},
|
||||
})
|
||||
resp := (<-s.send).(*ServerComMessage)
|
||||
if resp.Ctrl == nil || resp.Ctrl.Code != http.StatusForbidden {
|
||||
t.Fatalf("unexpected response: %+v", resp)
|
||||
}
|
||||
}
|
||||
|
||||
func TestDispatchRejectsCrossTenantAsUser(t *testing.T) {
|
||||
ctrl := gomock.NewController(t)
|
||||
users := mock_store.NewMockUsersPersistenceInterface(ctrl)
|
||||
|
||||
Reference in New Issue
Block a user