mirror of
https://github.com/checktheroads/hyperglass
synced 2024-05-11 05:55:08 +00:00
22 lines
498 B
Python
22 lines
498 B
Python
"""Input validation plugins."""
|
|
|
|
# Standard Library
|
|
from typing import TYPE_CHECKING, Union
|
|
|
|
# Local
|
|
from ._base import DirectivePlugin
|
|
|
|
if TYPE_CHECKING:
|
|
# Project
|
|
from hyperglass.models.api.query import Query
|
|
|
|
InputPluginReturn = Union[None, bool]
|
|
|
|
|
|
class InputPlugin(DirectivePlugin):
|
|
"""Plugin to validate user input prior to running commands."""
|
|
|
|
def validate(self, query: "Query") -> InputPluginReturn:
|
|
"""Validate input from hyperglass UI/API."""
|
|
return None
|