Commit Graph

65 Commits

Author SHA1 Message Date
George Goldberg
96ffde43dc XYZ-80: Add CreateAt/UpdateAt/DeleteAt fields to roles table. (#8223) 2018-02-08 17:08:47 +01:00
Jesús Espino
a04b02081a Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-1 2018-02-07 18:05:23 +01: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
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
Joram Wilander
323d717a40 Uncomment upgrade code for 4.7 (#8201) 2018-02-05 18:11:31 -05:00
Chris
c89cf572f7 make channel autocomplete sort case-insensitive (#8176) 2018-01-31 14:57:08 -05: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
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
Joram Wilander
3918ed6c58 Add GET /emojis/name/{emoji_name} API endpoint (#8142) 2018-01-24 08:50:11 -05:00
Joram Wilander
4f4a765e7d ABC-90 Add POST /emoji/search and GET /emoji/autocomplete API endpoints (#8125)
* Add POST /emoji/search and GET /emoji/autocomplete API endpoints

* Add constant to be clearer
2018-01-23 08:04:44 -08:00
Joram Wilander
a844577535 Add sort query parameter to GET /emojis (#8121) 2018-01-19 09:37:59 -05:00
Joram Wilander
dce0616305 ABC-73 Move session clean-up to daily task (#8095)
* Move session clean-up to daily task

* Split delete query into batches
2018-01-17 08:50:49 -05:00
Adrian Carolli
b1d13a2d89 [PLT-7793] Add /users/tokens/search endpoint (#8088)
* Add /users/tokens/search endpoint + tests

* Fix check-style

* Unnecessary deletion
2018-01-11 16:30:55 -05:00
Adrian Carolli
fd3fa8f8dc [PLT-7793] Added /users/tokens endpoint (#8038)
* Added /users/tokens/all endpoint

- UserAccessStore now has getAll method
- Added tests
- Added route
- Added handler

* Remove space fix check-style

* Remove blank space check-style

* Fixes for make check-style

* Remove extra code that is un-needed in user_test.go

* Rename endpoint + grammar

- Renamed /users/tokens/all to /users/tokens
- Renamed getUserAccessTokens to getUserAccessTokensForUser
- Renamed getAllUserAccessTokens to getUserAccessTokens
- Minor Grammar changes

* Add localization for sql_user_access_token.get_all

* Fix minor plural spelling
2018-01-05 14:46:48 -05:00
Derrick Anderson
edc4c35f5f Uncomment upgrade for 4.6 (#8045)
* Uncomment upgrade for 4.6

* add 4.6 version
2018-01-05 12:29:40 -05:00
George Goldberg
143e664cd9 PLT-8312: Use combined LIKE/Full Text search for channels. (#8029)
* PLT-8312: Use combined LIKE/Full Text search for channels.

* Code tidyup

* Get it working consistently and update unit tests.

* Fix code style.
2018-01-05 23:59:10 +08:00
Jesús Espino
a5bbf3f643 PLT-8483: Ignore join/leave team messages for unread counts (#8042) 2018-01-05 09:27:42 -05:00
Jesse Hallam
e5dad3cf68 [PLT-8173] Strip the post_ prefix on incoming webhook overrides. (#8019) 2018-01-03 10:35:36 -05:00
Jesse Hallam
e9fe9f50dd [PLT-8173] Add username and profile picture to webhook set up pages (#8002) 2018-01-02 08:41:23 -08:00
George Goldberg
dcc2016755 PLT-8354: Fix user search error when terms end up as empty space. (#7984) 2017-12-20 19:29:43 +00:00
Chris
4127474b47 fix posts created at test (#7977) 2017-12-14 05:37:51 -06:00
Jonathan
ab30c4daf9 PLT-8297: Message Export Should Still Produce Valid Exports if ChannelMemberHistory Data is Missing (#7951)
* Added a less accurate ChannelMembers fallback that is used if export period occurs before MessageExport was enabled

* Fixed test names

* Improved testing

* Made hasDataFromBefore() a little less strict

* Fixed the test to cleanly truncate the ChannelMemberHistory table without exposing the db via the interface

* Renamed a function for better clarity

* Binary logic is hard
2017-12-12 09:42:29 -05:00
Christopher Speller
fa9aa85705 Fixing formating on SQL errors for get parent posts. (#7965) 2017-12-12 08:15:32 -05:00
Christopher Speller
ae931ae6b6 Add upgrade code for 4.6 2017-12-08 11:12:09 -08:00
Christopher Speller
39cf3a998d Uncomment upgrae for 4.5 2017-12-08 11:04:23 -08:00
Joram Wilander
7cefef6d21 Hash key for plugin store and limit id length (#7933) 2017-12-05 15:19:33 -08:00
Jonathan
c171872472 PLT-8233: Purge ChannelMemberHistory Data when Data Retention Job runs (#7937)
* Changed the channel member history purge function to match pattern established by other data retention purge methods

* Simplifying the channel member history store and associated tests

* Regenerating mocks

* Using a constant
2017-12-05 16:32:23 -05:00
Christopher Speller
81c1fad4d4 Revert "Hash key for plugin store table and limit plugin ID length (#7915)" (#7931)
This reverts commit c3af878573.
2017-12-01 23:20:11 -08:00
Joram Wilander
c3af878573 Hash key for plugin store table and limit plugin ID length (#7915)
* Hash plugin store keys and update column limits

* Limit plugin ID length on install

* Add note to manifest id and allow zero length keys
2017-12-01 15:20:08 -05:00
Jonathan
375c0632fa PLT-7503: Create Message Export Scheduled Task and CLI Command (#7612)
* Created message export scheduled task

* Added CLI command to immediately kick off an export job

* Added email addresses for users joining and leaving the channel to the export

* Added support for both MySQL and PostgreSQL

* Fixing gofmt error

* Added a new ChannelMemberHistory store and associated tests

* Updating the ChannelMemberHistory channel as users create/join/leave channels

* Added user email to the message export object so it can be included in the actiance export xml

* Don't fail to log a leave event if a corresponding join event wasn't logged

* Adding copyright notices

* Adding message export settings to daily diagnostics report

* Added System Console integration for message export

* Cleaned up TODOs

* Made batch size configurable

* Added export from timestamp to CLI command

* Made ChannelMemberHistory table updates best effort

* Added a context-based timeout option to the message export CLI

* Minor PR updates/improvements

* Removed unnecessary fields from MessageExport object to reduce query overhead

* Removed JSON functions from the message export query in an effort to optimize performance

* Changed the way that channel member history queries and purges work to better account for edge cases

* Fixing a test I missed with the last refactor

* Added file copy functionality to file backend, improved config validation, added default config values

* Fixed file copy tests

* More concise use of the testing libraries

* Fixed context leak error

* Changed default export path to correctly place an 'export' directory under the 'data' directory

* Can't delete records from a read replica

* Fixed copy file tests

* Start job workers when license is applied, if configured to do so

* Suggestions from the PR

* Moar unit tests

* Fixed test imports
2017-11-30 09:07:04 -05:00
Chris
b87fae646a PLT-5458: If someone posts a channel link to channel_A that you don't belong to, it doesn't render properly (#7833)
* add channel link hints to post props

* optimization

* update regex, add unit test

* fix rebase issue
2017-11-28 13:02:56 -08:00
Joram Wilander
785a410936 Decrease plugin key value store table index name size (#7910) 2017-11-27 18:49:28 -05:00
Joram Wilander
6176bcff69 PLT-8131 (part2) Add plugin key value store support (#7902)
* Add plugin key value store support

* Add localization strings

* Updates per feedback
2017-11-27 17:23:35 -05:00
Chris
816a30397d Role refactor (#7867)
* role refactor

* add missing file

* fix web test
2017-11-21 11:08:32 -08:00
Christopher Speller
756caaa1fb Adding 4.5 upgrade code (#7815) 2017-11-11 00:23:19 -08:00
Christopher Speller
fef70d6c9e Uncomment upgrae for 4.4 (#7796) 2017-11-06 16:02:19 -08:00
Harrison Healey
6886de04d4 PLT-6071/PLT-8004 Fixed not being able to autocomplete 'Town Square' (#7746) 2017-10-31 15:52:10 +00:00
Chris
ce2b2be5de Refactoring cfg refs and load / save functions (#7749)
* refactoring cfg refs and load / save functions

* improve error output
2017-10-31 10:39:31 -04:00
Joram Wilander
443a880fbd Add command validation on update (#7742) 2017-10-30 12:14:17 -05:00
Chris
3cbacb6858 Remove unused variables / code (#7736)
* remove unused variables / code

* fix bug in testPostStoreGetOldest
2017-10-30 11:58:00 -05:00
Chris
c5e8cb25ca simplify things (#7735) 2017-10-30 11:57:24 -05:00
Christopher Speller
91b9514aaf Adding Posts table indexes for 20M rows. (#7728) 2017-10-27 09:02:16 -04:00
Carlos Tadeu Panato Junior
ab7e5b35d8 [PLT-7364] Ability to Direct Message yourself (#7696)
* [PLT-7364] Ability to Direct Message yourself

* [PLT-7364] add tests
2017-10-26 09:45:26 -04:00
Chris
5dd4466ab3 add missing license headers, test to makefile (#7711) 2017-10-25 09:33:19 -07:00
George Goldberg
5474cff0eb PLT-7934: Make query for bulk elasticsearch indexing more efficient. (#7664) 2017-10-25 13:23:01 +01:00
Chris
fd6192473b refactor max users per team (#7691) 2017-10-20 20:34:07 -04:00
Chris
d39a722a81 refactor max channels per team enforcement (#7690) 2017-10-20 20:33:20 -04:00
Nick Frazier
7fa4913f90 [PLT-7794] Add user access token enable/disable endpoints (#7630)
* Add column to UserAccessTokens table

* PLT-7794 Add user access token enable/disable endpoints

* replaced eliminated global variable

* updates to user_access_token_store and upgrade.go

* style fix and cleanup
2017-10-19 08:10:29 -04:00
Chris
917e4789c2 Use tmpfs containers for api/api4 tests, move and speed up CLI tests (#7606)
* use tmpfs containers for api/api4, move and speed up cli tests

* minor optimizations

* add missing files, fix pre-existing race condition

* add . to TestMain check

* add requested log message
2017-10-12 12:24:54 -07:00