Refuse names that are not names at the store boundary

DELETE /flows/%2e%2e reached FlowStore.delete_flow(".."), which removed
the data directory, and /flows/_lib removed every shared node. Every
path the flow and dashboard stores build from a flow, node, library or
dashboard name now goes through checked(), which raises InvalidName
(400) for anything _validate_name refuses. _validate_name uses
fullmatch, so a trailing newline is refused too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013GAeg4Jo6xjZzjwy9QDWMQ
This commit is contained in:
2026-10-06 11:59:25 +02:00
co-authored by Claude Opus 5.5
parent 48b87cc16e
commit 7ffdb1a3bf
5 changed files with 115 additions and 10 deletions
+2 -1
View File
@@ -24,7 +24,8 @@ _SPAN_SECONDS = {"s": 1, "m": 60, "h": 3600, "d": 86400}
def _validate_name(value: str) -> str:
if not NAME_PATTERN.match(value):
# fullmatch: `$` alone lets a trailing newline through.
if not NAME_PATTERN.fullmatch(value):
raise ValueError(
"Use lowercase letters, digits and underscores, starting with a letter"
)