Standardize API response envelopes: use items for collection responses and update tests
This commit is contained in:
@@ -72,12 +72,33 @@ class JailListResponse(CollectionResponse[JailSummary]):
|
||||
pass
|
||||
|
||||
|
||||
class IgnoreListResponse(CollectionResponse[str]):
|
||||
"""Response for ``GET /api/jails/{name}/ignoreip``.
|
||||
|
||||
Returns the jailed ignore list as a standard collection response.
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class JailDetailResponse(BaseModel):
|
||||
"""Response for ``GET /api/jails/{name}``."""
|
||||
"""Response for ``GET /api/jails/{name}``.
|
||||
|
||||
Includes the primary jail object together with supplemental metadata
|
||||
required by the UI.
|
||||
"""
|
||||
|
||||
model_config = ConfigDict(strict=True)
|
||||
|
||||
jail: Jail
|
||||
ignore_list: list[str] = Field(
|
||||
default_factory=list,
|
||||
description="List of IP addresses and networks currently ignored by the jail.",
|
||||
)
|
||||
ignore_self: bool = Field(
|
||||
default=False,
|
||||
description="Whether the jail ignores the server's own IP addresses.",
|
||||
)
|
||||
|
||||
|
||||
class JailCommandResponse(CommandResponse):
|
||||
|
||||
Reference in New Issue
Block a user