forked from cve-search/cve-search
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlugins.py
47 lines (43 loc) · 1.49 KB
/
Plugins.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Plugin Classes
# Classes for all plug-ins to be based on
#
# Software is free software released under the "GNU Affero General Public License v3.0"
#
# Copyright (c) 2016-2018 Pieter-Jan Moreels - [email protected]
class Plugin():
def __init__(self):
self.name = None
self.uid = None
self.requiresAuth = False
self.loadstate = "default"
# Get
def getName(self): return self.name
def getUID(self): return self.uid
def getLoadState(self): return self.loadstate
# Set
def setUID(self, uid): self.uid = uid
def setLoadState(self, state): self.loadstate = state
# Don't override
def isWebPlugin(self): return False
# To override without returns
def loadSettings(self, reader): pass
def onDatabaseUpdate(self): pass
# To override with returns
def search(self, text, **args): pass
class WebPlugin(Plugin):
# Don't override
def isWebPlugin(self): return True
# To override with returns
def getPage(self, **args): return (None, None)
def getSubpage(self, page, **args): return (None, None)
def getCVEActions(self, cve, **args): return []
def getFilters(self, **args): return []
def doFilter(self, filters, **args): return []
def cvePluginInfo(self, cve, **args): pass
def mark(self, cve, **args): return (None, None)
# To override without returns
def onCVEAction(self, cve, action, **args): pass
def onCVEOpen(self, cve, **args): pass