diff --git a/pyproject.toml b/pyproject.toml index d5104d5..d6f986c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -89,7 +89,7 @@ dev-dependencies = [ "pytest-cov >= 4.1,< 5.0", "coverage ~= 7.4", "junit2html >= 30.1,< 32.0", - "pyright == 1.1.383", + "pyright == 1.1.384", "isort ~= 5.13", "ruff ~= 0.3", "bandit[sarif,toml] ~= 1.7" diff --git a/src/web/Ligare/web/config.py b/src/web/Ligare/web/config.py index e41c2eb..1bf267d 100644 --- a/src/web/Ligare/web/config.py +++ b/src/web/Ligare/web/config.py @@ -1,6 +1,6 @@ from dataclasses import field from os import environ -from typing import Literal +from typing import Literal, Sequence, cast from flask.config import Config as FlaskAppConfig from Ligare.programming.config import AbstractConfig @@ -16,7 +16,7 @@ class LoggingConfig(BaseModel): class WebSecurityCorsConfig(BaseModel): origins: list[str] | None = None allow_credentials: bool = False - allow_methods: list[ + allow_methods: Sequence[ Literal[ "GET", "POST", @@ -28,7 +28,11 @@ class WebSecurityCorsConfig(BaseModel): "CONNECT", "TRACE", ] - ] = field(default_factory=lambda: ["GET", "POST", "OPTIONS"]) + ] = field( + default_factory=lambda: cast( + list[Literal["GET", "POST", "OPTIONS"]], ["GET", "POST", "OPTIONS"] + ) + ) allow_headers: list[str | Literal["*"]] = field(default_factory=lambda: ["*"])