fix(portfolio): name 검증에 한글+공백 허용 (minor-change, CHG-20260627-03)
_PORTFOLIO_NAME_RE + CLI _NAME_RE를 ^[a-zA-Z0-9가-힣 ._:-]{1,100}$로 완화. name은 (owner,name) 조회 키일 뿐 wire 식별자 아님. 475 passed.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
This commit is contained in:
@@ -22,7 +22,7 @@ from app.schemas.portfolio import (
|
||||
)
|
||||
from app.services.portfolio_service import PortfolioService
|
||||
|
||||
_NAME_RE = re.compile(r"^[a-zA-Z0-9._:\-]{1,100}$")
|
||||
_NAME_RE = re.compile(r"^[a-zA-Z0-9가-힣 ._:\-]{1,100}$")
|
||||
|
||||
portfolio_app = typer.Typer(help="Portfolio lifecycle and trade commands.")
|
||||
comment_app = typer.Typer(help="Portfolio comment history commands.")
|
||||
@@ -72,7 +72,7 @@ def _confirm(force: bool, message: str) -> None:
|
||||
|
||||
def _validate_portfolio_name(name: str, ctx_console=None) -> None:
|
||||
if not _NAME_RE.match(name):
|
||||
msg = f"유효하지 않은 이름입니다: {name!r} — [a-zA-Z0-9._:-] 문자만 허용하며 1~100자여야 합니다."
|
||||
msg = f"유효하지 않은 이름입니다: {name!r} — 한글·영문·숫자·공백·._:- 만 허용하며 1~100자여야 합니다."
|
||||
if ctx_console is not None:
|
||||
ctx_console.print(f"Error: {msg}")
|
||||
raise typer.Exit(code=1)
|
||||
|
||||
Reference in New Issue
Block a user