Manual Cherrypick: Add audits for accessing posts without membership (#31266) (#35022)

Automatic Merge
Этот коммит содержится в:
Daniel Espino García
2026-01-26 11:23:28 +01:00
коммит произвёл GitHub
родитель 12dce033d6
Коммит 21a86506f9
79 изменённых файлов: 1707 добавлений и 1001 удалений

Просмотреть файл

@@ -110,7 +110,7 @@ func TestSendAutoResponseIfNecessary(t *testing.T) {
channel := th.CreateDmChannel(receiver)
savedPost, _ := th.App.CreatePost(th.Context, &model.Post{
savedPost, _, _ := th.App.CreatePost(th.Context, &model.Post{
ChannelId: channel.Id,
Message: NewTestId(),
UserId: th.BasicUser.Id,
@@ -141,7 +141,7 @@ func TestSendAutoResponseIfNecessary(t *testing.T) {
channel := th.CreateDmChannel(receiver)
savedPost, _ := th.App.CreatePost(th.Context, &model.Post{
savedPost, _, _ := th.App.CreatePost(th.Context, &model.Post{
ChannelId: channel.Id,
Message: NewTestId(),
UserId: th.BasicUser.Id,
@@ -159,7 +159,7 @@ func TestSendAutoResponseIfNecessary(t *testing.T) {
th := Setup(t).InitBasic()
defer th.TearDown()
savedPost, _ := th.App.CreatePost(th.Context, &model.Post{
savedPost, _, _ := th.App.CreatePost(th.Context, &model.Post{
ChannelId: th.BasicChannel.Id,
Message: NewTestId(),
UserId: th.BasicUser.Id,
@@ -200,7 +200,7 @@ func TestSendAutoResponseIfNecessary(t *testing.T) {
botUser, err := th.App.GetUser(bot.UserId)
assert.Nil(t, err)
savedPost, _ := th.App.CreatePost(th.Context, &model.Post{
savedPost, _, _ := th.App.CreatePost(th.Context, &model.Post{
ChannelId: channel.Id,
Message: NewTestId(),
UserId: botUser.Id,
@@ -236,7 +236,7 @@ func TestSendAutoResponseIfNecessary(t *testing.T) {
// which needs to be cleaned up.
require.NoError(t, th.GetSqlStore().Post().PermanentDeleteByUser(th.Context, th.BasicUser.Id))
savedPost, err := th.App.CreatePost(th.Context, &model.Post{
savedPost, _, err := th.App.CreatePost(th.Context, &model.Post{
ChannelId: channel.Id,
Message: patch.NotifyProps["auto_responder_message"],
UserId: receiver.Id,
@@ -274,7 +274,7 @@ func TestSendAutoResponseSuccess(t *testing.T) {
userUpdated1, err := th.App.PatchUser(th.Context, user.Id, patch, true)
require.Nil(t, err)
savedPost, _ := th.App.CreatePost(th.Context, &model.Post{
savedPost, _, _ := th.App.CreatePost(th.Context, &model.Post{
ChannelId: th.BasicChannel.Id,
Message: "zz" + model.NewId() + "a",
UserId: th.BasicUser.Id,
@@ -319,7 +319,7 @@ func TestSendAutoResponseSuccessOnThread(t *testing.T) {
userUpdated1, err := th.App.PatchUser(th.Context, user.Id, patch, true)
require.Nil(t, err)
parentPost, _ := th.App.CreatePost(th.Context, &model.Post{
parentPost, _, _ := th.App.CreatePost(th.Context, &model.Post{
ChannelId: th.BasicChannel.Id,
Message: "zz" + model.NewId() + "a",
UserId: th.BasicUser.Id,
@@ -327,7 +327,7 @@ func TestSendAutoResponseSuccessOnThread(t *testing.T) {
th.BasicChannel,
model.CreatePostFlags{SetOnline: true})
savedPost, _ := th.App.CreatePost(th.Context, &model.Post{
savedPost, _, _ := th.App.CreatePost(th.Context, &model.Post{
ChannelId: th.BasicChannel.Id,
Message: "zz" + model.NewId() + "a",
UserId: th.BasicUser.Id,
@@ -373,7 +373,7 @@ func TestSendAutoResponseFailure(t *testing.T) {
userUpdated1, err := th.App.PatchUser(th.Context, user.Id, patch, true)
require.Nil(t, err)
savedPost, _ := th.App.CreatePost(th.Context, &model.Post{
savedPost, _, _ := th.App.CreatePost(th.Context, &model.Post{
ChannelId: th.BasicChannel.Id,
Message: "zz" + model.NewId() + "a",
UserId: th.BasicUser.Id,