File tree Expand file tree Collapse file tree
src/app/domain/value_objects Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99class RawPassword (ValueObject ):
1010 """raises DomainFieldError"""
1111
12- value : str
12+ MIN_LEN : ClassVar [ Final [ int ]] = 6
1313
14- MIN_LEN : Final [ ClassVar [ int ]] = 6
14+ value : str
1515
1616 def __post_init__ (self ) -> None :
1717 """:raises DomainFieldError:"""
Original file line number Diff line number Diff line change 1010class Username (ValueObject ):
1111 """raises DomainFieldError"""
1212
13- value : str
14-
15- MIN_LEN : Final [ClassVar [int ]] = 5
16- MAX_LEN : Final [ClassVar [int ]] = 20
13+ MIN_LEN : ClassVar [Final [int ]] = 5
14+ MAX_LEN : ClassVar [Final [int ]] = 20
1715
1816 # Pattern for validating a username:
1917 # - starts with a letter (A-Z, a-z) or a digit (0-9)
20- PATTERN_START : Final [ ClassVar [re .Pattern [str ]]] = re .compile (
18+ PATTERN_START : ClassVar [ Final [re .Pattern [str ]]] = re .compile (
2119 r"^[a-zA-Z0-9]" ,
2220 )
2321 # - can contain multiple special characters . - _ between letters and digits,
24- PATTERN_ALLOWED_CHARS : Final [ ClassVar [re .Pattern [str ]]] = re .compile (
22+ PATTERN_ALLOWED_CHARS : ClassVar [ Final [re .Pattern [str ]]] = re .compile (
2523 r"[a-zA-Z0-9._-]*" ,
2624 )
2725 # but only one special character can appear consecutively
28- PATTERN_NO_CONSECUTIVE_SPECIALS : Final [ ClassVar [re .Pattern [str ]]] = re .compile (
26+ PATTERN_NO_CONSECUTIVE_SPECIALS : ClassVar [ Final [re .Pattern [str ]]] = re .compile (
2927 r"^[a-zA-Z0-9]+([._-]?[a-zA-Z0-9]+)*[._-]?$" ,
3028 )
3129 # - ends with a letter (A-Z, a-z) or a digit (0-9)
32- PATTERN_END : Final [ ClassVar [re .Pattern [str ]]] = re .compile (
30+ PATTERN_END : ClassVar [ Final [re .Pattern [str ]]] = re .compile (
3331 r".*[a-zA-Z0-9]$" ,
3432 )
3533
34+ value : str
35+
3636 def __post_init__ (self ) -> None :
3737 """:raises DomainFieldError:"""
3838 super ().__post_init__ ()
You can’t perform that action at this time.
0 commit comments