summaryrefslogtreecommitdiffstats
path: root/api4
Commit message (Collapse)AuthorAgeFilesLines
* fix test and add new (#8758)Carlos Tadeu Panato Junior2018-05-101-1/+6
|
* update permission of converting a channel from public to private to allow ↵Saturnino Abril2018-05-052-9/+11
| | | | team admin (#8723)
* Add inactive user count to analytics and fix client analytics function (#8695)Joram Wilander2018-05-021-4/+13
|
* [MM-10354] Add feature to remove team icon (#8684)Saturnino Abril2018-04-302-0/+58
| | | | | | | | * set team.LastTeamIconUpdate to 0 when removing team icon * add APIv4 for removing team icon * removed comment and updated typo on AppError
* Structured logging (#8673)Christopher Speller2018-04-2712-52/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Implementing structured logging * Changes to en.json to allow refactor to run. * Fixing global logger * Structured logger initalization. * Add caller. * Do some log redirection. * Auto refactor * Cleaning up l4g reference and removing dependancy. * Removing junk. * Copyright headers. * Fixing tests * Revert "Changes to en.json to allow refactor to run." This reverts commit fd8249e99bcad0231e6ea65cd77c32aae9a54026. * Fixing some auto refactor strangeness and typo. * Making keys more human readable.
* MM-10375 Fixing connected socket count (#8682)Corey Hulen2018-04-271-0/+22
| | | | | | * Fixing connected socket count * Adding unit test
* MM-10232, MM-10259: Improve error handling from invalid json (#8668)Jesse Hallam2018-04-262-7/+15
| | | | | | | | | | | | | | * MM-10232: improve error handling from malformed slash command responses Switch to json.Unmarshal, which doesn't obscure JSON parse failures like json.Decode. The latter is primarily designed for streams of JSON, not necessarily unmarshalling just a single object. * rework HumanizedJsonError to expose Line and Character discretely * MM-10259: pinpoint line and character where json config error occurs * tweak HumanizeJsonError to accept err first
* add api to convert a channel from public to private and restrict that to ↵Saturnino Abril2018-04-232-7/+81
| | | | system_admin (#8655)
* MM-9779: Incorporate a Token into the invitations system (#8604)Jesús Espino2018-04-184-105/+101
| | | | | | | | | | | | | | | | | | | | * 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
* Handle app errors in user autocomplete endpoint (#8643)Joram Wilander2018-04-171-3/+17
|
* Initial Commit of Ephemeral Message Support for System Admins (#8611)Daniel Schalla2018-04-172-0/+71
| | | | | | | | | Fixed Permission Test Fixed and extended ephemeral message tests; Removed Online/Activity Updates Set Create Time to current time gofmt
* Fix opengraph images not going through the image proxy. (#8627)Christopher Speller2018-04-161-0/+30
|
* Fix error handling when requesting profile image for bad user ID (#8618)Joram Wilander2018-04-132-1/+5
|
* Add Auto Responder handler (#8386)Stan Chan2018-04-122-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* MM-9849 Added tracking of which settings are set through environment ↵Harrison Healey2018-04-092-0/+77
| | | | | | | | | | | | | | | | 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
* Fixing unit tests for Go 1.10 (#8568)Christopher Speller2018-04-032-1/+13
|
* Fixing DB load causing user logout. (#8559)Christopher Speller2018-04-021-2/+4
|
* MM-9999 Fix unwanted team invite_id in email invites. (#8550)Christopher Speller2018-03-291-1/+0
| | | | | | * Fix unwanted team invite_id in email invites. * Removing unused translation.
* Fixing misspell errors (#8544)Jesús Espino2018-03-294-4/+4
|
* Merge branch 'advanced-permissions-phase-1'George Goldberg2018-03-2715-576/+1021
|\
| * Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-1Martin Kraft2018-03-273-6/+80
| |\
| * | Ignore blank role names in getRolesByName call. (#8507)George Goldberg2018-03-262-3/+19
| | |
| * | Merge branch 'master' into advanced-permissions-phase-1Martin Kraft2018-03-238-7/+79
| |\ \
| * \ \ Merge branch 'master' into advanced-permissions-phase-1George Goldberg2018-03-192-30/+31
| |\ \ \
| * \ \ \ Merge branch 'master' into advanced-permissions-phase-1George Goldberg2018-03-137-46/+175
| |\ \ \ \
| * | | | | MM-8830 Consistent Incomming/Outgoing webhooks permissions (#8335)Jesús Espino2018-03-071-8/+20
| | | | | |
| * | | | | Merge branch 'master' into advanced-permissions-phase-1George Goldberg2018-03-0210-50/+492
| |\ \ \ \ \
| * \ \ \ \ \ Merge branch 'master' into advanced-permissions-phase-1George Goldberg2018-02-192-20/+41
| |\ \ \ \ \ \
| * | | | | | | MM-8827: Add ADD_REACTION, REMOVE_REACTION and REMOVE_OTHERS_REACTIONS ↵Jesús Espino2018-02-192-184/+292
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | permissions (#8300)
| * | | | | | | MM-9618: Don't change default role permissions for policy. (#8303)George Goldberg2018-02-191-4/+4
| | | | | | | |
| * | | | | | | ABC-176 Prevent changing PluginSettings.EnableUploads through the API (#8249)Joram Wilander2018-02-132-2/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Prevent changing PluginSettings.EnableUploads through the API * Contain api4 test case in it's own test
| * | | | | | | Merge branch 'master' into advanced-permissions-phase-1George Goldberg2018-02-1313-134/+120
| |\ \ \ \ \ \ \
| * | | | | | | | XYZ-73: Removes EnableOnlyAdminIntegrations uses. (#8245)Martin Kraft2018-02-121-3/+0
| | | | | | | | |
| * | | | | | | | Fix tests. (#8244)George Goldberg2018-02-121-8/+0
| | | | | | | | |
| * | | | | | | | AllowEditPost and PostEditTimeLimit migration (#8208)Jesús Espino2018-02-091-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
| * | | | | | | | XYZ-76: Add license check to patchRoles endpoint. (#8224)George Goldberg2018-02-082-3/+60
| | | | | | | | |
| * | | | | | | | Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-1Jesús Espino2018-02-073-6/+9
| |\ \ \ \ \ \ \ \
| * \ \ \ \ \ \ \ \ Merge branch 'master' into advanced-permissions-phase-1George Goldberg2018-02-062-32/+35
| |\ \ \ \ \ \ \ \ \
| * | | | | | | | | | XYZ-37: Advanced Permissions Phase 1 Backend. (#8159)George Goldberg2018-02-0612-574/+618
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* | | | | | | | | | | post a system message after a channel is converted from public to private ↵Saturnino Abril2018-03-271-0/+8
| |_|_|_|_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#8501)
* | | | | | | | | | Relax 4k post message limit (#8478)Jesse Hallam2018-03-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * MM-9661: rename POST_MESSAGE_MAX_RUNES to \0_v1 * MM-9661: s/4000/POST_MESSAGE_MAX_RUNES_V1/ in tests * MM-9661: introduce POST_MESSAGE_MAX_RUNES_V2 * MM-9661: migrate Postgres Posts.Message column to TEXT from VARCHAR(4000) This is safe to do in a production instance since the underyling type is not changing. We explicitly don't do this automatically for MySQL, but also don't need to since the ORM would have already created a TEXT column for MySQL in that case. * MM-9661: emit MaxPostSize in client config This value remains unconfigurable at this time, but exposes the current limit to the client. The limit remains at 4k in this commit. * MM-9661: introduce and use SqlPostStore.GetMaxPostSize Enforce a byte limitation in the database, and use 1/4 of that value as the rune count limitation (assuming a worst case UTF-8 representation). * move maxPostSizeCached, lastPostsCache and lastPostTimeCache out of the global context and onto the SqlPostStore * address feedback from code review: * ensure sqlstore unit tests are actually being run * move global caches into SqlPostStore * leverage sync.Once to address a race condition * modify upgrade semantics to match new db semantics gorp's behaviour on creating columns with a maximum length on Postgres differs from MySQL: * Postgres * gorp uses TEXT for string columns without a maximum length * gorp uses VARCHAR(N) for string columns with a maximum length of N * MySQL * gorp uses TEXT for string columns with a maximum length >= 256 * gorp uses VARCHAR(N) for string columns with a maximum length of N * gorp defaults to a maximum length of 255, implying VARCHAR(255) So the Message column has been TEXT on MySQL but VARCHAR(4000) on Postgres. With the new, longer limits of 65535, and without changes to gorp, the expected behaviour is TEXT on MySQL and VARCHAR(65535) on Postgres. This commit makes the upgrade semantics match the new database semantics. Ideally, we'd revisit the gorp behaviour at a later time. * allow TestMaxPostSize test cases to actually run in parallel * default maxPostSizeCached to POST_MESSAGE_MAX_RUNES_V1 in case the once initializer panics * fix casting error * MM-9661: skip the schema migration for Postgres It turns out resizing VARCHAR requires a rewrite in some versions of Postgres, but migrating VARCHAR to TEXT does not. Given the increasing complexity, let's defer the migration to the enduser instead.
* | | | | | | | | | Adding go client support and basic unit tests for channel autocomplete. (#8510)Christopher Speller2018-03-261-0/+73
| | | | | | | | | |
* | | | | | | | | | Allow to get the team icon for open teams (#8499)Elias Nahum2018-03-231-5/+6
| |_|_|_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Allow to get the team icon for open teams * feedback review
* | | | | | | | | Timezone feature (#8185)Chris Duarte2018-03-223-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add supported timezones into config Remove Timezone list creation in favor of timezone from configs Add Timezone field to Users table Clean up format of SupportedTimezones in config * Remove unwanted change * Add test for updating user timezone * Add empty map[string]string if Timezone is null * Add EnableTimezoneSelection config * Revert back to map[string]string for ClientConfig * Refactor SupportedTimezones into timezones.json * Include timezones.json in TestConfigFlag * Add timezone api endpoint * Bump varchar size to 256 and setMaxSize in user_store * Refactor LoadConfig to LoadConfig and LoadTimezoneConfig * Remove unnecessary argument in LoadConfig, mail_test * Add test for timezone endpoint * Add license header * Refactor timezones endpoint to system.go * Add system base route to timezone endpoint * db timezone upgrade in db v4.9 * Avoid saving SupportedTimezones to config.json * Add timezonePath support in config * Remove EnableTimezoneSelection from config * Use return statement without return parameter * Refactor test for SupportedTimezones * Check for supportedTimezone != nil instead of using len * Decouple SupportedTimezones out of Config * Fix failing test * Add LastTeamIconUpdate back in upgrade.go * Write timezone config in config_flag_test * Add code fallback for default timezone support
* | | | | | | | | Fix various segfaults when running `go test` manually (#8448)Jesse Hallam2018-03-213-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * failing to find i18n shouldn't segfault The server was trying to handle the fact that it couldn't find the i18n directory, by emitting a translated log message... * fix utils.FindDir The attempts to find the directory in the parent or grandparent directory don't work if the current working directory was inside `enterprise`, with `enterprise` itself being a symlink as per the usual developer setup. Recurse to the root of the filesystem, cleaning the path along the way to work around this limitation (and allow tests to be run from an arbitrarily deep nesting level.) Fix corresponding usages to employ filepath.Join. * failing to find html templates shouldn't segfault * fail fast if the test user cannot be created * rework utils.FindDir to retain backwards compatibility
* | | | | | | | | Fix paging for GET /teams and GET /teams/{id}/members endpoints (#8488)Joram Wilander2018-03-212-3/+29
| |_|_|_|_|_|_|/ |/| | | | | | |
* | | | | | | | remove s3 region to be mandatory and fix when user call test s3 when the ↵Carlos Tadeu Panato Junior2018-03-142-13/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | config is saved (#8454)
* | | | | | | | update email test in the driver to be able to send the config in the body ↵Carlos Tadeu Panato Junior2018-03-131-17/+23
| |_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | (#8453) Signed-off-by: cpanato <ctadeu@gmail.com>
* | | | | | | Removed mssola/user_agent library (#8417)Harrison Healey2018-03-121-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Removed mssola/user_agent library * Changed user agent tests to use t.Run
* | | | | | | MM-9274- Sort Users in Channel by status (#8181)Stephen Kiers2018-03-093-3/+170
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sort by lastActivity * added status ordering to Users * sort offline before dnd * remove data not needed * added seperate call for when order=‘status’ is on GetUser request * remove PrintLn * styling fix * remove mistake * mistake 2 * better comment * explicit if statemnt * writing tests * removed manually added mocks * generated mock * ICU-668 Added unit tests * style fix * sort by lastActivity * added status ordering to Users * sort offline before dnd * remove data not needed * added seperate call for when order=‘status’ is on GetUser request * remove PrintLn * styling fix * remove mistake * mistake 2 * better comment * explicit if statemnt * writing tests * removed manually added mocks * generated mock * ICU-668 Added unit tests * style fix * reverse dnd and offline * Fixed app.SaveStatusAndBroadcast * Fixed incorrect merge * Fixing incorrect merge again