square-authentication 5.1.1__tar.gz → 5.1.2__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.2}/PKG-INFO +6 -1
- {square_authentication-5.1.1 → square_authentication-5.1.2}/README.md +5 -0
- {square_authentication-5.1.1 → square_authentication-5.1.2}/setup.py +2 -2
- {square_authentication-5.1.1 → square_authentication-5.1.2}/square_authentication/routes/core.py +63 -60
- {square_authentication-5.1.1 → square_authentication-5.1.2}/square_authentication.egg-info/PKG-INFO +6 -1
- {square_authentication-5.1.1 → square_authentication-5.1.2}/square_authentication.egg-info/requires.txt +1 -1
- {square_authentication-5.1.1 → square_authentication-5.1.2}/setup.cfg +0 -0
- {square_authentication-5.1.1 → square_authentication-5.1.2}/square_authentication/__init__.py +0 -0
- {square_authentication-5.1.1 → square_authentication-5.1.2}/square_authentication/configuration.py +0 -0
- {square_authentication-5.1.1 → square_authentication-5.1.2}/square_authentication/data/config.ini +0 -0
- {square_authentication-5.1.1 → square_authentication-5.1.2}/square_authentication/main.py +0 -0
- {square_authentication-5.1.1 → square_authentication-5.1.2}/square_authentication/messages.py +0 -0
- {square_authentication-5.1.1 → square_authentication-5.1.2}/square_authentication/pydantic_models/__init__.py +0 -0
- {square_authentication-5.1.1 → square_authentication-5.1.2}/square_authentication/pydantic_models/core.py +0 -0
- {square_authentication-5.1.1 → square_authentication-5.1.2}/square_authentication/routes/__init__.py +0 -0
- {square_authentication-5.1.1 → square_authentication-5.1.2}/square_authentication/routes/utility.py +0 -0
- {square_authentication-5.1.1 → square_authentication-5.1.2}/square_authentication/utils/__init__.py +0 -0
- {square_authentication-5.1.1 → square_authentication-5.1.2}/square_authentication/utils/encryption.py +0 -0
- {square_authentication-5.1.1 → square_authentication-5.1.2}/square_authentication/utils/token.py +0 -0
- {square_authentication-5.1.1 → square_authentication-5.1.2}/square_authentication.egg-info/SOURCES.txt +0 -0
- {square_authentication-5.1.1 → square_authentication-5.1.2}/square_authentication.egg-info/dependency_links.txt +0 -0
- {square_authentication-5.1.1 → square_authentication-5.1.2}/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.2
|
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,11 @@ pip install square_authentication
|
|
32
32
|
|
33
33
|
## changelog
|
34
34
|
|
35
|
+
### v5.1.2
|
36
|
+
|
37
|
+
- bump square_database_structure>=2.3.1.
|
38
|
+
- change logic to read username from profile instead of credentials table.
|
39
|
+
|
35
40
|
### v5.1.1
|
36
41
|
|
37
42
|
- add logger decorator in all functions.
|
@@ -16,6 +16,11 @@ pip install square_authentication
|
|
16
16
|
|
17
17
|
## changelog
|
18
18
|
|
19
|
+
### v5.1.2
|
20
|
+
|
21
|
+
- bump square_database_structure>=2.3.1.
|
22
|
+
- change logic to read username from profile instead of credentials table.
|
23
|
+
|
19
24
|
### v5.1.1
|
20
25
|
|
21
26
|
- 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.2",
|
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.2}/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,
|
@@ -75,22 +76,20 @@ async def register_username_v0(
|
|
75
76
|
"""
|
76
77
|
|
77
78
|
# validation for username
|
78
|
-
local_list_response_user_creds =
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
"data"
|
91
|
-
|
92
|
-
"main"
|
93
|
-
]
|
79
|
+
local_list_response_user_creds = (
|
80
|
+
global_object_square_database_helper.get_rows_v0(
|
81
|
+
database_name=global_string_database_name,
|
82
|
+
schema_name=global_string_schema_name,
|
83
|
+
table_name=UserProfile.__tablename__,
|
84
|
+
filters=FiltersV0(
|
85
|
+
root={
|
86
|
+
UserProfile.user_profile_username.name: FilterConditionsV0(
|
87
|
+
eq=username
|
88
|
+
)
|
89
|
+
}
|
90
|
+
),
|
91
|
+
)["data"]["main"]
|
92
|
+
)
|
94
93
|
if len(local_list_response_user_creds) > 0:
|
95
94
|
output_content = get_api_output_in_standard_format(
|
96
95
|
message=messages["USERNAME_ALREADY_EXISTS"],
|
@@ -124,7 +123,6 @@ async def register_username_v0(
|
|
124
123
|
data=[
|
125
124
|
{
|
126
125
|
UserCredential.user_id.name: local_str_user_id,
|
127
|
-
UserCredential.user_credential_username.name: username,
|
128
126
|
UserCredential.user_credential_hashed_password.name: local_str_hashed_password,
|
129
127
|
}
|
130
128
|
],
|
@@ -132,6 +130,17 @@ async def register_username_v0(
|
|
132
130
|
schema_name=global_string_schema_name,
|
133
131
|
table_name=UserCredential.__tablename__,
|
134
132
|
)
|
133
|
+
global_object_square_database_helper.insert_rows_v0(
|
134
|
+
data=[
|
135
|
+
{
|
136
|
+
UserProfile.user_id.name: local_str_user_id,
|
137
|
+
UserProfile.user_profile_username.name: username,
|
138
|
+
}
|
139
|
+
],
|
140
|
+
database_name=global_string_database_name,
|
141
|
+
schema_name=global_string_schema_name,
|
142
|
+
table_name=UserProfile.__tablename__,
|
143
|
+
)
|
135
144
|
if app_id is not None:
|
136
145
|
# assign app to user
|
137
146
|
global_object_square_database_helper.insert_rows_v0(
|
@@ -278,13 +287,13 @@ async def get_user_details_v0(
|
|
278
287
|
root={UserApp.user_id.name: FilterConditionsV0(eq=user_id)}
|
279
288
|
),
|
280
289
|
)["data"]["main"]
|
281
|
-
|
290
|
+
local_list_response_user_profile = (
|
282
291
|
global_object_square_database_helper.get_rows_v0(
|
283
292
|
database_name=global_string_database_name,
|
284
293
|
schema_name=global_string_schema_name,
|
285
|
-
table_name=
|
294
|
+
table_name=UserProfile.__tablename__,
|
286
295
|
filters=FiltersV0(
|
287
|
-
root={
|
296
|
+
root={UserProfile.user_id.name: FilterConditionsV0(eq=user_id)}
|
288
297
|
),
|
289
298
|
)["data"]["main"]
|
290
299
|
)
|
@@ -309,8 +318,8 @@ async def get_user_details_v0(
|
|
309
318
|
return_this = {
|
310
319
|
"user_id": user_id,
|
311
320
|
"credentials": {
|
312
|
-
"username":
|
313
|
-
|
321
|
+
"username": local_list_response_user_profile[0][
|
322
|
+
UserProfile.user_profile_username.name
|
314
323
|
],
|
315
324
|
},
|
316
325
|
"apps": [
|
@@ -539,22 +548,20 @@ async def login_username_v0(body: LoginUsernameV0):
|
|
539
548
|
validation
|
540
549
|
"""
|
541
550
|
# 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
|
-
]
|
551
|
+
local_list_authentication_user_response = (
|
552
|
+
global_object_square_database_helper.get_rows_v0(
|
553
|
+
database_name=global_string_database_name,
|
554
|
+
schema_name=global_string_schema_name,
|
555
|
+
table_name=UserProfile.__tablename__,
|
556
|
+
filters=FiltersV0(
|
557
|
+
root={
|
558
|
+
UserProfile.user_profile_username.name: FilterConditionsV0(
|
559
|
+
eq=username
|
560
|
+
)
|
561
|
+
}
|
562
|
+
),
|
563
|
+
)["data"]["main"]
|
564
|
+
)
|
558
565
|
if len(local_list_authentication_user_response) != 1:
|
559
566
|
output_content = get_api_output_in_standard_format(
|
560
567
|
message=messages["INCORRECT_USERNAME"],
|
@@ -840,9 +847,7 @@ async def logout_v0(
|
|
840
847
|
)
|
841
848
|
# validating if the refresh token is valid, active and of the same user.
|
842
849
|
try:
|
843
|
-
|
844
|
-
refresh_token, config_str_secret_key_for_refresh_token
|
845
|
-
)
|
850
|
+
_ = get_jwt_payload(refresh_token, config_str_secret_key_for_refresh_token)
|
846
851
|
except Exception as error:
|
847
852
|
output_content = get_api_output_in_standard_format(
|
848
853
|
message=messages["INCORRECT_REFRESH_TOKEN"],
|
@@ -1102,22 +1107,20 @@ async def update_username_v0(
|
|
1102
1107
|
)
|
1103
1108
|
|
1104
1109
|
# 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
|
-
]
|
1110
|
+
local_list_user_credentials_response = (
|
1111
|
+
global_object_square_database_helper.get_rows_v0(
|
1112
|
+
database_name=global_string_database_name,
|
1113
|
+
schema_name=global_string_schema_name,
|
1114
|
+
table_name=UserProfile.__tablename__,
|
1115
|
+
filters=FiltersV0(
|
1116
|
+
root={
|
1117
|
+
UserProfile.user_profile_username.name: FilterConditionsV0(
|
1118
|
+
eq=new_username
|
1119
|
+
),
|
1120
|
+
}
|
1121
|
+
),
|
1122
|
+
)["data"]["main"]
|
1123
|
+
)
|
1121
1124
|
if len(local_list_user_credentials_response) != 0:
|
1122
1125
|
output_content = get_api_output_in_standard_format(
|
1123
1126
|
message=messages["USERNAME_ALREADY_EXISTS"],
|
@@ -1134,14 +1137,14 @@ async def update_username_v0(
|
|
1134
1137
|
global_object_square_database_helper.edit_rows_v0(
|
1135
1138
|
database_name=global_string_database_name,
|
1136
1139
|
schema_name=global_string_schema_name,
|
1137
|
-
table_name=
|
1140
|
+
table_name=UserProfile.__tablename__,
|
1138
1141
|
filters=FiltersV0(
|
1139
1142
|
root={
|
1140
|
-
|
1143
|
+
UserProfile.user_id.name: FilterConditionsV0(eq=user_id),
|
1141
1144
|
}
|
1142
1145
|
),
|
1143
1146
|
data={
|
1144
|
-
|
1147
|
+
UserProfile.user_profile_username.name: new_username,
|
1145
1148
|
},
|
1146
1149
|
)
|
1147
1150
|
"""
|
{square_authentication-5.1.1 → square_authentication-5.1.2}/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.2
|
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,11 @@ pip install square_authentication
|
|
32
32
|
|
33
33
|
## changelog
|
34
34
|
|
35
|
+
### v5.1.2
|
36
|
+
|
37
|
+
- bump square_database_structure>=2.3.1.
|
38
|
+
- change logic to read username from profile instead of credentials table.
|
39
|
+
|
35
40
|
### v5.1.1
|
36
41
|
|
37
42
|
- add logger decorator in all functions.
|
File without changes
|
{square_authentication-5.1.1 → square_authentication-5.1.2}/square_authentication/__init__.py
RENAMED
File without changes
|
{square_authentication-5.1.1 → square_authentication-5.1.2}/square_authentication/configuration.py
RENAMED
File without changes
|
{square_authentication-5.1.1 → square_authentication-5.1.2}/square_authentication/data/config.ini
RENAMED
File without changes
|
File without changes
|
{square_authentication-5.1.1 → square_authentication-5.1.2}/square_authentication/messages.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{square_authentication-5.1.1 → square_authentication-5.1.2}/square_authentication/routes/__init__.py
RENAMED
File without changes
|
{square_authentication-5.1.1 → square_authentication-5.1.2}/square_authentication/routes/utility.py
RENAMED
File without changes
|
{square_authentication-5.1.1 → square_authentication-5.1.2}/square_authentication/utils/__init__.py
RENAMED
File without changes
|
File without changes
|
{square_authentication-5.1.1 → square_authentication-5.1.2}/square_authentication/utils/token.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|