marker: tighten marker name max length from 128 to 32

128 characters was far beyond any realistic marker label (icmp, arp, tcp-syn)
and would have collided with the pcap filename budget once a tag prefix is
added later. Cap the user-facing name at 32 in both MarkerCreate and
MarkerDefinitionCreate; the compute-side name guard now also rejects names
longer than 48, which covers the `global-{def_name}` inherited form (≤ 39).
This commit is contained in:
YueGuobin committed 2026-08-05 00:49:37 +08:00
1 parent 75f278228b
commit f7b19dae99
4 files changed
+19 -3

No files matched your search

+2 -2
View File
@@ -152,7 +152,7 @@ class MarkerCreate(BaseModel):
name: Optional[str] = Field(
None,
pattern=r"^[A-Za-z0-9][A-Za-z0-9_.-]*$",
max_length=128,
max_length=32,
description='Unique marker name on the link. Auto-generated when absent.',
)
bpf: str
@@ -236,7 +236,7 @@ class MarkerDefinitionCreate(BaseModel):
name: Optional[str] = Field(
None,
pattern=r"^[A-Za-z0-9][A-Za-z0-9_.-]*$",
max_length=128,
max_length=32,
description="Unique definition name. Auto-generated when absent.",
)
bpf: str