Commit graph

23 commits

Author SHA1 Message Date
Catena cyber
758bdd785f
perf: apply perfpsrint linter (#33967)
* perf: apply perfpsrint linter

* further simplifications

* improved TestParseHashtags coverage

* more simplifications

* simplify renderBlockHTML further

---------

Co-authored-by: Jesse Hallam <jesse@mattermost.com>
2025-11-28 11:23:51 -04:00
Ben Schumacher
892a7c9c69
Use golangci-lints's build-in modernize linter (#34341)
Some checks are pending
API / build (push) Waiting to run
Server CI / Compute Go Version (push) Waiting to run
Server CI / Check mocks (push) Blocked by required conditions
Server CI / Check go mod tidy (push) Blocked by required conditions
Server CI / check-style (push) Blocked by required conditions
Server CI / Check serialization methods for hot structs (push) Blocked by required conditions
Server CI / Vet API (push) Blocked by required conditions
Server CI / Check migration files (push) Blocked by required conditions
Server CI / Generate email templates (push) Blocked by required conditions
Server CI / Check store layers (push) Blocked by required conditions
Server CI / Check mmctl docs (push) Blocked by required conditions
Server CI / Postgres with binary parameters (push) Blocked by required conditions
Server CI / Postgres (push) Blocked by required conditions
Server CI / Postgres (FIPS) (push) Blocked by required conditions
Server CI / Generate Test Coverage (push) Blocked by required conditions
Server CI / Run mmctl tests (push) Blocked by required conditions
Server CI / Run mmctl tests (FIPS) (push) Blocked by required conditions
Server CI / Build mattermost server app (push) Blocked by required conditions
Web App CI / check-lint (push) Waiting to run
Web App CI / check-i18n (push) Waiting to run
Web App CI / check-types (push) Waiting to run
Web App CI / test (push) Waiting to run
Web App CI / build (push) Waiting to run
2025-11-04 12:09:11 +01:00
Ben Schumacher
494b570f3a
[MM-63607] Add length validation for LDAP user fields (#30596) 2025-11-04 10:02:18 +01:00
Ben Schumacher
9add320011
[MM-64654] Migrate to modern Go features (#31820) 2025-07-18 12:54:51 +02:00
Alejandro García Montoro
de46d798e4
MM-60780: Reject emails within angle brackets (#29661)
* Reject emails within angle brackets

mail.ParseAddress is RFC-compliant, which means that it accepts emails
with names, as in "Billy Bob <billy@example.com>". It even accepts this
form *without* a name; e.g. "<billy@example.com>". We want to store the
plain address, so we compare the user input with the Address field of
the result from mail.ParseAddress, which should contain only
"billy@example.com", thus only accepting emails that do not contain
names nor angle brackets.

* Log a warning for admins with clear next steps

* Fix wording of comment

* And a typo

* Add specific command example to log message

* Add input email to log message

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2025-04-21 19:22:15 +02:00
Ibrahim Serdar Acikgoz
e76786278b
[MM-60083] export: do not export DMs/GMs if users are deleted (#28854) 2024-12-19 16:47:52 +01:00
Scott Bishel
d5ce06e580
MM-60722 - don't allow multiple '@' in email (#28481)
* don't allow quoted strings in email

* don't allow multiple '@' in email

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-10-15 12:21:02 -06:00
Julien Tant
1909206e16
[MM-59069] Make sure OTP are actual One Time Password (#28074)
Automatic Merge
2024-09-17 00:44:32 +02: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
Ibrahim Serdar Acikgoz
5590e1604a
Add new Metrics API (#26919) 2024-05-09 20:49:02 +02:00
Ben Schumacher
d2ce70b4b1
[MM-57415] Removed unused IsOAuth field from AppError (#26578) 2024-04-02 17:43:23 +02:00
Christopher Poile
6ea363e260
[MM-57070] Remove detailed_error from errors when not in dev mode (#26414)
* remove detailed error from appErr.ToJSON

* Revert "remove detailed error from appErr.ToJSON"

This reverts commit 3c2fa7352d.

* use WipeDetailed instead of err.DetailedError = ""

* fix tests

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-03-20 13:30:14 -04:00
Harshil Sharma
521844fed5
API handler opts modifier (#26148)
* POC for API handler opts modifier

* Made upload POSt api a  file upload API

* Specified file upload local API

* Specified file upload local API

* Specified file upload API

* Simplified handler params

* Added basic security checks

* Fixed i18n

* used type for API handler options

* Removed limited reader from util deserializers (#26263)
2024-02-21 12:13:50 +00:00
Ben Schumacher
7e317c7568
[MM-56455] Handle HTTP error for too large request body in Client4 (#25842) 2024-02-09 17:15:03 +01:00
Julien Tant
45633198ca
[MM-56680] Use Golang UnixMilli instead of UnixNano in Milli helpers (#26071)
Co-authored-by: Mattermost Build <build@mattermost.com>
2024-02-02 09:35:38 -07:00
Harshil Sharma
62064e3bf7
Used limited reader in user invite (#25943)
* Used limited reader in user invite

* Added tests
2024-01-23 11:11:10 +05:30
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
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
Agniva De Sarker
3dd9e3715c
Goodbye, GraphQL (#24827)
```release-note
NONE
```
2023-10-12 09:47:35 +05:30
Ben Schumacher
0d5a8b8841
Add whitespace linter (#24855) 2023-10-11 10:13:36 +02:00
Claudio Costa
62a3ee8adc
[MM-52924] Implement ConfigurationWillBeSaved plugin hook (#23567)
* Implement ConfigurationWillBeSaved plugin hook

* Add comment

* Update comment

* Fix potential nil dereference if plugin environment is unset

* Address PR review
2023-06-12 18:23:02 -06:00
Agniva De Sarker
efaa6264cc
MM-53032: Fix module path after repo rename (#23689)
It was a good decision in hindsight to keep the public module as 0.x
because this would have been a breaking change again.

https://mattermost.atlassian.net/browse/MM-53032
```release-note
Changed the Go module path from github.com/mattermost/mattermost-server/server/v8 to github.com/mattermost/mattermost/server/v8.

For the public facing module, it's path is also changed from github.com/mattermost/mattermost-server/server/public to github.com/mattermost/mattermost/server/public
```
2023-06-11 10:54:35 +05:30
Jesse Hallam
bb02b35048
Expose public/ API as submodule (#23345)
* model -> public/model

* plugin -> public/plugin

* public/model/utils -> public/utils

* platform/shared/mlog -> public/shared/mlog

* platform/shared/i18n -> public/shared/i18n

* platform/shared/markdown -> public/shared/markdown

* platform/services/timezones -> public/shared/timezones

* channels/einterfaces -> einterfaces

* expose public/ submodule

* go mod tidy

* .github: cache-dependency-path, setup-go-work

* modules-tidy for public/ too

* remove old gomodtidy
2023-05-10 13:07:02 -03:00
Renamed from server/model/utils.go (Browse further)