Commit Graph

532 Commits

Author SHA1 Message Date
Jesús Espino
d81a61398d Migrate all the api4 to handle errors in idiomatic way (#9143) 2018-08-01 16:55:18 +02:00
George Goldberg
a6c364822a MM-11516: Check channel ID in URL param and Body are same. (#9185) 2018-07-31 14:13:44 -04:00
Joram Wilander
867416b0e6 Add OAuth2 login hint for SAML (#9194) 2018-07-31 07:29:19 -07:00
Martin Kraft
5872bf9c2f Pr 9039 (#9187)
* MM-11065: Allow to search and get archived channels from the API

* Fixing more tests

* Add some unit tests

* Add includeDeleted parameter to session permissions check function

* More test fixing

* Adding archive channels list in channels search

* Add restriction for archived channel edition

* Reverting permissions checks modification

* Changed the query parameter to include_deleted

* Enable search archive channels as true by default

* Adding tests for verify search on deleted channels

* Allowing to override archive channels during the imports

* Fixed test

* Search in archive channels from the API must be explicitly requested

* Removing includeDeleted parameter from GetChannelByName and GetChannelByNameForTeam

* Back to ViewArchivedChannels config

* Fixing tests

* Reverting GetChannelByName parameter

* Add include deleted parameter on GetChannel functions in plugins api

* Fixing tests
2018-07-30 15:06:08 -04:00
Saturnino Abril
51dc5fa36e [MM-10621] Set createAt timestamp on file upload api call to secure upload order of files (#9170)
* set createAt timestamp on file upload api call to secure upload order of files

* fix test on plugin hooks
2018-07-28 14:27:55 +08:00
Joram Wilander
6ac82d5171 Implement OAuth2 implicit grant flow (#9178) 2018-07-27 17:35:43 -04:00
Christopher Speller
90e5e279c1 Fix file streaming to close files. (#9168) 2018-07-26 10:52:24 -07:00
Christopher Speller
bae26ec268 MM-11160 Adding proper CORS support. (#9152)
* Adding proper CORS support.

* Better CORS tests.
2018-07-26 08:31:22 -07:00
Jesse Hallam
8948b91d7a unpack prepacked plugins on plugins initialization (#9149)
* unpack prepackaged plugins on plugins initialization

* leverage utils.FindDir
2018-07-26 08:45:26 -04:00
Pradeep Murugesan
b3c2ecd9b9 added the custom icon and username for the outgoing webhook and its response (#9141)
* 8272 added the username and icon as part of the model and persisted the same

* 8272 added the custome icon and name when set to the web hook response

* 8272 changed the infinte loop to timeout after 5 seconds

* 8272  fixed review comments
2018-07-25 08:31:41 -04:00
Hyeseong Kim
8387d92ea2 MM-10381: Change the file downloading API to stream file (#9144)
* Change the file downloading to stream file

* Change file downloading to chunk only for preview

* Remove unnecessary else case
2018-07-24 11:23:54 -07:00
Jesús Espino
e475cecf00 Remove unnecesary elses after return error (#9137) 2018-07-23 11:55:42 +05:30
Jesús Espino
b367b1ff40 Do not close the connection abruptly on too big file uploads (#9083) 2018-07-18 10:07:00 +02:00
Joram Wilander
f2c1803905 Make plugin IDs case insensitive (#9117) 2018-07-16 16:56:55 -04:00
Joram Wilander
275731578e MM-10254 Add plugin APIs for getting/updating user statuses (#9101)
* Add plugin APIs for getting/updating user statuses

* Add and update tests

* Updates per feedback
2018-07-16 15:49:26 -04:00
George Goldberg
9d9fcd9ac5 MM-11172: Don't allow reacting in read-only town square. (#9106) 2018-07-16 13:04:52 +01:00
cpanato
adc56ae78d Merge remote-tracking branch 'upstream/release-5.1' into release-5.1-daily-merge-20180712 2018-07-12 19:50:16 +02:00
Carlos Tadeu Panato Junior
7ed712f938 Restore config after finisht the test case (#9085) 2018-07-11 12:58:16 +02:00
JoramWilander
6c7dc2d29c Merge branch 'plugins-2' 2018-07-10 15:01:43 -04:00
cpanato
c042ffa460 Merge remote-tracking branch 'upstream/release-5.1' into release-5.1-daily-merge-20180710 2018-07-10 19:27:14 +02:00
George Goldberg
2d16a71af9 MM-11228: Fix channel update/patch API endpoints. (#9073) 2018-07-10 10:55:46 +02:00
Jesús Espino
602fd0ffdd MM-11189: Do not close the connection abruptly on too big emojis (#9071) 2018-07-10 10:55:24 +02:00
Christopher Speller
74e5d8ae66 MM-11120 Adding setting to disable email invitations and rate limiting. (#9063)
* Adding setting to disable email invitations.

* Adding a setting and rate limiting for email invite sending.

* Modifying email rate limit to 20/user/hour

* Adding EnableEmailInvitations to client side config and command.
2018-07-10 10:54:25 +02:00
JoramWilander
b78b216a3c Merge branch 'master' into plugins-2 2018-07-07 12:04:18 -04:00
Daniel Schalla
359f12db33 First batch of new plugin api methods (#9022)
update api mocks

Generated new hooks

ChannelHasJoinedChannel Implementation

User Left Team/Channel Hook; User Joined Team Hook Implementation

Update RPC Client and Mocks

gofmt

go tests fix

Add Config API Methods

codegne

Add Channel Has Been Created Hook

Fix ChannelHasBeenCreated hook

fix missing context param

fix duplicate hooks; remove redudandcy
2018-07-06 15:32:55 -07:00
Saturnino Abril
9e5ec7d09d [MM-10754] Remove unnecessary command_test route (#9050)
* remove unnecessary command_test route

* replaced localhost with ts.URL
2018-07-06 09:07:42 -04:00
Jesse Hallam
6b7a35b653 MM-11118: disallow deleting direct or group channels (#9054) 2018-07-05 09:17:43 +02:00
JoramWilander
3848cb7e79 Merge branch 'master' into plugins-2 2018-06-30 12:24:04 -04:00
Martin Kraft
56ba06c016 MM-10980: Conditionally filteres User json properties. (#9018) 2018-06-29 08:45:04 -04:00
JoramWilander
88c5e469ca Merge branch 'master' into plugins-2 2018-06-27 16:56:50 -04:00
Emil Velikov
f17c15c9d8 Simplify oauth (#8972)
* Remove unused OauthProvider::GetIdentifier

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>

* Reuse gitlab's getAuthData() instead of open-coding it

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>

* Remove OauthProvider::GetAuthDataFromJson interface

The data is already available via GetUserFromJson().AuthData

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2018-06-26 17:23:13 -07:00
Jesse Hallam
2d7cd02abc MM-10833: send down computed channel props (#8953)
* MM-10833: send down computed channel props

This allows channel headers to reference channel mentions for a client
that doesn't already know about the channels in question.

We intentionally don't send down the props for the autocomplete and
search endpoints since they aren't used in that context, and would add
unnecessary overhead.

* update channel props on patch

* revert to treating channel purpose as plaintext
2018-06-26 16:46:57 -04:00
Christopher Speller
1e5c432e10 MM-10702 Moving plugins to use hashicorp go-plugin. (#8978)
* Moving plugins to use hashicorp go-plugin.

* Tweaks from feedback.
2018-06-25 12:33:13 -07:00
Jesse Hallam
dd35ad43ca MM-10370: serve subpath (#8968)
* factor out GetSubpathFromConfig

* mv web/subpath.go to utils/subpath.go

* serve up web, api and ws on /subpath if configured

* pass config to utils.RenderWeb(App)?Error

This allows the methods to extract the configured subpath and redirect
to the appropriate `/subpath/error` handler.

* ensure GetSubpathFromConfig returns trailing slashes deterministically

* fix error 404 handling

* redirect /subpath to /subpath/

This is necessary for the static handler to match, otherwise none of the
registered routes find anything. This also makes it no longer necessary
to add trailing slashes in the root router.
2018-06-21 11:31:51 -07:00
Jesús Espino
344836dfb2 Add missed translations (#8959) 2018-06-19 19:40:26 +02:00
Harrison Healey
226d4b2ac8 MM-6992 Added highlighting to elasticsearch results (#8861)
* MM-6992 Added highlighting to elasticsearch results

* Added a unique type for post search matches

* Fixed Elasticsearch matches not being sent through API
2018-06-19 11:46:29 +02:00
Harrison Healey
6d8140337e MM-8701 Limit the number of client config fields sent before user logs in (#8954)
* MM-8701 Limit the number of client config fields sent before user logs in

* Fixed missing client config field

* Reduced duplication between limited and regular client config
2018-06-18 12:39:22 -04:00
Corey Hulen
656c8a62d1 Prototype for CBA (#8475)
* Prototype for CBA

* Fixing gofmt issues

* Do not require password if logging in with certificate

* Fixing issues from feedback

* Adding unit tests

* Fixing feedback
2018-06-12 10:16:39 -07:00
Carlos Tadeu Panato Junior
3bae67489f Relese5.0 merge master 20180608 (#8933)
* Add missing diagnostics (#8911)

* Update diagnostics.go

* Update diagnostics.go

* Fix push notification styling backwards compatibility (#8913)

* MM-10803: remove premature user sanitization on deactivation (#8926)

* remove unused UpdateNonSSOUserActive

* MM-10803: stop prematurely sanitizing users on deactivate

This change was preceded by the removal of UpdateNonSSOUserActive to
ensure there are no APIs relying on the sanitized return value.

* MM-10803: test websocket events after UpdateUserActive

* MM-10264: Adds system scheme to permissions import/export. (#8924)

* MM-10264: Adds system scheme to permissions import/export.

* MM-10264: Switches to more likely unique name.

* MM-10264: Changed collision prevention string.

* MM-10264: Rolls back created schemes in all error cases.

* MM-10264: Test fix for more rollback cases.
2018-06-08 17:04:17 +02:00
lisakycho
e09b3c566b Get the count of the all system users at endpoint /users/stats (#8847)
* Get the count of the all system users at endpoint /users/stats

* Added GetTotalUsersStats test in api4

* Changed pluralization and added the test back.
2018-06-07 12:45:49 -04:00
George Goldberg
0c4078b6b0 MM-9730 & MM-9729: Missing Server PRs (#8908)
* MM-9730: API endpoint to update scheme-derived roles of TeamMembers.

* MM-9729: API to update scheme-derived roles of ChannelMembers.
2018-06-05 07:41:03 -04:00
Christopher Speller
2c75247c97 MM-10348 Adding experimental hardened mode. (#8881)
* Adding experimental hardened mode.

* Sanitizing all 500 errors.
2018-06-04 09:48:26 -07:00
Saturnino Abril
312edbe531 [MM-10718] Move custom branding to TE (#8871)
* move custom branding to TE
* move brand's enterprise code to server and remove BrandInterface
2018-06-02 06:33:59 +08:00
Martin Kraft
260d7a0f85 MM-10412: Adds deleteBy prop to posts. (#8896) 2018-06-01 12:45:46 -04:00
George Goldberg
516a097e1a MM-10757: Default roles from scheme should be keyed by name not ID. (#8894)
* MM-10757: Default roles from scheme should be keyed by name not ID.

* Update permissions import/export.
2018-06-01 12:49:02 +01:00
Jesús Espino
e88fe4bb1d MM-8853: Adding MANAGE_EMOJIS and MANAGE_OTHERS_EMOJIS permissions (#8860)
* MM-8853: Adding MANAGE_EMOJIS and MANAGE_OTHERS_EMOJIS permissions

* MM-8853: Removing unnecesary emoji enterprise feature

* Create emojis migration

* Adding MANAGE_EMOJIS and MANAGE_OTHERS_EMOJIS always to system admins

* Simplifing permissions checks

* Revert "Simplifing permissions checks"

This reverts commit e2cafc1905.
2018-05-29 15:58:12 +01:00
Jesús Espino
bf4cefc349 Allow to update the teams scheme to default scheme (#8855) 2018-05-29 09:32:07 +01:00
Martin Kraft
c180cdbd1c Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-2 2018-05-28 10:35:27 -04:00
Saturnino Abril
c37d153ffb [MM-10519] Send websocket event whenever the channel has changed it's type (public|private) (#8798)
* send websocket event whenever the channel has changed it's type (public|private)

* updated per comment

Signed-off-by: Saturnino Abril <saturnino.abril@gmail.com>

* add channel_converted websocket event

Signed-off-by: Saturnino Abril <saturnino.abril@gmail.com>

* only send channel_id via websocket message for "channel_converted" event

Signed-off-by: Saturnino Abril <saturnino.abril@gmail.com>
2018-05-28 22:31:08 +08:00
Carlos Tadeu Panato Junior
c3e9c41440 [MM-1915] Add Deactivate Account - server side (#8699) 2018-05-28 16:20:08 +02:00