square-authentication 6.2.0__py3-none-any.whl → 6.2.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -70,11 +70,7 @@ async def register_username_v0(
70
70
  validation
71
71
  """
72
72
  # validation for username
73
- # ^(?!.*[_-]{2}) # no consecutive _ or -
74
- # [a-z] # must start with a lowercase letter
75
- # (?:[a-z0-9_-]{1,18}) # 1–18 of lowercase, digits, _ or -
76
- # [a-z]$ # must end with a lowercase letter
77
- username_pattern = re.compile(r"^(?!.*[._-]{2})[a-z][a-z0-9_-]{1,18}[a-z]$")
73
+ username_pattern = re.compile(r"^[a-z0-9._-]{2,20}$")
78
74
  if not username_pattern.match(username):
79
75
  output_content = get_api_output_in_standard_format(
80
76
  message=messages["USERNAME_INVALID"],
@@ -1118,12 +1114,8 @@ async def update_username_v0(
1118
1114
  user_id = local_dict_access_token_payload["user_id"]
1119
1115
 
1120
1116
  # validation for username
1121
- # ^(?!.*[_-]{2}) # no consecutive _ or -
1122
- # [a-z] # must start with a lowercase letter
1123
- # (?:[a-z0-9_-]{1,18}) # 1–18 of lowercase, digits, _ or -
1124
- # [a-z]$ # must end with a lowercase letter
1125
1117
  new_username = new_username.lower()
1126
- username_pattern = re.compile(r"^(?!.*[._-]{2})[a-z][a-z0-9_-]{1,18}[a-z]$")
1118
+ username_pattern = re.compile(r"^[a-z0-9._-]{2,20}$")
1127
1119
  if not username_pattern.match(new_username):
1128
1120
  output_content = get_api_output_in_standard_format(
1129
1121
  message=messages["USERNAME_INVALID"],
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: square_authentication
3
- Version: 6.2.0
3
+ Version: 6.2.1
4
4
  Summary: authentication layer for my personal server.
5
5
  Home-page: https://github.com/thepmsquare/square_authentication
6
6
  Author: thePmSquare
@@ -53,6 +53,11 @@ pip install square_authentication
53
53
 
54
54
  ## changelog
55
55
 
56
+ ### v6.2.1
57
+
58
+ - core
59
+ - tweak validation for username in register_username_v0 and update_username_v0.
60
+
56
61
  ### v6.2.0
57
62
 
58
63
  - core
@@ -7,13 +7,13 @@ square_authentication/data/config.testing.ini,sha256=KB4PMPZ6a9yJGPXYJWwKlYcNET1
7
7
  square_authentication/pydantic_models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
8
  square_authentication/pydantic_models/core.py,sha256=qeNETcJv7mnRKGhATOW2bg0NlHuyzvot1dZ1b1qqhwU,610
9
9
  square_authentication/routes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
- square_authentication/routes/core.py,sha256=ibkNyYIDTt20P9I-H-Y9674vGHzeRIqWNnGr3Ow2VS4,64432
10
+ square_authentication/routes/core.py,sha256=7KqTA3y6CedH7XelV2HBCkne4Bql9p31OzSeioguhE0,63838
11
11
  square_authentication/routes/profile.py,sha256=3b-PtMaD9cxvf112MOn9rPu5F2KG4sRxAbuPvll8dUU,6216
12
12
  square_authentication/routes/utility.py,sha256=KDr8KdkT0jAGPjfP-b5XXYG7p49WU7J1FiK6oSIckQI,1779
13
13
  square_authentication/utils/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
14
14
  square_authentication/utils/encryption.py,sha256=WakaiEAgWpTJltxBzqOtv81_DCDKfzJqt60fWSPoNvo,2027
15
15
  square_authentication/utils/token.py,sha256=t-RPBY4cYyT1ro3lkLBTOy2BeRGBfluBVBivL5DLmDg,680
16
- square_authentication-6.2.0.dist-info/METADATA,sha256=37LOBkSBmItsK4nqZ1MsXdZMisbREl29U7Klz9OedR4,5397
17
- square_authentication-6.2.0.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
18
- square_authentication-6.2.0.dist-info/top_level.txt,sha256=wDssVJIl9KIEJPj5rR3rv4uRI7yCndMBrvHd_6BGXQA,22
19
- square_authentication-6.2.0.dist-info/RECORD,,
16
+ square_authentication-6.2.1.dist-info/METADATA,sha256=Fm26I8AcPJiMOGrzo-P3vwIbuw3W7rEsXwtqEpub5FY,5499
17
+ square_authentication-6.2.1.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
18
+ square_authentication-6.2.1.dist-info/top_level.txt,sha256=wDssVJIl9KIEJPj5rR3rv4uRI7yCndMBrvHd_6BGXQA,22
19
+ square_authentication-6.2.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.7.1)
2
+ Generator: setuptools (80.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5