Commit graph

22 commits

Author SHA1 Message Date
Jesse Hallam
687700a989 clarify CopyFileInfos godocs (#9243) 2018-08-10 17:21:37 +02: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
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
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
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
Chris
4c17bdff1b
Add plugin slash command support (#7941)
* add plugin slash command support

* remove unused string

* rebase
2017-12-08 13:55:41 -06:00
Joram Wilander
7a1f81cd52
Add GetChannelMember method to plugin API (#7930) 2017-12-05 09:14:03 -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
d2cff9b77c more plugin doc updates (#7767) 2017-11-03 09:34:44 -07:00
Chris
fed5324ce5 Add some plugin docs (#7757)
* add some plugin docs

* one more comment

* spacing

* example simplification
2017-11-02 17:23:41 -04:00
Chris
5dd4466ab3 add missing license headers, test to makefile (#7711) 2017-10-25 09:33:19 -07:00
Chris
e525383c52 plugin CRUD operations for users, posts, channels, and teams (#7479) 2017-09-21 14:00:14 -05:00
Christopher Speller
29fca51821
Renaming repo 2017-09-06 23:11:59 -07:00
Chris
ff50b0e138 add client4 apis needed for jira plugin (#7292) 2017-08-28 14:19:00 -05:00
Chris
f80d50adbd PLT-7407: Back-end plugin mechanism (#7177)
* begin backend plugin wip

* flesh out rpcplugin. everything done except for minor supervisor stubs

* done with basic plugin infrastructure

* simplify tests

* remove unused test lines
2017-08-16 17:23:38 -05:00