Commit Graph

9835 Commits

Author SHA1 Message Date
George Goldberg
cd55c44c8f MM-8796: Full implementation of "Schemes" in Store/Model/App layers. (#8357)
* Add Scheme model and stub store.

* Port ChannelStore to be Scheme aware.

* Make almost all the API/APP layer work with ChannelSchemes.

Only thing still hacky is UpdateChannelMemberRoles().

* Add basic SchemeStore implementation.

* Migrate UpdateChannelMemberRoles properly and fix tests.

* Update store tests and mocks so they work.

* Include creating default roles in Scheme create store function.

* Implement role deletion and start scheme deletion.

* Only use non-deleted roles for authorization.

* Add GetByScheme method to Team store.

* Add GetChannelsByScheme.

* Update store mocks.

* Implement scheme deletion in the store.

* Rename is valid function.

* Add offset and limit to queries to fetch teams and channels by scheme.

* Fix queries.

* Implement scheme awareness in Team store and add a migration.

* Tidy up ChannelStore mapping functions and add exhaustive unit tests.

* Add all missing i18n.

* Proper tests for TeamStore internal functions and fix them.

* Make additional TeamMember fields nullable.

* Make new ChannelMember fields nullable.

* Create new nullable columns without defaults.

* Make new fields in large tables nullalble.

* Fix empty list of TeamMembers.

* Deduplicate SQL queries.

* Fix spelling.

* Fix review comment.

* More review fixes.

* More review fixes.
2018-04-20 14:49:13 -04:00
Joram Wilander
853445dc2e Properly implement session deep copy (#8602) 2018-04-20 12:25:14 -04:00
Joram Wilander
283f34b9c6 MM-10007 Send an admin and regular WS events when a user is updated (#8588)
* Add user.DeepCopy() function

* Add omit admins/non-admins to WS broadcast and use for updating users

* Updates per feedback and adding unit test for ShouldSendEvent
2018-04-20 08:44:18 -04:00
Joram Wilander
7987c95fcd MM-10133 Suppress confusing personal access token message in invalid session error (#8645)
* Suppress confusing personal access token message in invalid session error

* Updates per feedback
2018-04-20 08:44:01 -04:00
Joram Wilander
514033f14c Fix panics caused by race in notification code (#8652) 2018-04-19 11:21:33 -03:00
Martin Kraft
4921fda79f MM-10122: Adds a mention for added-to-channel messages even when 'username mentions' are disabled. (#8648) 2018-04-19 11:28:04 +01:00
Christopher Speller
2b83f8c48f Removing user cache clear from SessionHasPermissionsTo (#8624) 2018-04-18 19:41:15 -07:00
Jesús Espino
0910eae31d MM-9779: Incorporate a Token into the invitations system (#8604)
* Incorporate a Token into the invitations system

* Adding unit tests

* Fixing some api4 client tests

* Removing unnecesary hash validation

* Change the Hash concept on invitations with tokenId

* Not send invitation if it wasn't able to create the Token

* Fixing some naming problems

* Changing the hash query params received from the client side

* Removed unneded data param in the token usage
2018-04-18 13:46:10 -07:00
George Goldberg
b13a228b04 MM-10121: CLI command to reset permissions system to default state. (#8637)
* MM-10121: CLI command to reset permissions system to default state.

* Review comment.
2018-04-18 10:18:07 +01:00
Joram Wilander
a1882d4004 Ignore rolled log files (#8644) 2018-04-18 08:43:55 +01:00
Joram Wilander
b15f69ea30 Handle app errors in user autocomplete endpoint (#8643) 2018-04-17 15:39:08 -07:00
Carlos Tadeu Panato Junior
51a6e95f58 add app shutdown to make sure the goroutines finish and all process are closed (#8629)
* run the send email verification as goroutine as well

* add app shutdown to make sure all go routines finish
2018-04-17 11:06:55 -04:00
George Goldberg
5511106d93 MM-9918: Trim trailing / from push proxy URL. (#8635) 2018-04-17 07:13:16 -07:00
Derrick Anderson
af98bf1d49 Merge branch 'merge49final' 2018-04-17 09:49:02 -04:00
Derrick Anderson
58e559da39 Add MM9720 changes back in for master merge 2018-04-17 09:37:20 -04:00
Derrick Anderson
885b8e51f3 Merge remote-tracking branch 'origin/release-4.9' into merge49final 2018-04-17 09:21:33 -04:00
Daniel Schalla
997df03ac1 Initial Commit of Ephemeral Message Support for System Admins (#8611)
Fixed Permission Test

Fixed and extended ephemeral message tests; Removed Online/Activity Updates

Set Create Time to current time

gofmt
2018-04-17 08:20:47 -04:00
Jesse Hallam
3a4c7603b3 MM-10020: avoid duplicating unique indexes (#8587)
* unit test TestGet(Search)Replica

This adds partial, testing-focused support for SQLite, as well as removing
some translated log messages that required initializing i18n just for
testing.

* avoid returning master twice when no replicas are configured

* remove duplicate indexes

* unit test GetAllConns
2018-04-16 18:23:20 -07:00
Christopher Speller
ba6f9075c1 Fix opengraph images not going through the image proxy. (#8627) 2018-04-16 09:00:59 -04:00
Christopher Speller
6e2cb00008 Depenancy upgrades and movign to dep. (#8630) 2018-04-16 08:37:14 -04:00
Carlos Tadeu Panato Junior
bf24f51c4e [MM-9904] Add /invite slash command to invite users to a channel (#8482)
* [MM-9904] Add /invite slash command to invite users to a channel

* Update en.json
2018-04-16 14:23:58 +02:00
Derrick Anderson
3176e13b1f revert changes from MM9720 v4.9.0 v4.9.0-rc6 2018-04-13 20:42:27 -04:00
Jesse Hallam
8056dc33e3 Prevent disabling or modifying l4g logging filters (#8628)
The underlying l4g library is not resilient to filter modifications in
the presence of concurrent goroutines. In particular, it's not safe to
call Close() on filters which might be actively held by a goroutine for
logging.

This change disables all modifications to existing filters once
initialized by the App layer. In practice, we might be able to get away
with some modifications to the existing filters (i.e. changing levels),
but the [golang memory model](https://golang.org/ref/mem) makes no
guarantees that it is safe to do so:

> Programs that modify data being simultaneously accessed by multiple goroutines must serialize such access.

We can solve this holistically by introducing the requisite locking
within our fork of the l4g library. For now, we just disable all
modifications.
2018-04-13 20:09:38 -04:00
Christopher Speller
a7fd13384b Removing user cache clear from SessionHasPermissionsTo (#8625) 2018-04-13 20:09:06 -04:00
Derrick Anderson
0759cf639d Merge remote-tracking branch 'origin/merge49rc5' 2018-04-13 14:36:37 -04:00
Derrick Anderson
e83b1cba5c Merge remote-tracking branch 'origin/release-4.9' into merge49rc5 2018-04-13 13:49:52 -04:00
Jesús Espino
84ca98d9a9 Fixed the example text on CLI channel command (#8613) 2018-04-13 07:58:21 -07:00
Joram Wilander
21b1cd44e0 Fix error handling when requesting profile image for bad user ID (#8618) 2018-04-13 07:57:22 -07:00
Jesse Hallam
ae5e324be8 MM-9977: test config.SetDefaults leaves nothing nil (#8610)
* MM-9977: test config.SetDefaults leaves nothing nil

* clarify test default config test cases

* comment re: allowing nil slice

* extend config SetDefaults to handle partially initialized configs
2018-04-13 07:56:09 -07:00
Guy B
911b409936 Websocket custom dialer support (#8592)
* added support for custom websocket dialers (to be able to skip system proxy for example)

* removed newline

* typoe, arguments order
2018-04-12 15:54:03 -04:00
Stan Chan
7826774a14 Add Auto Responder handler (#8386)
WIP Out Of Office

Return error for status command if user status is OOO

Ignore notifications if Out Of Office

Disable AutoResponder if status is set to online

Add test for AutoResponder

DisableAutoResponse when manually setting status

Remove check on status slash command

return early if user does not exists in SendAutoResponse method

Add proper error handling

Add a newline after error handling

Revert back to err == nil in api4/status.go

Remove a.Go when using a.Publish

Add name consistency with the feature auto responder

Last changes for name consistency, also fix failing test with auto_responder

Fix names of functions in auto responder test

Add ExperimentalEnableAutomaticReplies flag

Auto Responder reply to a post
2018-04-12 15:02:36 -04:00
Jesús Espino
8df6d5cc30 Add list command to teams command in CLI (#8612)
* Add list command to teams command in CLI

* Using App instead of Store to get the teams
2018-04-12 11:50:44 -04:00
Joram Wilander
191e1ad556 MM-8180 Improve error message for testing smtp connections (#8608)
* Improve error message for testing smtp connections

* Update error message
2018-04-12 11:36:56 -04:00
Elias Nahum
bc49b12427 translations PR 20180411 (#8606) v4.9.0-rc5 v4.9.0-rc4 2018-04-12 10:11:55 -04:00
Elias Nahum
1ebf19825b Fix mute channel when not a member and adding unit tests (#8609) 2018-04-12 09:12:59 -04:00
Harrison Healey
2d0fef4d94 MM-10036 Ensured correct handling of capitalized special mentions (#8607) 2018-04-11 10:33:20 -04:00
Derrick Anderson
332411490d Merge branch 'jespino-merge-release-4.9' 2018-04-10 10:55:25 -04:00
Jesús Espino
5856325c13 Merge remote-tracking branch 'origin/release-4.9' into merge-release-4.9 2018-04-10 11:29:03 +02:00
Harrison Healey
0a6b96cb40 MM-9849 Added tracking of which settings are set through environment variables (#8586)
* MM-9849 Added tracking of which settings are set through environment variables

* Removed old version of viper

* Added forked version of viper

* Fixed unit tests

* Fixed more unit tests

* Removed copy from App.GetEnvironmentConfig
2018-04-09 18:16:11 +02:00
Martin Kraft
ffa24fbcb2 MM-8834: Changes separator between jobs message and details. (#8589) v4.9.0-rc3 2018-04-09 09:39:57 -04:00
Harrison Healey
57ee6f505e Added additional unit tests for IE11 and compatibility mode (#8573) 2018-04-09 11:14:36 +01:00
Jesse Hallam
116849842b MM-8678: add CUD support for channel members via plugins (#8565)
* add CUD support for channel members via plugins

This effectively exposes AddChannelMember, UpdateChannelMemberRoles,
UpdateChannelMemberNotifyProps and LeaveChannel via the plugin API.

It also modifies the semantics of AddChannelMember to explicitly allow
for an empty user requestor, left as such for now via the plugin API.

* change the signature of AddChannelMember to accept a channel id instead of a channel
2018-04-06 17:08:57 -04:00
Jesús Espino
be972fde28 Adding minio-go for to the dependencies to temporary fix 2 minio-go bugs (#8577) 2018-04-06 15:59:09 -04:00
Harrison Healey
ff077c6761 MM-8400 Provide default config values to viper so that it reads all environment variables (#8581)
* MM-8400 Provide default config values to viper so that it reads all environment variables

* Added unit tests
2018-04-06 12:17:43 -04:00
Saturnino Abril
e16217166d fix out of channel mentions for mentioned word with valid punctuations (#8585) 2018-04-06 09:41:45 -04:00
Derrick Anderson
f9015a37f3 uncomment 4.9 upgrade code (#8582)
* set db to 4.9

* add prepatory code for 4.10

* bug from old example
2018-04-05 11:45:55 -04:00
Derrick Anderson
f7dd715052 update db code for release branch only (#8584) v4.9.0-rc2 2018-04-05 11:27:19 -04:00
Joram Wilander
715a7f893d Remove problematic mute test (#8580) v4.9.0-rc1 2018-04-05 08:53:01 -04:00
Joram Wilander
fb45087545 Comment out problematic mail test (#8579) 2018-04-04 22:24:26 -04:00
Jason Blais
e377baca00 Minor text changes to /open, /join and /mute slash commands (#8569)
* Update en.json

* Update en.json

* Update en.json

* Fix bad rebasing

* ping jenkins
2018-04-04 19:45:40 -04:00