square-authentication 6.2.0__py3-none-any.whl → 6.2.2__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.
- square_authentication/configuration.py +6 -1
- square_authentication/routes/core.py +2 -10
- {square_authentication-6.2.0.dist-info → square_authentication-6.2.2.dist-info}/METADATA +11 -2
- {square_authentication-6.2.0.dist-info → square_authentication-6.2.2.dist-info}/RECORD +8 -8
- {square_authentication-6.2.0.dist-info → square_authentication-6.2.2.dist-info}/WHEEL +1 -1
- /square_authentication/data/{config.ini → config.sample.ini} +0 -0
- /square_authentication/data/{config.testing.ini → config.testing.sample.ini} +0 -0
- {square_authentication-6.2.0.dist-info → square_authentication-6.2.2.dist-info}/top_level.txt +0 -0
@@ -10,7 +10,12 @@ try:
|
|
10
10
|
config_file_path = os.path.join(
|
11
11
|
os.path.dirname(os.path.abspath(__file__)), "data", "config.ini"
|
12
12
|
)
|
13
|
-
|
13
|
+
config_sample_file_path = os.path.join(
|
14
|
+
os.path.dirname(os.path.abspath(__file__)), "data", "config.sample.ini"
|
15
|
+
)
|
16
|
+
ldict_configuration = ConfigReader(
|
17
|
+
config_file_path, config_sample_file_path
|
18
|
+
).read_configuration()
|
14
19
|
|
15
20
|
# get all vars and typecast
|
16
21
|
# ===========================================
|
@@ -70,11 +70,7 @@ async def register_username_v0(
|
|
70
70
|
validation
|
71
71
|
"""
|
72
72
|
# validation for username
|
73
|
-
|
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"^
|
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.
|
3
|
+
Version: 6.2.2
|
4
4
|
Summary: authentication layer for my personal server.
|
5
5
|
Home-page: https://github.com/thepmsquare/square_authentication
|
6
6
|
Author: thePmSquare
|
@@ -19,7 +19,7 @@ Requires-Dist: bcrypt>=4.1.2
|
|
19
19
|
Requires-Dist: pyjwt>=2.8.0
|
20
20
|
Requires-Dist: requests>=2.32.3
|
21
21
|
Requires-Dist: cryptography>=42.0.7
|
22
|
-
Requires-Dist: square_commons>=1.0
|
22
|
+
Requires-Dist: square_commons>=2.1.0
|
23
23
|
Requires-Dist: square_logger>=2.0.0
|
24
24
|
Requires-Dist: square_database_helper>=2.0.0
|
25
25
|
Requires-Dist: square_database_structure>=2.3.1
|
@@ -53,6 +53,15 @@ pip install square_authentication
|
|
53
53
|
|
54
54
|
## changelog
|
55
55
|
|
56
|
+
### v6.2.2
|
57
|
+
|
58
|
+
- remove config.ini and config.testing.ini from version control.
|
59
|
+
|
60
|
+
### v6.2.1
|
61
|
+
|
62
|
+
- core
|
63
|
+
- tweak validation for username in register_username_v0 and update_username_v0.
|
64
|
+
|
56
65
|
### v6.2.0
|
57
66
|
|
58
67
|
- core
|
@@ -1,19 +1,19 @@
|
|
1
1
|
square_authentication/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
square_authentication/configuration.py,sha256=
|
2
|
+
square_authentication/configuration.py,sha256=Gl7LqVZ7XZEBOsLQrhETdKjn-bgDGliXoldZGnPJaBM,4748
|
3
3
|
square_authentication/main.py,sha256=nhkv8U4E9b7VIH7Aaj8iMWIwA4VIL-vzRXjZaYEFWPw,1755
|
4
4
|
square_authentication/messages.py,sha256=WVZtWBctx-YK1xGo97DFAMkSgCZpDEd9gABBSqlvd58,1575
|
5
|
-
square_authentication/data/config.ini,sha256=Mayh9AhTBZd8i08Y--ClZuDEjJjfvnfKQmtqablzXOA,1154
|
6
|
-
square_authentication/data/config.testing.ini,sha256=KB4PMPZ6a9yJGPXYJWwKlYcNET1Au3TQdJHQyngbZUA,1201
|
5
|
+
square_authentication/data/config.sample.ini,sha256=Mayh9AhTBZd8i08Y--ClZuDEjJjfvnfKQmtqablzXOA,1154
|
6
|
+
square_authentication/data/config.testing.sample.ini,sha256=KB4PMPZ6a9yJGPXYJWwKlYcNET1Au3TQdJHQyngbZUA,1201
|
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=
|
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.
|
17
|
-
square_authentication-6.2.
|
18
|
-
square_authentication-6.2.
|
19
|
-
square_authentication-6.2.
|
16
|
+
square_authentication-6.2.2.dist-info/METADATA,sha256=uLZjXAFi-JLoYorU8XNSbM7m4p0-V07oW4w86ENOKhs,5579
|
17
|
+
square_authentication-6.2.2.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
|
18
|
+
square_authentication-6.2.2.dist-info/top_level.txt,sha256=wDssVJIl9KIEJPj5rR3rv4uRI7yCndMBrvHd_6BGXQA,22
|
19
|
+
square_authentication-6.2.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
{square_authentication-6.2.0.dist-info → square_authentication-6.2.2.dist-info}/top_level.txt
RENAMED
File without changes
|