This repository has been archived on 2026-10-28. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
karldns.de/karldns/routers/path_params.py
T

28 lines
676 B
Python
Raw Normal View History

2026-05-21 10:05:40 +02:00
from __future__ import annotations
from typing import Annotated
from fastapi import Path
2026-05-21 18:36:06 +02:00
TOKEN_URLSAFE_PATTERN = r"^karl_[A-Za-z0-9_-]+$"
TOKEN_MIN_LENGTH = 37
2026-05-21 10:05:40 +02:00
TOKEN_MAX_LENGTH = 128
UpdateSlugPath = Annotated[
str,
Path(
min_length=TOKEN_MIN_LENGTH,
max_length=TOKEN_MAX_LENGTH,
pattern=TOKEN_URLSAFE_PATTERN,
2026-05-21 18:36:06 +02:00
description="Private update URL value. Must start with karl_.",
2026-05-21 10:05:40 +02:00
),
]
ManagementSlugPath = Annotated[
str,
Path(
min_length=TOKEN_MIN_LENGTH,
max_length=TOKEN_MAX_LENGTH,
pattern=TOKEN_URLSAFE_PATTERN,
2026-05-21 18:36:06 +02:00
description="Private dashboard URL value. Must start with karl_.",
2026-05-21 10:05:40 +02:00
),
]