Commit Graph

171 Commits

Author SHA1 Message Date
Scott Bishel
82b8d4dc07 MM-55966 - Update ArrayFromJSON to use LimitedReader (#25510)
* update ArrayFromJSON to use LimitedReader

* update for bad merge

* fix lint errors

* update test code

* update unit tests

* update unit tests

* fix unit tests

* use consts, other cleanup

* add non sorting duplicate check

* set config to default value, then config setting if available

* fix lint errors

* fixes and debugs

* fix log test

* remove setting from Client, add unlimited Parser to client

* a couple more fixes

* another fix

* rename some variables

* remove superflous call

* check for valid MaximumPayloadSize

* update language file

* fix for e2e-tests

* update util function to return error

* lint fix

* update config property name to include unit

* fix for unit test

* add new config to telemetry

* call function to create LimitedReader

* Deprecate old function, use new function name

* return new AppError on failed parse

* return new AppError on failed parse

* return new AppError on failed parse

* add constant for i18n valid constants

* Update server/public/model/utils_test.go

Co-authored-by: Miguel de la Cruz <mgdelacroix@gmail.com>

* Apply suggestions from code review

Co-authored-by: Miguel de la Cruz <mgdelacroix@gmail.com>

* update error variable, remove unnecessary check

* Update function names

* fix errors from merge

* update unit test to create unique ids

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Co-authored-by: Miguel de la Cruz <mgdelacroix@gmail.com>
2024-01-09 10:04:16 -07:00
Doug Lauder
241e8edc2e Ping new shared channels remotes immediately (#25850)
* option for auto inviting plugin to all shared channels.

* auto-invite remotes to shared channels when flag set

* fix unit test

* immediately ping new remotes; fix unique siteurl bug

* make i18n-extract

* fix translations

* fix merge conflicts

* make modules-tidy

* revert accidental go.mod change

* revert accidental go.sum changes

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-01-09 12:35:05 +01:00
Miguel de la Cruz
6184c36e0b Fix make permission error (#25860) 2024-01-08 14:45:48 +01:00
Miguel de la Cruz
e1a27cf57f Adds a team check to get groups by team (#25462)
* Adds a team check to get groups by team

* Update to take into account groups_by_channel and new permissions

* Update API docs
2024-01-08 13:28:51 +01:00
Nick Misasi
e52940cd08 Lock wrangler behind enterprise (#25703)
* Lock wrangler behind enterprise

* Run tests with SetupEnterprise so Thread Moving is unlocked. Tweak NewTestLicense to include a SkuShortName for 'enterprise'

* Don't set SkuShortName in NewTestLicense just in case. Fix up some old debug code in tests

* Remove checks on enterprise/e20 and just enforce that the workspace has any license

* Update admin_definition.tsx accordingly

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-01-05 13:20:37 -05:00
Devin Binnie
ac854498a4 [MM-56266] Check for public channels when getting channel member counts to avoid 403 errors (#25831)
* [MM-56266] Check for public channels when getting channel member counts to avoid 403 errors

* Fix test
2024-01-05 12:28:22 -05:00
Harrison Healey
502cd6ef7d MM-56082 Add PreferencesHaveChanged plugin hook (#25659)
* Add interface for PreferencesHaveChanged hook

* Add context to preference-related methods of App

* Implement PreferencesHaveChanged

* Re-add missing "fmt" import

* Update minimum server version for the new hook

* Remove pointers to be consistent with other preference APIs
2024-01-03 12:25:53 -05:00
Felipe Martin
81a1d725a0 [WIP] [MM-55031] OAuth Outgoing Connection App integration (#25379)
* OAuthOutgoingConnection model

* added store

* make generated

* add missing license headers

* fix receiver name

* i18n

* i18n sorting

* update migrations from master

* make migrations-extract

* update retrylayer tests

* replaced sql query with id pagination

* fixed flaky tests

* missing columns

* missing columns on save/update

* typo

* improved tests

* remove enum from mysql colum

* add password credentials to store

* license changes

* OAuthOutgoingConnectionInterface

* Oauth -> OAuth

* make generated

* merge migrations

* renamed migrations

* model change suggestions

* refactor test functionsn

* migration typo

* refactor store table names

* updated sanitize test

* cleanup merge

* refactor symbol

* list endpoint

* oauthoutgoingconnection -> outgoingoauthconnection

* signature change

* i18n update

* granttype typo

* naming

* api list

* uppercase typo

* i18n

* missing license header

* fixed path in comments

* updated openapi definitions

* sanitize connections

* make generated

* test license and no feature flag

* removed t.fatal

* updated testhelper calls

* yaml schema fixes

* switched interface name

* suggested translation

* missing i18n translation

* address comments

* updated i18n
2023-12-26 10:46:20 +01:00
Doug Lauder
2d1135ca46 Shared channels plugin APIs for MS Teams plugin (#25805)
New plugin APIs and hooks for accessing Shared Channels service via plugin. 

- RegisterPluginForSharedChannels(opts model.RegisterPluginOpts) (remoteID string, err error)
- UnregisterPluginForSharedChannels(pluginID string) error
- ShareChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
- UpdateSharedChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
- UnshareChannel(channelID string) (unshared bool, err error)
- UpdateSharedChannelCursor(channelID, remoteID string, cusror model.GetPostsSinceForSyncCursor) error
- SyncSharedChannel(channelID string) error
- InviteRemoteToChannel(channelID string, remoteID string, userID string) error
- UninviteRemoteFromChannel(channelID string, remoteID string) error

Hooks
- OnSharedChannelsSyncMsg(msg *model.SyncMsg, rc *model.RemoteCluster) (model.SyncResponse, error)
- OnSharedChannelsPing(rc *model.RemoteCluster) bool
2023-12-22 17:00:27 -05:00
Agniva De Sarker
0496483a9e MM-56359: Skip TestUploadLicenseFile (#25800) 2023-12-22 13:21:33 +01:00
Miguel de la Cruz
0e60f3d542 Improves validation in getRolesByName endpoint (#25215)
* Improves validation in getRolesByName endpoint

* Updates the max constant and fixes linter

* Adds a mechanism to split roles in chunks in the webapp client

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2023-12-22 10:29:51 +01:00
Harshil Sharma
a59f5ccded Added API to return user count bands and user count (#25796) 2023-12-21 13:00:19 +00:00
Agniva De Sarker
7dcf5f85a5 MM-56071: Track multiple threads (#25775)
We can have 2 types of threads open at the same time. One from
the thread view, and another from RHS.

We add another variable to distinguish between the 2 states.

In future, if we have the ability for more than 2 threads, then
we would need to track by threadID.

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

```release-note
NONE
```
2023-12-21 08:42:58 +05:30
Matthew Straughn
ebdc964161 Mm 16623 fix all initialism errors in channels/app and channels/api4 dir (#25743)
* updated go mod and sum files

* fixed var-naming errors in channels/app and channels/api4 dir

* Revert "updated go mod and sum files"

This reverts commit 088dd00a84.

* renamed a cost .
2023-12-20 06:46:54 +01:00
Ben Schumacher
1fdddfe678 [MM-53269] Add configuration setting for integration requests timeout (#23805)
Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com>
2023-12-18 16:07:00 +01:00
Devin Binnie
5c061a6f75 [MM-56206] Allow for proper paging and sorting (#25726)
Co-authored-by: Mattermost Build <build@mattermost.com>
2023-12-18 05:56:06 +05:30
Harshil Sharma
97a23d791e New report router and user reporting refactoring (#25713)
* Added materialized view migration

* Renamed mat view

* Added channel membership mat view and indexes

* Added channel membership mat view and indexes

* Added new index

* WIP

* Simplifying user reporting code

* Created app and API layer for cahnnel reporting, reporting refactoring in general

* New router

* Remobved channel reporting meanwhile

* Upodated autogenerated stuff

* Lint fix

* Fixed typo

* api vet

* i18n fix

* Fixed API vetting and removed channel reporting constants

* yaml

* removed app pagination tests
2023-12-14 10:49:19 -05:00
Agniva De Sarker
c42ae47948 MM-56071: Thread presence indicator (#25694)
We also track the channelID of the thread opened.

Additionally on every connection create or re-connect
with an existing queue, we reset the active state to empty
to avoid any edge-cases.

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

```release-note
NONE
```
2023-12-13 13:58:40 +05:30
Agniva De Sarker
b946dad78d MM-55987: Bypass uploading to S3 for local mode mmctl import (#25591)
We directly instruct the server to read from the local filesystem
in case the local_mode key is set.

There is now no need to upload the file in --local mode and a warning
is thrown accordingly.

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

```release-note
Now the mmctl bulk import process command in local mode supports processing an import file without actually uploading it to the server. Simply pass the file path to the import file and the server will directly read from it, and pass the --bypass-upload flag. There is no need to use the import upload command. NOTE: all of this is applicable only in local mode.
```

Co-authored-by: Mattermost Build <build@mattermost.com>
2023-12-13 09:38:00 +05:30
Agniva De Sarker
e0b5b951f1 MM-56060: Create base scaffolding for websocket pub-sub (#25654)
We create a new websocket action called "presence" which
can contain the active_channel and the active_team for a given
client connection.

On the client side, for every channel or team switch, we send
out this message.

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

```release-note
NONE
```
2023-12-12 08:49:09 +05:30
Nick Misasi
f0a336ba07 Feature: Wrangler (#23602)
* Migrate feature/wrangler to mono-repo

* Add wrangler files

* Fix linters, types, etc

* Fix snapshots

* Fix playwright

* Fix pipelines

* Fix more pipeline

* Fixes for pipelines

* More changes for pipeline

* Fix types

* Add support for a feature flag, but leave it defaulted on for spinwick usage for now

* Update snapshot

* fix js error when removing last value of multiselect, support CSV marshaling to string array for textsetting

* Fix linter

* Remove TODO

* Remove another TODO

* fix tests

* Fix i18n

* Add server tests

* Fix linter

* Fix linter

* Use proper icon for dot menu

* Update snapshot

* Add Cypress UI tests for various entrypoints to move thread modal, split SCSS out from forward post into its own thing

* clean up

* fix linter

* More cleanup

* Revert files to master

* Fix linter for e2e tests

* Make ForwardPostChannelSelect channel types configurable with a prop

* Add missing return

* Fixes from PR feedback

* First batch of PR Feedback

* Another batch of PR changes

* Fix linter

* Update snapshots

* Wrangler system messages are translated to each user's locale

* Initially translate Wrangler into system locale rather than initiating user

* More fixes for PR Feedback

* Fix some server tests

* More updates with master. Fixes around pipelines. Enforce Enterprise license on front/back end

* Add tests for dot_menu

* More pipeline fixes

* Fix e2etests prettier

* Update cypress tests, change occurrences of 'Wrangler' with 'Move Thread'

* Fix linter

* Remove enterprise lock

* A couple more occurrences of wrangler strings, and one more enterprise lock

* Fix server tests

* Fix i18n

* Fix e2e linter

* Feature flag shouldn't be on by default

* Enable move threads feature in smoke tests (#25657)

* enable move threads feature
* add @prod tag

* Fix move_thread_from_public_channel e2e test

* Fix e2e style

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Co-authored-by: yasserfaraazkhan <attitude3cena.yf@gmail.com>
2023-12-11 15:27:34 -05:00
Ben Schumacher
5b6b425cfc [MM-56061] Only render where field in model.AppError when it's present (#25648)
* Only render where field in model.AppError when it's present

* Remove trailing comma from permission error
2023-12-11 10:27:51 +01:00
Devin Binnie
109f4643c6 [MM-55017] Add API method to get users for Admin Reporting (#25499)
* Add store method to get reporting data

* Some store changes

* Added app layer

* Added API call, some miscellaneous fixes

* Fix lint

* Fix serialized check

* Add API docs

* Fix user store tests leaking users

* Fix test

* PR feedback

* Add filtering for role/team/activated user, filter out bot users

* Fix mock

* Fix test

* Oops

* Switch to using struct filter

* More PR feedback

* Fix gen

* Fix test

* Fix API docs

* Fix test

* Fix possible SQL injection, some query optimization

* Fix migrations

* Oops

* Add role to API

* Fix check

* Add Client4 API call for load testing

* Fix test

* Update server/channels/store/storetest/user_store.go

Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>

* PR feedback

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>
2023-12-08 10:30:08 -05:00
Ben Schumacher
b2ec1ff8ae [MM-55595] Use annotated logger in search layer (#25468) 2023-12-04 18:34:57 +01:00
Devin Binnie
639181dcc1 [MM-55631] Remove extra call to Draft().Get() (#25563) 2023-11-30 10:45:32 -05:00
Daniel Espino García
2ff0fe343e [MM-45272] Fix MM-45272 (#24701)
* Fix MM-45272

* Properly handle permalinks

* Fix

* Fix tests

* Handle only not found case for team member

* Fix lint

* Use proper config value

* Separate permission in several statements

* Add tests

* Fix lint

* Revert changes on utils

* Address feedback and more fixes

* Address feedback

* Fix test

* Fix test and related bug

* Fix and reorder test

* Address feedback

* Address feedback

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2023-11-30 11:43:51 +01:00
Ben Schumacher
c395ec6245 [MM-55990] Logger improvements for tests (#25467) 2023-11-30 10:47:04 +01:00
Thomas Brq
6cf7115e1f [GH-25492] Add the request context to all public methods in server/channels/app/admin.go (#25498) 2023-11-29 17:07:54 +01:00
Sudheer Tripathi
6e3f0ab928 [MM-55606]: add the request context to all public methods in server/channels/app/brand.go (#25542)
Co-authored-by: Sudheer Tripathi <sudheer@clearglass.com>
2023-11-29 17:07:16 +01:00
Nick Misasi
8b07655a65 [CLD-6537] Cloud Annual Renewals - Banners Implementation (#25267)
* Initial implementation of Cloud Annual Renewal flow - system banners for admins and end users

* Actually add the file

* Add AlertBanner to system console billing_subscriptions page

* Fixes for non-admin banner and pipeline

* Updates to coincide with the CWS side of thigns

* Add a feature flag for the 60 day experience to ensure banners don't show accidentally

* Fix tests

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2023-11-29 09:10:17 -05:00
Nick Misasi
95670abcea [CLD-6678] Various improvements for IP filtering feature (#25485)
* Add GetInstallation function, allow IP Filtering page to fetch installation state, other fixes for IP filter feature

* Fix pipelines

* Run make build-templates

* Fixing i18n

* Fix openapi docs

* Fix openapi docs again

* make build-templates

* Update test to ensure that spinner is removed after installation becomes stable

* Fix types, style

* update openapi because I can't validate locally...

* Updates according to Matt's feedback

* Add a limit to number of times installation is requested before an error is displayed

* Make button disable immediately

* Updates based on PR feedback

* A couple missed occurrences of whitespace

* Grammar fix in failed to fetch error

---------

Co-authored-by: Gabe Jackson <3694686+gabrieljackson@users.noreply.github.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
2023-11-28 09:09:50 -05:00
Devin Binnie
eaa5cce3ce [MM-55143] Disallow reacting with an emoji that does not exist, limit the total number of unique reactions per post (#25331)
* [MM-55143] Disallow reacting with an emoji that does not exist

* WIP for server limit on emoji reactions

* WIP

* Implement default limit of 25 unique emoji reactions

* Add modal for reaction limit

* Fix test

* PR feedback

* Fix i18n

* Update admin string

* Merge'd

* Fixing some issues, check limits correctly based on other users reactions

* Fix typos

* Fix lint/test

* Add tests, fix other tests

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2023-11-27 09:11:04 -05:00
Ben Schumacher
e99ded1635 [MM-55480] Update logr to v2.0.21 (#25431) 2023-11-23 10:30:08 +01:00
Scott Bishel
f67f0bd220 MM-55006 Validate team access before returning deleted teams (#25226)
* validate team access before returning deleted teams

* update error return

* Update channel.go

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2023-11-22 10:48:20 -07:00
Ben Schumacher
51e73b681b [MM-40638] Type all of the websocket event names as a new type WebsocketEventType (#25454)
Co-authored-by: Sudheer Tripathi <sudheer@clearglass.com>
Co-authored-by: Sudheer Tripathi <31629433+sudheer121@users.noreply.github.com>
Co-authored-by: Sudheer Tripathi <tripathisudheer604@gmail.com>
2023-11-22 11:09:48 +01:00
Nick Misasi
fee6606606 Fix flaky test api4/Test_applyIPFilters (#25437)
Automatic Merge
2023-11-14 23:52:23 +02:00
Nick Misasi
e1c851a3ca [CLD-6324] Cloud IP Filtering (#24726)
* Initial comit for ip filtering service implementation

* Add audit logs for IP Filters

* start of webapp work

* Stashing

* Updates based on Agniva's feedback around service vs einterface

* Updates completed

* Commit before refactoring, everything's working

* First pass of cleanup complete, front-end tests added

* actually add files

* Updates to some translation strings, running i18n-extract

* Lock everything behind a feature flag

* Fix tests, try to fix some linter stuff

* Fixed linter for JS, on to scss

* Fixed linter for scss

* Fix linter

* More fixes for pipeline

* Support for IPV6

* Remove tsx file that was removed in masteR

* Revert package.json and package-lock.json to master, add cidr-regex dep into channels/package.json

* Another commit to force fix Github

* Fixes around IPV6. Some suggestions from Matt re: UX review. Fixing pipelines for tests and types on new cidr-regex package

* Changes to address Matt's feedback

* A few more changes for clean up

* Add support for permissions

* Fix vet for OpenAPI spec

* Actually add the yaml file for openapi

* Add permission migration to allow support for IP Filtering

* Fix tests

* Final fixes from Matt

* Remove cancel button from page, update link outs to documentation

* Update test to account for removed cancel button

* Adjustments based on feedback from Harrison

* More fixes from PR feedback

* Add a t to fix translations that doesn't seem to be breaking anyone else?

* More fix

* updates for PR feedback

* Fix linter

* Fix types

* Now fix the linter again

* Add back tests because Harrison was able to get them running

* Adjustments for PR feedback

* Remove admin_definition.jsx

* Fix linter

* [CLD-6453] IP Filtering notification email for sysadmins (#25224)

* Initial commit for IP filtering alert email

* Updates to style for email, addition of ip_filtering email:

* Fix pipelines

* Adjustments from Matt's feedback

* Padding changes

* template diff (#25249)

Co-authored-by: Gabe Jackson <3694686+gabrieljackson@users.noreply.github.com>

* Fix hardcoded true, remove bool return value

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Co-authored-by: Gabe Jackson <3694686+gabrieljackson@users.noreply.github.com>

* Lock feature behind enterprise license. Drop cidr-regex in favour of ipaddr.js dependency. Refactor isIpAddressWithinRanges to use ipaddr.js

* Add a couple server tests

* fix linter

* Fix types from merge conflicts

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Co-authored-by: Gabe Jackson <3694686+gabrieljackson@users.noreply.github.com>
2023-11-14 09:12:04 -05:00
KIMBOH LOVETTE
29cd6177c0 [GH-21565]-Add the request context and logger to all public methods in server/channels/app/audit.go (#25368) 2023-11-14 13:34:47 +01:00
Jesse Hallam
48bf4e9bd8 Fix issue 25390 (#25403) 2023-11-10 21:55:33 -04:00
KIMBOH LOVETTE
a6ba7163c8 [GH-21566] Add request context and logger to all public methods in server/channels/app/authentication.go (#25270) 2023-11-08 14:39:09 +01:00
Aydın Davutoğlu
b19b62b83f Add the request context and logger to all public methods in server/channels/app/auto_responder.go (#25295)
Co-authored-by: Mattermost Build <build@mattermost.com>
2023-11-07 19:25:52 +01:00
Ben Schumacher
b0bf5d0765 [MM-55053] Use request-specific logger in channels/app/file.go (#25037) 2023-11-07 10:04:16 +01:00
Ben Schumacher
486e836b83 Fix racy test issues (#24971) 2023-11-06 12:26:17 +01:00
Catena cyber
04e7b6bc9e Applies perfsprint linter (#24999)
Replacing usages of fmt.Sprint with faster alternatives

Signed-off-by: Philippe Antoine <contact@catenacyber.fr>
2023-11-03 11:18:18 +01:00
Ben Schumacher
e8569c91af [MM-32406] Introduce trace logging level for LDAP messages (#25118) 2023-11-03 08:06:16 +01:00
Ben Schumacher
4948aa106b [MM-54403] Introduce separate AdvanctedLogging levels for LDAP messages (#24873) 2023-11-02 12:31:57 +01:00
Ben Schumacher
a4ece51391 [MM-45065] Switch all api4 methods to use the new logger (#24896) 2023-10-31 11:00:22 +01:00
Ben Schumacher
d0c22aa1cd [MM-54435] Use annotated logger to capture compliance export logs (#24791) 2023-10-23 10:20:32 +02:00
Ben Schumacher
e090adcb65 Add information about permanent user deletion to audit logs (#25017) 2023-10-19 17:49:53 +02:00
Ben Schumacher
4ed32be6d2 [MM-53019] Add file storage permission check to workspace health dashboard (#24403) 2023-10-19 17:31:09 +02:00