Commit Graph

28 Commits

Author SHA1 Message Date
Daniel Hodan
3087f0bc4c GH-9609: Add GetUsersInTeam in plugin API (#9642)
* add GetUsersInTeam in plugin api

* remove extra space in comment
2018-10-15 09:24:26 -07:00
Jason Mojica
9da4aba3f2 Add SearchChannels plugin api (#9657) 2018-10-15 09:23:46 -07:00
Alexander Akhmetov
160d278592 GH-9633 Added plugin API method to return user's profile image (#9653) 2018-10-15 16:23:41 +02:00
Hanzei
c1e5fff565 Add GetPostsSince() to plugin API (#9649) 2018-10-15 10:04:22 -04:00
Hanzei
0267a1f76e Add GetPostThread() to plugin API (#9652) 2018-10-15 21:19:36 +08:00
Daniel Schalla
c36e85c912 DeleteAll for KV (#9431)
Expire K/V Values

Regenerate Code

pathfix

Update Expiry on Update

Check for Exit Signal

gofmt

Rewrote Go Routine

Remove tempoarily cleanup loop

fix expiretime

TEST: Expired Watchdog as GoRoutine

Check if Srv is nil

Use Scheduler/Worker for Expired Key CleanUp

add license

fix scheduler job type; DoJob Restructuring

Remove unused imports and constants

move db migration from 5.4 to 5.5
2018-10-10 10:55:12 -07:00
Akash Srivastava
bd04d7f756 Add GetPostsForChannel method to plugin API (#9557)
Signed-off-by: Akash Srivastava <akash.srivastava@openebs.io>
2018-10-10 09:23:36 -04:00
Akash Srivastava
8de9a61f7f Add GetChannelMembers method to plugin API (#9525)
Signed-off-by: Akash Srivastava <akash.srivastava@openebs.io>
2018-10-03 16:07:54 -04:00
Shobhit Gupta
8c03e584c1 MM-11863 Add KVList method (#9467)
* Add KVList method

* Add KVList method

Add KVList method

* Add pagination support

* Change offset, limit to page, perPage

* Rename constant
2018-10-03 16:04:37 -04:00
Hanzei
15d9f10f43 Add plugin API methode to return the current server version (#9429) 2018-09-27 12:56:47 -04:00
Jesse Hallam
f2ddef9117 MM-11734: better plugin error handling (#9405)
* MM-11734: encode unregistered error implementations as an ErrorString

* MM-11734: test error string handling

* more idiomatic error handling
2018-09-13 11:31:22 -07:00
Daniel Schalla
531897b1f0 add megacheck as makefile target (#9288)
Fix code issues in channel_test.go

Fix Channel Test Issues detected by Megacheck

Fix API Emoji Test Issues detected by Megacheck

Fixed API Issues Reported by Megacheck

Fixed App issues reported by megacheck

Remaining fixes

removed test added by mistake from old HEAD

gofmt

Store Fixes

simplified returns

Fix test for multi member channel delete

revert to delete unused function
2018-09-03 14:08:40 +02:00
Joram Wilander
9c76d9ba00 Add GetLDAPUserAttributes method to the plugin API (#9326) 2018-08-29 11:07:27 -07:00
Jesús Espino
cea1796f06 Adding Permissions check and reactions function to plugins API (#9273)
* Adding reactions functions

* Adding permissions checking in the plugins api
2018-08-20 09:22:08 -07:00
Elias Nahum
0aa0adb911 Add FileInfo and get file []byte in plugin api (#9269)
* Add FileInfo and get file []byte in plugin api

* Regenerated plugin mocks

* Rename ReadFileAtPath to ReadFile
2018-08-20 09:18:25 -07:00
dmitrysamuylovpharo
7a731d2bd1 Feature/fileinfo create copy (#9198)
* Initial implementation of a CopyFileInfos function that creates new FileInfo objects copied from provided FileIds with the provided user as the creator and not linked to a post yet. This can subsequently be used to copy existing attachments from another post to attach to a new post without having to re-upload the actual files

* added a unit test for the CopyFileInfos function

* resolving pull request suggestions
2018-08-02 10:37:31 -04:00
Daniel Schalla
2936dc87d0 CSRF Token Implementation for Plugins (#9192)
deleted test config

fix test config

Dont wipe the session token for plugins

Simplified Tokens; Generate CSRF for other sessions

Remove CSRF from Access Token; Remove Getter/Setter from Context

fix removed setter

remove getcsrf helper from plugin api

enforce csrf only for cookie auth
2018-08-01 15:16:04 -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
Daniel Schalla
d23ca07133 Login Hooks (#9177)
Tests; gofmt
2018-07-30 11:55:38 -07:00
Jesse Hallam
1d9c144854 s/mlog/log/ in apiRPCClient (#9171)
We never actually initialized `log` on apiRPCClient, and it can't log
without making an RPC call anyway, so just switch to logging errors from
the plugin to STDERR instead.
2018-07-27 08:17:29 -07:00
Jesse Hallam
908a682fcf make GetChannelByName take teamId first (#9134)
* make GetChannelByName take teamId first

I think it is more natural to accept `teamId`, then `channelName`,
given the pattern followed by other Plugin API methods and even the SQL
Store itself. The App layer seems unusual in accepting `channelName`
first.

This also re-generates the mocks fixing the parameter order for the
recently added `UserStatus` APIs.

* add GetChannelByNameForTeamName
2018-07-20 09:03:08 -07: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
Jesse Hallam
17f211c393 MM-11292: clean up plugins GoDoc (#9109)
* clean up plugins GoDoc:

- eliminate plugin.NewBlankContext() as unnecessary
- export ValidIdRegex as a string vs. the less readable var
- add/update various documentation strings
- hide everything by default, except where used by client plugins or the mattermost-server. The exception to this rule are the `*(Args|Returns)` structs which must be public for go-plugin, but are now prefixed with `Z_` with a warning not to use.
- include a top-level example to get plugin authors started

This is not a breaking change for existing plugins compiled against
plugins-v2.

* remove commented out ServeHTTPResponseWriter

* update examples to match developer docs

* add missing plugin/doc.go license header
2018-07-13 10:29:50 -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
Christopher Speller
4c1ddcff10 MM-10703 Adding blank request context to plugin hooks for future use. (#9043)
* Adding blank request context to plugin hooks for future use.

* Rename RequestContext to Context

* Adding context to ServeHTTP and ExecuteCommand

* Fixing import cycle in test.
2018-07-06 09:07:09 -04:00
Christopher Speller
83a3ac089c MM-11029 Adding plugin logging functionality. (#9034)
* Capturing stdout, stderr of plugins in logs.

* Cleanup go-plugin debug logs.

* Adding logging to plugin API

* Generating mocks.

* godoc convention
2018-07-03 09:58:28 -07:00
Joram Wilander
d7976549a0 MM-9674 Add plugin API for publishing custom WebSocket events (#8999)
* Add plugin API for publishing custom WebSocket events

* Add clearer payload comment

* Update comment
2018-06-27 08:46:38 -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