Skip to content

Commit da6c054

Browse files
committed
Merge branch 'ci/OBS-1999-container-security-hardening' into 'enterprise'
fix: resolve mypy errors under Python 3.13 target See merge request dkinternal/observability/dataops-observability!75
2 parents 8b8cada + a78d4bb commit da6c054

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

common/api/base_view.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def request_body(self) -> dict[str, Any]:
8686
request_body = json.loads(request.data)
8787
except json.JSONDecodeError as je:
8888
raise BadRequest("The request does not contain a valid JSON body") from je
89-
return request_body
89+
return request_body # type: ignore[no-any-return]
9090

9191
def parse_body(self, *, schema: Schema) -> Any:
9292
"""Parse the response body using the given schema."""

common/api/flask_ext/authentication/jwt_plugin.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
from flask import current_app, g, request
88
from jwt import decode, encode
9+
from jwt.types import Options
910
from peewee import DoesNotExist
1011
from werkzeug.exceptions import Unauthorized
1112

@@ -33,7 +34,7 @@ class JWTAuth(BaseAuthPlugin):
3334
header_name = "Authorization"
3435
header_prefix = "Bearer"
3536

36-
default_jwt_options: dict[str, object] = {"verify_signature": True, "verify_aud": False, "verify_exp": False}
37+
default_jwt_options: Options = {"verify_signature": True, "verify_aud": False, "verify_exp": False}
3738
"""Default options for decoding JWT values."""
3839

3940
default_jwt_expiration: timedelta = NotImplemented

observability_api/endpoints/v1/project_settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class ProjectAlertsSettings(BaseEntityView):
2626
_project: Optional[Project]
2727

2828
def get_request_schema(self) -> Schema:
29-
return cast(Schema, Schema.from_dict(self.get_fields(), name=f"{self.__class__.__name__}Schema")())
29+
return Schema.from_dict(self.get_fields(), name=f"{self.__class__.__name__}Schema")() # type: ignore[arg-type]
3030

3131
@no_body_allowed
3232
def get(self, project_id: UUID) -> Response:

0 commit comments

Comments
 (0)