square-authentication 5.1.1__tar.gz → 5.1.3__tar.gz
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-5.1.1 → square_authentication-5.1.3}/PKG-INFO +10 -1
- {square_authentication-5.1.1 → square_authentication-5.1.3}/README.md +9 -0
- {square_authentication-5.1.1 → square_authentication-5.1.3}/setup.py +2 -2
- {square_authentication-5.1.1 → square_authentication-5.1.3}/square_authentication/routes/core.py +77 -61
- {square_authentication-5.1.1 → square_authentication-5.1.3}/square_authentication.egg-info/PKG-INFO +10 -1
- {square_authentication-5.1.1 → square_authentication-5.1.3}/square_authentication.egg-info/requires.txt +1 -1
- {square_authentication-5.1.1 → square_authentication-5.1.3}/setup.cfg +0 -0
- {square_authentication-5.1.1 → square_authentication-5.1.3}/square_authentication/__init__.py +0 -0
- {square_authentication-5.1.1 → square_authentication-5.1.3}/square_authentication/configuration.py +0 -0
- {square_authentication-5.1.1 → square_authentication-5.1.3}/square_authentication/data/config.ini +0 -0
- {square_authentication-5.1.1 → square_authentication-5.1.3}/square_authentication/main.py +0 -0
- {square_authentication-5.1.1 → square_authentication-5.1.3}/square_authentication/messages.py +0 -0
- {square_authentication-5.1.1 → square_authentication-5.1.3}/square_authentication/pydantic_models/__init__.py +0 -0
- {square_authentication-5.1.1 → square_authentication-5.1.3}/square_authentication/pydantic_models/core.py +0 -0
- {square_authentication-5.1.1 → square_authentication-5.1.3}/square_authentication/routes/__init__.py +0 -0
- {square_authentication-5.1.1 → square_authentication-5.1.3}/square_authentication/routes/utility.py +0 -0
- {square_authentication-5.1.1 → square_authentication-5.1.3}/square_authentication/utils/__init__.py +0 -0
- {square_authentication-5.1.1 → square_authentication-5.1.3}/square_authentication/utils/encryption.py +0 -0
- {square_authentication-5.1.1 → square_authentication-5.1.3}/square_authentication/utils/token.py +0 -0
- {square_authentication-5.1.1 → square_authentication-5.1.3}/square_authentication.egg-info/SOURCES.txt +0 -0
- {square_authentication-5.1.1 → square_authentication-5.1.3}/square_authentication.egg-info/dependency_links.txt +0 -0
- {square_authentication-5.1.1 → square_authentication-5.1.3}/square_authentication.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: square_authentication
|
3
|
-
Version: 5.1.
|
3
|
+
Version: 5.1.3
|
4
4
|
Summary: authentication layer for my personal server.
|
5
5
|
Home-page: https://github.com/thepmsquare/square_authentication
|
6
6
|
Author: thePmSquare
|
@@ -32,6 +32,15 @@ pip install square_authentication
|
|
32
32
|
|
33
33
|
## changelog
|
34
34
|
|
35
|
+
### v5.1.3
|
36
|
+
|
37
|
+
- bugfix in login_username/v0 (getting creds from correct table).
|
38
|
+
|
39
|
+
### v5.1.2
|
40
|
+
|
41
|
+
- bump square_database_structure>=2.3.1.
|
42
|
+
- change logic to read username from profile instead of credentials table.
|
43
|
+
|
35
44
|
### v5.1.1
|
36
45
|
|
37
46
|
- add logger decorator in all functions.
|
@@ -16,6 +16,15 @@ pip install square_authentication
|
|
16
16
|
|
17
17
|
## changelog
|
18
18
|
|
19
|
+
### v5.1.3
|
20
|
+
|
21
|
+
- bugfix in login_username/v0 (getting creds from correct table).
|
22
|
+
|
23
|
+
### v5.1.2
|
24
|
+
|
25
|
+
- bump square_database_structure>=2.3.1.
|
26
|
+
- change logic to read username from profile instead of credentials table.
|
27
|
+
|
19
28
|
### v5.1.1
|
20
29
|
|
21
30
|
- add logger decorator in all functions.
|
@@ -4,7 +4,7 @@ package_name = "square_authentication"
|
|
4
4
|
|
5
5
|
setup(
|
6
6
|
name=package_name,
|
7
|
-
version="5.1.
|
7
|
+
version="5.1.3",
|
8
8
|
packages=find_packages(),
|
9
9
|
package_data={
|
10
10
|
package_name: ["data/*"],
|
@@ -20,7 +20,7 @@ setup(
|
|
20
20
|
"square_commons>=1.0.0",
|
21
21
|
"square_logger>=1.0.0",
|
22
22
|
"square_database_helper>=2.0.0",
|
23
|
-
"square_database_structure>=
|
23
|
+
"square_database_structure>=2.3.1",
|
24
24
|
"pytest>=8.0.0",
|
25
25
|
"httpx>=0.27.2",
|
26
26
|
],
|
{square_authentication-5.1.1 → square_authentication-5.1.3}/square_authentication/routes/core.py
RENAMED
@@ -17,6 +17,7 @@ from square_database_structure.square.authentication.tables import (
|
|
17
17
|
UserApp,
|
18
18
|
UserCredential,
|
19
19
|
UserSession,
|
20
|
+
UserProfile,
|
20
21
|
)
|
21
22
|
from square_database_structure.square.public import (
|
22
23
|
global_string_schema_name as global_string_public_schema_name,
|
@@ -73,24 +74,35 @@ async def register_username_v0(
|
|
73
74
|
"""
|
74
75
|
validation
|
75
76
|
"""
|
76
|
-
|
77
77
|
# validation for username
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
"data"
|
91
|
-
|
92
|
-
|
93
|
-
|
78
|
+
local_list_response_user_profile = (
|
79
|
+
global_object_square_database_helper.get_rows_v0(
|
80
|
+
database_name=global_string_database_name,
|
81
|
+
schema_name=global_string_schema_name,
|
82
|
+
table_name=UserProfile.__tablename__,
|
83
|
+
filters=FiltersV0(
|
84
|
+
root={
|
85
|
+
UserProfile.user_profile_username.name: FilterConditionsV0(
|
86
|
+
eq=username
|
87
|
+
)
|
88
|
+
}
|
89
|
+
),
|
90
|
+
)["data"]["main"]
|
91
|
+
)
|
92
|
+
local_list_response_user_creds = (
|
93
|
+
global_object_square_database_helper.get_rows_v0(
|
94
|
+
database_name=global_string_database_name,
|
95
|
+
schema_name=global_string_schema_name,
|
96
|
+
table_name=UserCredential.__tablename__,
|
97
|
+
filters=FiltersV0(
|
98
|
+
root={
|
99
|
+
UserCredential.user_id.name: FilterConditionsV0(
|
100
|
+
eq=local_list_response_user_profile[0][UserProfile.user_id.name]
|
101
|
+
)
|
102
|
+
}
|
103
|
+
),
|
104
|
+
)["data"]["main"]
|
105
|
+
)
|
94
106
|
if len(local_list_response_user_creds) > 0:
|
95
107
|
output_content = get_api_output_in_standard_format(
|
96
108
|
message=messages["USERNAME_ALREADY_EXISTS"],
|
@@ -124,7 +136,6 @@ async def register_username_v0(
|
|
124
136
|
data=[
|
125
137
|
{
|
126
138
|
UserCredential.user_id.name: local_str_user_id,
|
127
|
-
UserCredential.user_credential_username.name: username,
|
128
139
|
UserCredential.user_credential_hashed_password.name: local_str_hashed_password,
|
129
140
|
}
|
130
141
|
],
|
@@ -132,6 +143,17 @@ async def register_username_v0(
|
|
132
143
|
schema_name=global_string_schema_name,
|
133
144
|
table_name=UserCredential.__tablename__,
|
134
145
|
)
|
146
|
+
global_object_square_database_helper.insert_rows_v0(
|
147
|
+
data=[
|
148
|
+
{
|
149
|
+
UserProfile.user_id.name: local_str_user_id,
|
150
|
+
UserProfile.user_profile_username.name: username,
|
151
|
+
}
|
152
|
+
],
|
153
|
+
database_name=global_string_database_name,
|
154
|
+
schema_name=global_string_schema_name,
|
155
|
+
table_name=UserProfile.__tablename__,
|
156
|
+
)
|
135
157
|
if app_id is not None:
|
136
158
|
# assign app to user
|
137
159
|
global_object_square_database_helper.insert_rows_v0(
|
@@ -278,13 +300,13 @@ async def get_user_details_v0(
|
|
278
300
|
root={UserApp.user_id.name: FilterConditionsV0(eq=user_id)}
|
279
301
|
),
|
280
302
|
)["data"]["main"]
|
281
|
-
|
303
|
+
local_list_response_user_profile = (
|
282
304
|
global_object_square_database_helper.get_rows_v0(
|
283
305
|
database_name=global_string_database_name,
|
284
306
|
schema_name=global_string_schema_name,
|
285
|
-
table_name=
|
307
|
+
table_name=UserProfile.__tablename__,
|
286
308
|
filters=FiltersV0(
|
287
|
-
root={
|
309
|
+
root={UserProfile.user_id.name: FilterConditionsV0(eq=user_id)}
|
288
310
|
),
|
289
311
|
)["data"]["main"]
|
290
312
|
)
|
@@ -309,8 +331,8 @@ async def get_user_details_v0(
|
|
309
331
|
return_this = {
|
310
332
|
"user_id": user_id,
|
311
333
|
"credentials": {
|
312
|
-
"username":
|
313
|
-
|
334
|
+
"username": local_list_response_user_profile[0][
|
335
|
+
UserProfile.user_profile_username.name
|
314
336
|
],
|
315
337
|
},
|
316
338
|
"apps": [
|
@@ -539,22 +561,20 @@ async def login_username_v0(body: LoginUsernameV0):
|
|
539
561
|
validation
|
540
562
|
"""
|
541
563
|
# validation for username
|
542
|
-
local_list_authentication_user_response =
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
"data"
|
555
|
-
|
556
|
-
"main"
|
557
|
-
]
|
564
|
+
local_list_authentication_user_response = (
|
565
|
+
global_object_square_database_helper.get_rows_v0(
|
566
|
+
database_name=global_string_database_name,
|
567
|
+
schema_name=global_string_schema_name,
|
568
|
+
table_name=UserProfile.__tablename__,
|
569
|
+
filters=FiltersV0(
|
570
|
+
root={
|
571
|
+
UserProfile.user_profile_username.name: FilterConditionsV0(
|
572
|
+
eq=username
|
573
|
+
)
|
574
|
+
}
|
575
|
+
),
|
576
|
+
)["data"]["main"]
|
577
|
+
)
|
558
578
|
if len(local_list_authentication_user_response) != 1:
|
559
579
|
output_content = get_api_output_in_standard_format(
|
560
580
|
message=messages["INCORRECT_USERNAME"],
|
@@ -840,9 +860,7 @@ async def logout_v0(
|
|
840
860
|
)
|
841
861
|
# validating if the refresh token is valid, active and of the same user.
|
842
862
|
try:
|
843
|
-
|
844
|
-
refresh_token, config_str_secret_key_for_refresh_token
|
845
|
-
)
|
863
|
+
_ = get_jwt_payload(refresh_token, config_str_secret_key_for_refresh_token)
|
846
864
|
except Exception as error:
|
847
865
|
output_content = get_api_output_in_standard_format(
|
848
866
|
message=messages["INCORRECT_REFRESH_TOKEN"],
|
@@ -1102,22 +1120,20 @@ async def update_username_v0(
|
|
1102
1120
|
)
|
1103
1121
|
|
1104
1122
|
# validate new username
|
1105
|
-
local_list_user_credentials_response =
|
1106
|
-
|
1107
|
-
|
1108
|
-
|
1109
|
-
|
1110
|
-
|
1111
|
-
|
1112
|
-
|
1113
|
-
|
1114
|
-
|
1115
|
-
|
1116
|
-
|
1117
|
-
"data"
|
1118
|
-
|
1119
|
-
"main"
|
1120
|
-
]
|
1123
|
+
local_list_user_credentials_response = (
|
1124
|
+
global_object_square_database_helper.get_rows_v0(
|
1125
|
+
database_name=global_string_database_name,
|
1126
|
+
schema_name=global_string_schema_name,
|
1127
|
+
table_name=UserProfile.__tablename__,
|
1128
|
+
filters=FiltersV0(
|
1129
|
+
root={
|
1130
|
+
UserProfile.user_profile_username.name: FilterConditionsV0(
|
1131
|
+
eq=new_username
|
1132
|
+
),
|
1133
|
+
}
|
1134
|
+
),
|
1135
|
+
)["data"]["main"]
|
1136
|
+
)
|
1121
1137
|
if len(local_list_user_credentials_response) != 0:
|
1122
1138
|
output_content = get_api_output_in_standard_format(
|
1123
1139
|
message=messages["USERNAME_ALREADY_EXISTS"],
|
@@ -1134,14 +1150,14 @@ async def update_username_v0(
|
|
1134
1150
|
global_object_square_database_helper.edit_rows_v0(
|
1135
1151
|
database_name=global_string_database_name,
|
1136
1152
|
schema_name=global_string_schema_name,
|
1137
|
-
table_name=
|
1153
|
+
table_name=UserProfile.__tablename__,
|
1138
1154
|
filters=FiltersV0(
|
1139
1155
|
root={
|
1140
|
-
|
1156
|
+
UserProfile.user_id.name: FilterConditionsV0(eq=user_id),
|
1141
1157
|
}
|
1142
1158
|
),
|
1143
1159
|
data={
|
1144
|
-
|
1160
|
+
UserProfile.user_profile_username.name: new_username,
|
1145
1161
|
},
|
1146
1162
|
)
|
1147
1163
|
"""
|
{square_authentication-5.1.1 → square_authentication-5.1.3}/square_authentication.egg-info/PKG-INFO
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: square-authentication
|
3
|
-
Version: 5.1.
|
3
|
+
Version: 5.1.3
|
4
4
|
Summary: authentication layer for my personal server.
|
5
5
|
Home-page: https://github.com/thepmsquare/square_authentication
|
6
6
|
Author: thePmSquare
|
@@ -32,6 +32,15 @@ pip install square_authentication
|
|
32
32
|
|
33
33
|
## changelog
|
34
34
|
|
35
|
+
### v5.1.3
|
36
|
+
|
37
|
+
- bugfix in login_username/v0 (getting creds from correct table).
|
38
|
+
|
39
|
+
### v5.1.2
|
40
|
+
|
41
|
+
- bump square_database_structure>=2.3.1.
|
42
|
+
- change logic to read username from profile instead of credentials table.
|
43
|
+
|
35
44
|
### v5.1.1
|
36
45
|
|
37
46
|
- add logger decorator in all functions.
|
File without changes
|
{square_authentication-5.1.1 → square_authentication-5.1.3}/square_authentication/__init__.py
RENAMED
File without changes
|
{square_authentication-5.1.1 → square_authentication-5.1.3}/square_authentication/configuration.py
RENAMED
File without changes
|
{square_authentication-5.1.1 → square_authentication-5.1.3}/square_authentication/data/config.ini
RENAMED
File without changes
|
File without changes
|
{square_authentication-5.1.1 → square_authentication-5.1.3}/square_authentication/messages.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{square_authentication-5.1.1 → square_authentication-5.1.3}/square_authentication/routes/__init__.py
RENAMED
File without changes
|
{square_authentication-5.1.1 → square_authentication-5.1.3}/square_authentication/routes/utility.py
RENAMED
File without changes
|
{square_authentication-5.1.1 → square_authentication-5.1.3}/square_authentication/utils/__init__.py
RENAMED
File without changes
|
File without changes
|
{square_authentication-5.1.1 → square_authentication-5.1.3}/square_authentication/utils/token.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|