This repository has been archived by the owner on Nov 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 329
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add sample plugin and hooks for all endpoints
- Loading branch information
1 parent
a5c2599
commit 76a895e
Showing
3 changed files
with
75 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
# Copyright (c) 2014 Mozilla Corporation | ||
# | ||
# Contributors: | ||
# Jeff Bryner jbryner@mozilla.com | ||
|
||
class message(object): | ||
def __init__(self): | ||
'''register our criteria for being passed a message | ||
as a list of lower case strings to match with an rest endpoint (i.e. blockip matches /blockip) | ||
set the priority if you have a preference for order of plugins to run. 0 goes first, 100 is assumed/default if not sent | ||
''' | ||
|
||
self.registration = ['test', | ||
'kibanadashboards' | ||
] | ||
self.priority = 10 | ||
self.name = "TestPlugin" | ||
self.description = "Just something to test with" | ||
|
||
def onMessage(self, request, response): | ||
response.headers['X-PLUGIN'] = self.description | ||
print(request, response) | ||
return (request, response) |