fix(typing): resolve mypy errors in schemas.controller.settings

This commit is contained in:
Mark Paronyan 2026-09-28 05:09:17 +00:00
parent 01dd09495c
commit 07dc9b4d7d
No known key found for this signature in database
GPG Key ID: 8DC7338A87FE22F8
2 changed files with 6 additions and 4 deletions

View File

@ -25,6 +25,7 @@ says, so exposing or writing it via the API would be useless at best and
a secret leak at worst.
"""
from pathlib import Path
from typing import List, Optional
from pydantic import ConfigDict, BaseModel, Field
@ -49,9 +50,11 @@ SECRET_MASK = "**********"
class ServerSettingsResponse(ServerSettings):
# plain strings instead of FilePath/DirectoryPath: paths are validated when
# the settings are loaded or updated, not when echoed back to the client
secrets_dir: Optional[str] = Field(None, description="Directory where secrets are stored (e.g. the JWT secret key)")
certfile: Optional[str] = Field(None, description="SSL certificate file, requires enable_ssl")
certkey: Optional[str] = Field(None, description="SSL key file, requires enable_ssl")
secrets_dir: Optional[Path] = Field(
None, description="Directory where secrets are stored (e.g. the JWT secret key)"
)
certfile: Optional[Path] = Field(None, description="SSL certificate file, requires enable_ssl")
certkey: Optional[Path] = Field(None, description="SSL key file, requires enable_ssl")
# Optional overrides: typed as plain "str = None" in the config schema,
# which fails re-validation when the value actually is None
resources_path: Optional[str] = Field(

View File

@ -384,7 +384,6 @@ module = [
"gns3server.schemas.compute.qemu_nodes", # 1
"gns3server.schemas.compute.virtualbox_nodes", # 2
"gns3server.schemas.controller.computes", # 6
"gns3server.schemas.controller.settings", # 3
"gns3server.schemas.controller.templates.docker_templates", # 1
"gns3server.schemas.controller.templates.iou_templates", # 1
"gns3server.schemas.controller.templates.virtualbox_templates", # 1