diff --git a/doc/source/custom_extensions/security_best_practices.py b/doc/source/custom_extensions/security_best_practices.py index 033f469f7..24f2cd21f 100644 --- a/doc/source/custom_extensions/security_best_practices.py +++ b/doc/source/custom_extensions/security_best_practices.py @@ -181,7 +181,9 @@ def create_xls_checklist(app, env): ) dataframe = pd.DataFrame(description) download_file_name = "security-best-practices-check-list" - download_file_obj = [env.dlfiles[key] for key in env.dlfiles if download_file_name in key][0] + download_file_obj = [env.dlfiles[key] for key in env.dlfiles if download_file_name in str(key)][ + 0 + ] download_file_path = download_file_obj[1] full_file_path = f"{app.outdir}/_downloads/{download_file_path}" writer = pd.ExcelWriter(full_file_path, engine="openpyxl") diff --git a/logprep/connector/http/input.py b/logprep/connector/http/input.py index b64700b6a..0ab7599d7 100644 --- a/logprep/connector/http/input.py +++ b/logprep/connector/http/input.py @@ -56,11 +56,12 @@ .. security-best-practice:: :title: Http Input Connector - Authentication - When using basic auth with the http input connector - the following points should be taken into account: - - basic auth must only be used with strong passwords - - basic auth must only be used with TLS encryption - - avoid to reveal your plaintext secrets in public repositories + When using basic auth with the http input connector + the following points should be taken into account: + + - basic auth must only be used with strong passwords + - basic auth must only be used with TLS encryption + - avoid to reveal your plaintext secrets in public repositories Behaviour of HTTP Requests ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -86,7 +87,7 @@ from abc import ABC from base64 import b64encode from functools import cached_property -from typing import Callable, List, Mapping, Tuple, Union +from typing import Callable, List, Mapping, Tuple, Type, Union import falcon.asgi import msgspec @@ -104,7 +105,7 @@ from logprep.abc.input import FatalInputError, Input from logprep.metrics.metrics import CounterMetric, GaugeMetric from logprep.util import http, rstr -from logprep.util.credentials import CredentialsFactory +from logprep.util.credentials import Credentials, CredentialsFactory logger = logging.getLogger("HTTPInput") @@ -212,13 +213,13 @@ class HttpEndpoint(ABC): Includes authentication credentials, if unset auth is disabled """ - # pylint: disable=too-many-arguments,too-many-positional-arguments + # pylint: disable=too-many-arguments def __init__( self, messages: mp.Queue, collect_meta: bool, metafield_name: str, - credentials: dict, + credentials: Credentials, metrics: "HttpInput.Metrics", ) -> None: self.messages = messages @@ -414,11 +415,11 @@ class Config(Input.Config): metafield_name: str = field(validator=validators.instance_of(str), default="@metadata") """Defines the name of the key for the collected metadata fields""" - __slots__ = [] + __slots__: List[str] = ["target", "app", "http_server"] messages: mp.Queue = None - _endpoint_registry: Mapping[str, HttpEndpoint] = { + _endpoint_registry: Mapping[str, Type[HttpEndpoint]] = { "json": JSONHttpEndpoint, "plaintext": PlaintextHttpEndpoint, "jsonl": JSONLHttpEndpoint, diff --git a/pyproject.toml b/pyproject.toml index ae26d243c..37c84a085 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -114,7 +114,7 @@ dev = [ ] doc = [ - "sphinx", + "sphinx<8.2.0", "sphinx_rtd_theme", "sphinxcontrib.datatemplates", "sphinxcontrib-mermaid",