Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pin spinx and fix errors #767

Merged
merged 3 commits into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion doc/source/custom_extensions/security_best_practices.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
23 changes: 12 additions & 11 deletions logprep/connector/http/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -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
Expand All @@ -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")

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ dev = [
]

doc = [
"sphinx",
"sphinx<8.2.0",
"sphinx_rtd_theme",
"sphinxcontrib.datatemplates",
"sphinxcontrib-mermaid",
Expand Down
Loading