Commit Graph
9567 Commits
Author SHA1 Message Date
Martin Kraft 3b83cc7dd3 XYZ-51: Unit tests for and changes to SetRolePermissionsFromConfig. (#8160)
* XYZ-10: Role store.

* XYZ-37: Update unit tests to work with database roles.

* XYZ-51: Tests 'SetRolePermissionsFromConfig' against JSON from policy page.

* XYZ-51: Adds permissions in non-licensed cases also.

* XYZ-51: Removes some permissions from team_user role.

* XYZ-51: Merge fix for change to default permissions from PR 8208.

* XYZ-51: Removes unused function.
2018-02-09 10:57:07 -05:00
Jesús Espino 0aa7ecd5e8 AllowEditPost and PostEditTimeLimit migration (#8208)
* AllowEditPost and PostEditTimeLimit migration

* Not set EDIT_POST permission to sysadmin_role if ALLOW_EDIT_POST is configured to NEVER

* Remove a bit of code duplication
2018-02-09 10:31:01 -05:00
George Goldberg 96ffde43dc XYZ-80: Add CreateAt/UpdateAt/DeleteAt fields to roles table. (#8223) 2018-02-08 17:08:47 +01:00
George Goldberg fa5cba9cc7 XYZ-76: Add license check to patchRoles endpoint. (#8224) 2018-02-08 17:07:40 +01:00
George Goldberg a735725d11 XYZ-59: Implement redis caching layer for Role store. (#8207)
* XYZ-59: Implement redis caching layer for Role store.

* Use variable for key where used more than once.
2018-02-07 18:15:07 +00:00
Jesús Espino a04b02081a Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-1 2018-02-07 18:05:23 +01:00
Vordimous 7bd298ceaa PLT-7537: Move channel CLI command posts system message to channel. (#8161)
* [PTL-7537] implement feature and test

* [PTL-7537] Update feature to post the the room requiring a username flag to be used

* [PTL-7537] update tests with username

* update test to remove changes to the test helper struct

* use the basic team and user
2018-02-07 14:17:18 +00:00
Jonathan d3e934d07a XYZ-35: Added Support for GlobalRelay Compliance Export Format
* Added username to ChannelMemberHistory struct in anticipation of supporting GlobalRelay in Compliance Export
* Removed translation from debug output - this makes it complicated to use utils functions from tests in the enterprise repo
* Added an advanced email function that allows for greater control over message details. Updated MessageExport config to support GlobalRelay. Added attachment support to InBucket unit tests
* Moving templates in from enterprise to solve test issues
* Added export format to diagnostics
* Changed email attachment code to use FileBackend so that S3 storage is properly supported
2018-02-07 09:02:46 -05:00
Chris b2ee507793 allow plugins to set command hints (#8214) 2018-02-07 08:21:40 -05:00
Jesús Espino 121712ce5d Remove fmt.Println trace on api4 tests (#8212) 2018-02-07 03:42:55 -06:00
Pierre de La Morinerie 809a16458f Abort on critical error during server startup (#8204)
Only a handful of critical errors are present in the codebase.
They all occur during server startup (in `app.StartServer()`).

Currently, when one of these critical error occurs, it is simpled
mentionned in the logs – then the error is discarded, and the app
attempts to continue the execution (and probably fails pretty quickly in
a weird way).

Rather than continuing operations in an unknow state, these errors should
trigger a clean exit.

This commit rewrites critical startup errors to be correctly
propagated, logged, and then terminate the command execution.
Additionnaly, it makes the server return a proper error code to the
shell.
2018-02-07 02:11:15 -06:00
Harrison Healey 9a73f99885 ICU-715 Change ExperimentalGroupUnreadChannels setting to allow for default on/off (#8211) v4.7.0-rc1 2018-02-06 18:45:14 -05:00
Chris 1ec295f88c add App.License, remove utils.IsLicensed / utils.License calls (#8203) 2018-02-06 17:25:49 -06:00
George Goldberg 7941c30117 Merge branch 'master' into advanced-permissions-phase-1 2018-02-06 17:25:53 +00:00
George Goldberg e1cd646135 XYZ-37: Advanced Permissions Phase 1 Backend. (#8159)
* XYZ-13: Update Permission and Role structs to new design.

* XYZ-10: Role store.

* XYZ-9/XYZ-44: Roles API endpoints and WebSocket message.

* XYZ-8: Switch server permissions checks to store backed roles.

* XYZ-58: Proper validation of roles where required.

* XYZ-11/XYZ-55: Migration to store backed roles from policy config.

* XYZ-37: Update unit tests to work with database roles.

* XYZ-56: Remove the "guest" role.

* Changes to SetDefaultRolesFromConfig.

* Short-circuit the store if nothing has changed.

* Address first round of review comments.

* Address second round of review comments.
2018-02-06 15:34:08 +00:00
Pierre de La Morinerie 034dbc07e3 handle RateLimiter initialization errors (#8199)
Previously, an error occuring in NewRateLimiter would return a nil
reference – which would be de-referenced just after, making the server
crash.
2018-02-05 23:27:34 -06:00
Joram Wilander 323d717a40 Uncomment upgrade code for 4.7 (#8201) 2018-02-05 18:11:31 -05:00
Jesse Hallam d5d1834c04 ABC-173: introduce Normalize(Username|Email) (#8183)
This centralizes the source of truth on the rules for username / email
processing instead of scattering `strings.ToLower` invocations.
2018-02-05 14:56:01 -05:00
Jesús Espino aaccb1226e Fix sampledata (fake library) bug (#8198) 2018-02-05 12:37:22 -05:00
Jason Blais 31c9877102 Add missing diagnostics for v4.7 (#8195) 2018-02-05 08:18:46 -08:00
Jesse Hallam 81e67f8759 ABC-179: check email verification last (#8172)
* ABC-179: check email verification last

This change changes the authentication checks to be:
* "preflight checks"
** mfa
** not disabled
** login attempts
* password
* "postflight checks"
** email verified

Checking whether the email is verified or not last avoids the weird edge
case where entering any bogus password for an account with an unverified
email shows a message about verifying the email and offering to resend.

* fix invalid unit test assertion

Client.CreateUser returns a user whose password has been sanitized.
Adopt the pattern in the previous assertions to use a new variable name
and test the password on the original model.User object. This didn't
expose any underlying broken behaviour, but the test wouldn't have
caught it if it had regressed.

Also fix a minor typo.
2018-02-05 10:54:13 -05:00
amyblais 45e572870d Update NOTICE.txt (#8175)
* Update NOTICE.txt

* Update NOTICE.txt
2018-02-05 08:29:31 -05:00
Chris 741f11a878 add ImageProxyOptions to default.json (#8193) 2018-02-02 16:35:05 -05:00
Joram Wilander 03a087a871 Update zoom plugin to latest (#8194) 2018-02-02 16:32:14 -05:00
Joram Wilander 70ad8abdcd Fix panic when invalid types used in post props (#8191) 2018-02-02 11:46:49 -08:00
Pierre de La Morinerie 07902b4c91 report server launch errors (#8189)
When starting the server using `platform server`, errors occuring during
startup are not reported in the console. The command exit with a 0 exit
code (i.e. "success"), although the server failed to launch.

With this change, when an error occurs while initializing the app (like
a missing or invalid configuration file):

- the error is printed to the console;
- the command exit with a "-1" exit code.

This allow shell scripts to properly detect the startup failure, and to
react to it.

Example of error displayed:

```
$ platform server
Error: LoadConfig: Error decoding config file=config.json, err=While parsing config: invalid character ':' after top-level value,
``
2018-02-02 11:54:14 -06:00
Chris 2256e23c9e ABC-153: don't use http redirects with 4xx/5xx status codes (#8178)
* don't use http redirects with 4xx/5xx status codes

* minor html syntax fix
2018-02-02 08:29:11 -05:00
Chris 0cd2895456 fix image url replacement for blank urls (#8184) 2018-02-01 18:31:49 -08:00
Saturnino Abril 5d7ae48841 [PLT-8494] Add delete_team websocket event (#8167)
* add delete_team websocket event

* add to PermanentDeleteTeam
2018-02-01 09:46:24 -05:00
amyblais e50fea9dff Update CONTRIBUTING.md (#8168) 2018-02-01 12:00:32 +00:00
Jesús Espino 963176ab2a Don't remove data dirs from vendor directory (#8173) 2018-01-31 16:33:33 -08:00
Corey Hulen 629bdb314e Adding sample data to the make file (#8171)
* Adding sample data to the make file

* Adding regular acct message
2018-01-31 16:32:18 -08:00
Jesús Espino f988e5bc30 Use default configurations for user-0 in sampledata (#8174) 2018-01-31 16:31:49 -08:00
Chris c89cf572f7 make channel autocomplete sort case-insensitive (#8176) 2018-01-31 14:57:08 -05:00
Christopher Speller 1262d25473 User based rate limiting (#8152) 2018-01-31 09:49:15 -08:00
Chris e0ee73ef99 ABC-79: Optimize channel autocomplete query (#8163)
* optimize channel autocomplete query

* move to new autocomplete endpoint
2018-01-31 09:26:40 -05:00
Chris 0c8968fb8d unnamed return (#8170) 2018-01-30 15:23:00 -08:00
Christopher Speller ac2e42a480 Moving to golang.org/x/crypto/acme/autocert for Let's Encrypt functionality. (#8165) 2018-01-30 10:12:42 -08:00
enahum 8ca8e71fdd translations PR 20180129 (#8164) 2018-01-30 10:07:05 -03:00
Christopher Speller 961c04cae9 Upgrading server dependancies (#8154) 2018-01-29 14:17:40 -08:00
Harrison Healey 8d66523ba7 Used a consistent tense for system messages (#8079) 2018-01-26 13:35:50 -05:00
Joey Lee 1c7f25773a PLT-3658 Added support for Slack attachments in outgoing webhook response (#7774) (#8102) 2018-01-26 08:37:39 -05:00
Martin Kraft 540dd9ae94 XYZ-32: Increases size of position to 128 characters. (#8148)
* XYZ-32: Changes type of 'position' column on 'users' table.

* XYZ-32: Uncomment to run on CI and pre-release.

* XYZ-32: Reverts translation changes.

* XYZ-32: Fix for gofmt.
2018-01-26 08:37:12 -05:00
der-test 3da2dad989 Fixed spelling error (#8153) 2018-01-26 08:36:41 -05:00
Chris 5503a1351a add arch linux sandboxing mount points (#8147) 2018-01-25 08:18:45 -08:00
Derrick Anderson d45d8a16b3 prereq check (#8151) 2018-01-25 08:40:29 -05:00
Joram Wilander 3918ed6c58 Add GET /emojis/name/{emoji_name} API endpoint (#8142) 2018-01-24 08:50:11 -05:00
enahum f2415b98f6 [ICU-621] Add ExperimentalGroupUnreadChannels setting (#8127)
* Add ExperimentalGroupUnreadChannels setting

* track ExperimentalGroupUnreadChannels in diagnostics
2018-01-23 17:59:41 -03:00
Harrison Healey 195ad56204 Merge branch 'release-4.6' 2018-01-23 15:07:31 -05:00
Chris 3dad632043 use markdown parsing to identify mentions (#8139) 2018-01-23 14:48:20 -05:00