2021-09-11 11:17:38 -07:00
|
|
|
"""Input validation plugins."""
|
|
|
|
|
|
|
|
# Standard Library
|
|
|
|
from abc import abstractmethod
|
2021-09-11 17:55:27 -07:00
|
|
|
from typing import TYPE_CHECKING
|
2021-09-11 11:17:38 -07:00
|
|
|
|
|
|
|
# Local
|
|
|
|
from ._base import HyperglassPlugin
|
|
|
|
|
2021-09-11 17:55:27 -07:00
|
|
|
if TYPE_CHECKING:
|
|
|
|
# Project
|
|
|
|
from hyperglass.models.api.query import Query
|
|
|
|
|
2021-09-11 11:17:38 -07:00
|
|
|
|
|
|
|
class InputPlugin(HyperglassPlugin):
|
|
|
|
"""Plugin to validate user input prior to running commands."""
|
|
|
|
|
|
|
|
@abstractmethod
|
2021-09-11 17:55:27 -07:00
|
|
|
def process(self, device_output: str, query: "Query") -> str:
|
2021-09-11 11:17:38 -07:00
|
|
|
"""Validate input from hyperglass UI/API."""
|
|
|
|
pass
|