diff --git a/gns3server/schemas/controller/settings.py b/gns3server/schemas/controller/settings.py index d64d029e1..9925c403c 100644 --- a/gns3server/schemas/controller/settings.py +++ b/gns3server/schemas/controller/settings.py @@ -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( diff --git a/pyproject.toml b/pyproject.toml index c79072b7c..2506a25e7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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