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:
@@ -9,7 +9,7 @@ import re as _re
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, field_validator
|
||||
|
||||
_PORTFOLIO_NAME_RE = _re.compile(r"^[a-zA-Z0-9._:\-]{1,100}$")
|
||||
_PORTFOLIO_NAME_RE = _re.compile(r"^[a-zA-Z0-9가-힣 ._:\-]{1,100}$")
|
||||
|
||||
|
||||
class StrategySetResponse(BaseModel):
|
||||
@@ -90,7 +90,7 @@ class CreatePortfolioRequest(PortfolioBase):
|
||||
def validate_name(cls, v: str) -> str:
|
||||
if not _PORTFOLIO_NAME_RE.match(v):
|
||||
raise ValueError(
|
||||
f"이름은 [a-zA-Z0-9._:-] 문자만 허용하며 1~100자여야 합니다: {v!r}"
|
||||
f"이름은 한글·영문·숫자·공백·._:- 만 사용 가능하며 1~100자여야 합니다: {v!r}"
|
||||
)
|
||||
return v
|
||||
|
||||
|
||||
Reference in New Issue
Block a user