Граф коммитов

703 Коммитов

Автор SHA1 Сообщение Дата
Ben Cooke
0d6b1070a2 [MM-58549] Desktop login (#27732)
* desktop oauth and saml login
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
2024-08-21 18:00:19 -04:00
Arya Khochare
4999c4a9c6 Get posts for a channel has_next attribute fix (#26901)
* Get posts for a channel has_next attribute fix

* HasNext attribute test changes

* tests fix

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-08-21 11:00:42 +05:30
Agniva De Sarker
3150900bd7 MM-59827: Remove user profile invalidations from channel APIs (#27720)
We were invalidating the userProfileByIds cache unnecessarily
when it wasn't really needed. It's just that the InvalidateCacheForUser
method wiped off all user related caches, when we just needed to wipe
user-channel related caches.

To fix this, we split the user cache invalidation method into two
and just call the InvalidateChannelCacheForUser method from app/channel.go.

https://mattermost.atlassian.net/browse/MM-59827
```release-note
NONE
```
2024-08-19 20:02:35 +05:30
enzowritescode
91d4bc627d Remove redundant check and fix language in comment (#27991)
* Remove redundant if statement

* Fix language in comment per IDE recommendation
2024-08-15 14:13:44 -06:00
Julien Tant
5f19d8513b [MM-60026] Add playbooks <v2 in the transitionaslly packaged list (#27903) 2024-08-14 10:22:18 -07:00
Ben Schumacher
fc1a111b06 [MM-38131] Remove deprecated pageSize query parameter (#27957) 2024-08-13 22:18:22 +02:00
Ben Schumacher
bcf92d3f53 Fix flaky TestCreateZipFileAndAddFiles/write_one_file - 2nd round (#27923) 2024-08-13 10:49:05 +02:00
Agniva De Sarker
a1012d33eb MM-59932: Migrate remaining caches to Redis (#27880)
- We introduce 2 new APIs:
1. Scan: this allows incremental iteration
without blocking the Redis server and is the
recommended way to iterate over keys. With this,
we have entirely removed the need for Keys.
2. RemoveMulti: this allows deletion of multiple
keys in a single operation which optimizes
network round trips.

- While here, we make a small improvement to
GetStatusFromCache, where we remove the shallow
copy which wasn't necessary because we always
serialize the data from the cache.
- We do not use Redis for session cache because of
frequent requests to iterate the entire cache which leads
to a lot of `SCAN` calls.
- Avoid broadcasting status update messages for Redis case.
- Setting cache expiry for status cache
- Removing .Set method altogether to prevent
any chances of setting an item with no expiry.

https://mattermost.atlassian.net/browse/MM-59932

```release-note
NONE
```
2024-08-13 14:18:25 +05:30
Ben Schumacher
b5ac317e82 [MM-60152] Fix notifications log file location for Support Packet (#27921) 2024-08-12 14:40:04 +02:00
alexcekay
7232b5f002 [GH-26715] Added Pagination Support for IncomingWebHooks (#27502)
* Added Pagination Support for IncomingWebHooks

* Incorporated feedback from reviews

* Removed trailing spaces

* Restored deleted server en.json entries, fixed order in webapp en.json

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-08-09 16:44:22 -04:00
Miguel de la Cruz
cd99c4068d Removes the backslash in migrations.list (#27882)
The use of the backslash was causing issues between different versions
of make.
2024-08-09 11:17:15 +02:00
Miguel de la Cruz
59873a2a50 Adds default team to the remote cluster entity (#27863)
* Adds default team to the remote cluster entity

A new DefaultTeamId field is added to the RemoteCluster entity and its
endpoints, and used when receiving channel invites to choose in which
team to create a new channel.

This will be later extended with the ability for the system admin to
manually accept invites, choosing which team to create the channel on
each. This use case will be triggered when the DefaultTeamId field is
empty, which now simply chooses the first team it finds in the
database as a fallback.

* Fix migrations list

* Fixes channelinvite test case

* Fix i18n

* Fix migration list
2024-08-08 16:36:27 +02:00
Miguel de la Cruz
eec9a4742a Allows creating new remote clusters without providing a password (#27864)
* Allows creating new remote clusters without providing a password

If the endpoint receives a request with no password, it will generate
one internally and return it in the response, so the frotend can show
it to the user.

* Use a random string instead of a UUID for the generated password

* Update function name to avoid CString reference and adds assertion

* Update server/channels/utils/textgeneration.go

Co-authored-by: Eva Sarafianou <eva.sarafianou@gmail.com>

* Extends the charset

---------

Co-authored-by: Eva Sarafianou <eva.sarafianou@gmail.com>
2024-08-08 12:18:21 +02:00
Julien Tant
06d8c857ea [MM-60025][MM-59522] Add playbooks v2 to prepackaged plugins (#27862)
* add playbooks v2 to prepackaged plugins

* Update Makefile
2024-08-07 14:17:10 -07:00
Devin Binnie
90884172ae [MM-59911] Force individual users to receive the user_added and group_added events instead of relying on the channel membership (#27846)
* [MM-59911] Force individual users to receive the `user_added` and `group_added` events instead of relying on the channel membership

* Fix redundant JSON serializing
2024-08-07 11:29:36 +00:00
Devin Binnie
6ae03a098e [MM-58492] Remove subsequent check for team permissions on open channels (#27827)
* [MM-58492] Remove subsequent check for team permissions on open channels

* Removed extra check for open channel for webhooks as well

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-08-06 08:56:25 -04:00
Harshil Sharma
69a8b3df0f Cleanup post embed for WebSocket payload (#27763)
* Cleanup post embed for WebSocket payload

* Removing post embeds in create post API

* Fixed a nil check:

* Removed a now-irrelavent test

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-08-06 15:17:31 +05:30
Agniva De Sarker
540febd866 MM-56876: Redis: first introduction (#27752)
```release-note
NONE
```

---------

Co-authored-by: Jesús Espino <jespinog@gmail.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
2024-08-06 09:28:41 +05:30
Agniva De Sarker
c3ed07e679 OSF: Used model.NewPointer everywhere (#27838)
```release-note
NONE
```
2024-08-06 09:15:00 +05:30
Claudio Costa
f290745496 Fully deprecate /api/v4/image endpoint when image proxy is disabled (#27595)
Co-authored-by: Mattermost Build <build@mattermost.com>
2024-08-05 12:33:09 +02:00
Ben Schumacher
1158e6358c [MM-54593] HA aware Support Packet (#27598) 2024-08-03 16:11:13 +02:00
Domenico Rizzo
bb78de5b7f [MM-50087] Refactored channel saving logic in case of duplicate (#27542)
* Refactored channel saving logic

The code for saving channels has been refactored handling different database drivers. The query string is now dynamically generated based on the driver in use. Additionally, error handling has been improved to account for cases where no rows are affected by the insert operation. Because a conflict should be detected due to the complex flow under the call of the function.

* Refactor variable name and error handling in channel store

The variable 'q' has been renamed to 'insert' for better readability. Error handling after executing the insert statement has been improved by checking for errors immediately after execution, rather than waiting until rows affected are checked. This provides a more immediate response to potential issues during the insert operation.

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-08-02 20:35:21 +05:30
Agniva De Sarker
28939d84da MM-59283: Minor improvement in getClientConfig (#27825)
Overall, there is no bug here. But opportunities for
improvement.
- Used the maps.Clone function.
- Handled the error while writing to the network.

https://mattermost.atlassian.net/browse/MM-59283
```release-note
NONE
```
2024-08-01 21:09:58 +05:30
Claudio Costa
453eabb54a Fully deprecate CallsEnabled feature flag (#27826)
Co-authored-by: Mattermost Build <build@mattermost.com>
2024-08-01 07:41:46 +00:00
Jesse Hallam
19bf864f04 update missed model.NewUsername() for app.TestZippedImportPostAndRepliesWithAttachments (#27829) 2024-07-31 17:52:42 +00:00
Jesse Hallam
1f26de3024 MM-59875: default apps enabled false (#27756)
* MM-59875: default apps enabled false

We stopped prepackaging the apps framework and stopped supporting it in
Mattermost Cloud a year ago. As part of v10, we're formally deprecating
it, while making allowances for customers who still need to transition
by not making this a breaking change immediately. To help prevent new
adoption, let's ensure the feature flag is disabled by default.

Fixes: https://mattermost.atlassian.net/browse/MM-59875

* fix tests
2024-07-31 17:18:30 +00:00
Jesse Hallam
3fdfce6ddb update missed model.Username for TestAddUserToGroupSyncables (#27828) 2024-07-31 16:46:32 +00:00
Scott Bishel
08ed72f060 MM-54502 - Update regex to force first character to be alpha (#24675)
Automatic Merge
2024-07-31 17:27:52 +03:00
Nick Misasi
5bfb32c504 [CLD-8131] Convert Subscription History Reporting to a Job (#27800)
* Remove CloudFreeDeprecated feature flag

* Fixes for CI pipelines

* Remove CloudReverseTrial feature flag and accompanying code (#27676)

Co-authored-by: Mattermost Build <build@mattermost.com>

* Stashing

* Convert subscription history reporting into a daily job

* Update comments

* Fix pipeline, redundant varaible declaration removed

* Add debug logs for start/finish

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-07-31 08:31:55 -04:00
Devin Binnie
aa85a13c8f [MM-58492][MM-58523] Fixed some access control bugs around archived channels by replacing the permission check with HasPermissionToReadChannel (#27409)
* [MM-58492][MM-58523] Fixed some access control bugs around archived channels by replacing the permission check with HasPermissionToReadChannel

* Fix lint, add ChannelId to uploads

* Fix MMCTL tests and remove unnecessary check for the error message that doesn't work anyways

* Include channel map for getting flagged posts

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-07-29 10:05:20 -04:00
Ben Schumacher
705679e875 Fix flaky TestCreateZipFileAndAddFiles/write_one_file (#27737) 2024-07-29 10:04:56 +02:00
Julien Tant
5547504c1d [MM-58378] Prevent prepackaged playbook v2 from upgrading on servers without enterprise license (#27335)
* add check for playbooks v2

* add new license helper

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-07-26 11:03:44 +02:00
Harshil Sharma
eb6336ce7a Fixed bug around channel file sidebar (#27705)
* Fixed the issue for DB layer, ES to go

* Handled channel bookmarks

* Handled Bleve

* Lint fix

* Added channel bookmark test

* Skip bleve test

* Used common function

* SKipping ES as indexing logic in unavailable in test
2024-07-26 11:45:42 +05:30
Ben Cooke
b244bb621d [MM-56904] Reduce the number of api requests made to fetch user information for GMs on page load (#27149)
* use new endpoint to fetch group members
2024-07-25 15:57:23 -04:00
Harshil Sharma
79480494d0 Prominent payload limit error and configurable URL length limit (#27747)
* Added context error handler for MaxBytesError

* Made URL length limit configurable

* Added tests

* Removed an unused function

* Typo
2024-07-25 09:09:58 +00:00
Ben Schumacher
733156ed23 [MM-59825] Fix linter error found by updated govet (#27715) 2024-07-23 13:10:31 +02:00
Scott Bishel
db138fd23a Remove deprecated function (#27605)
* make /ancillary a post

* remove get from client, fix tests

* remove GET for retrieving ancillary permissions

* Update permissions.yaml

* Update permissions.yaml

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-07-17 16:02:39 -06:00
Harshil Sharma
b25820b5c5 Added a bunch of debugging logs for Elasticsearch index check (#27678)
* Added a bunch of debugging logs for Elasticsearch index check

* Update server/channels/app/elasticsearch.go

---------

Co-authored-by: Harrison Healey <harrisonmhealey@gmail.com>
2024-07-17 13:37:34 +05:30
Scott Bishel
ea6490a5eb MM-58847 Sanitize User (#27471)
* add more fields to sanitizeInput on User

* add test for user sanoitizeInput

* add more fields

* remove line, lint fix

* additional fields and sanitize update

* Update user_test.go

* remove fields that are unnecessary to check

* add check to test

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-07-16 11:39:47 -06:00
enzowritescode
d44c3d5d45 Replace Hard-coded HTTP Verbs with Constants (#27219)
* Replace hard-coded HTTP verbs with constants in `net/http`
2024-07-15 08:52:03 -06:00
Ben Schumacher
ff3ed78124 [MM-59292] Add metadata to Support Packet (#27573) 2024-07-14 20:26:43 +02:00
Ben Schumacher
bbc8baac0a [MM-59350] Include LDAP vendor errors in Support Packet (#27571) 2024-07-13 10:17:07 +02:00
Harshil Sharma
40abf8ef66 Updated required role for user report page GET API (#27529)
* Updated required role for user report page GET API

* Updated permission in error message

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-07-12 11:13:09 +05:30
Harshil Sharma
87d983cc7f Sysadmin manage user settings (#27583)
* Opened modal from system console

* WIP

* WIP

* WIP

* Handled saving user

* Successfully updated user based settings

* WIP

* WIP

* All settings are updating well

* Fixed modal style

* Added admin mode indicators in modal

* Added confirmation dialog

* Lint fixes

* Added license check

* Added permission check

* Fixed i18n file order

* type fix

* Updated snapshots

* Handled performance debugging setting

* Some styling tweaks

* Fixed text alighnment

* Updated license required from professional to enterprise

* Handled long user names

* review fixes

* Added manage setting option in user list page context menu

* Added loader

* Minor reordering

* Removed confirm modal

* Updated snapshots for removed modal

* Added some tests

* Lint fix

* Used new selector in user detail page

* Used new selector in user list page

* Updated tests

* Fixed an incorrect default test
2024-07-12 10:22:04 +05:30
Agniva De Sarker
177389d224 MM-53962: Adding ES8 dependency (#24399)
* Adding ES8 dependency

```release-note
NONE
```


Co-authored-by: Mattermost Build <build@mattermost.com>
2024-07-11 13:13:31 +05:30
Scott Bishel
5d7027a172 MM-58776 - Change Ancillary Permissions API to POST (#27504)
* make /ancillary a post

* remove get from client, fix tests

* Update permissions.yaml
2024-07-10 08:12:56 -06:00
Harrison Healey
e3b2b13292 MM-58535 Add more information to LCP and INP metrics (#27484)
* Improve mocking of imported resources in unit tests

We have Webpack configured so that, when code imports an image or other resource, the code gets the URL of that image. Jest now matches that behaviour which is needed because React Testing Library would previously throw an error.

* Polyfill ResizeObserver in all unit tests

* Ensure haveIChannelPermission always returns a boolean value

The previous code could sometimes return undefined. While that should behave the same in practice, it can cause React to print prop type warnings

* MM-58535 Add region label to LCP metrics

* MM-58535 Upgrade web-vitals and add INP attribution

* Change new labels to use snake_case

* Remove replaceGlobalStore option from renderWithContext

I was going to add this in case any tests failed with this option set to false, but after running those tests, that's not the case. I'm going to remove this as an option since it seems more likely than not that anyone using RTL would prefer to have this on.
2024-07-09 15:06:08 -04:00
Scott Bishel
99881b819a MM-58548 Remove manage_team permissions from System Console Ancillary permissions (#27395)
* remove manage team permissions from sysconsole_write_user_management_chanels and sysconsole_write_user_management_groups

* update migrations, add unit tests

* run migrations-extract

* make updating ancillary permissions a post

* update file names

* add new api to doc, update body to just be []string

* revert moving ancillary permissions to post

* fix queries after final testing

* Update channel.go

* Update channel.go

* Update 000124_remove_manage_team_permission.up.sql

* Update 000124_remove_manage_team_permission.up.sql

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-07-09 08:21:29 -06:00
Ben Schumacher
6fc5ff572f Don't modify global variables in TestNoticeValidation (#27591) 2024-07-09 12:36:08 +02:00
Christopher Poile
9b2f20210b [MM-56339] Audit logs: on login add UserId and SessionId to audit's Actor field (#27446)
* on login add UserId and SessionId to audit's Actor field to match logout

* lint

* simplify to add only userId and sessionId

* AddToEventActor -> AddUser/SessionToEventActor

* fill in missing session data when logging the audit record

* why did it bump that? reverting.

* make modules-tidy

* trigger build

* add more context to the comment
2024-07-08 18:56:54 -04:00