From c7ea30b059a4dffcd606151b653b638b26a4477e Mon Sep 17 00:00:00 2001 From: Mike Auty Date: Tue, 2 Jun 2020 00:08:01 +0100 Subject: [PATCH] Core: Add in framework version check for plugins --- volatility/framework/interfaces/plugins.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/volatility/framework/interfaces/plugins.py b/volatility/framework/interfaces/plugins.py index 2692b9754..d716090ab 100644 --- a/volatility/framework/interfaces/plugins.py +++ b/volatility/framework/interfaces/plugins.py @@ -13,7 +13,7 @@ import logging from abc import ABCMeta, abstractmethod from typing import List, Optional, Tuple -from volatility import classproperty +from volatility import classproperty, framework from volatility.framework import exceptions, constants, interfaces vollog = logging.getLogger(__name__) @@ -78,6 +78,7 @@ class PluginInterface(interfaces.configuration.ConfigurableInterface, metaclass # Be careful with inheritance around this _version = (0, 0, 0) # type: Tuple[int, int, int] + _required_framework_verison = (1, 0, 0) # type: Tuple[int, int, int] """The _version variable is a quick way for plugins to define their current interface, it should follow SemVer rules""" def __init__(self, @@ -100,6 +101,8 @@ class PluginInterface(interfaces.configuration.ConfigurableInterface, metaclass raise exceptions.PluginRequirementException("The plugin configuration failed to validate") self._file_consumer = None # type: Optional[FileConsumerInterface] + framework.require_interface_version(*self._required_framework_verison) + def set_file_consumer(self, consumer: FileConsumerInterface) -> None: """Sets the file consumer to be used by this plugin.""" self._file_consumer = consumer