square-authentication 5.1.4__py3-none-any.whl → 5.1.5__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/main.py +1 -1
- square_authentication/routes/core.py +15 -13
- square_authentication/routes/utility.py +1 -1
- square_authentication/utils/encryption.py +2 -2
- square_authentication/utils/token.py +1 -1
- {square_authentication-5.1.4.dist-info → square_authentication-5.1.5.dist-info}/METADATA +19 -11
- {square_authentication-5.1.4.dist-info → square_authentication-5.1.5.dist-info}/RECORD +9 -9
- {square_authentication-5.1.4.dist-info → square_authentication-5.1.5.dist-info}/WHEEL +1 -1
- {square_authentication-5.1.4.dist-info → square_authentication-5.1.5.dist-info}/top_level.txt +0 -0
square_authentication/main.py
CHANGED
@@ -31,7 +31,7 @@ app.include_router(utility.router)
|
|
31
31
|
|
32
32
|
|
33
33
|
@app.get("/")
|
34
|
-
@global_object_square_logger.
|
34
|
+
@global_object_square_logger.auto_logger()
|
35
35
|
async def root():
|
36
36
|
output_content = get_api_output_in_standard_format(log=config_str_module_name)
|
37
37
|
return JSONResponse(status_code=status.HTTP_200_OK, content=output_content)
|
@@ -57,7 +57,7 @@ global_object_square_database_helper = SquareDatabaseHelper(
|
|
57
57
|
|
58
58
|
|
59
59
|
@router.post("/register_username/v0")
|
60
|
-
@global_object_square_logger.
|
60
|
+
@global_object_square_logger.auto_logger()
|
61
61
|
async def register_username_v0(
|
62
62
|
body: RegisterUsernameV0,
|
63
63
|
):
|
@@ -246,7 +246,7 @@ async def register_username_v0(
|
|
246
246
|
|
247
247
|
|
248
248
|
@router.get("/get_user_details/v0")
|
249
|
-
@global_object_square_logger.
|
249
|
+
@global_object_square_logger.auto_logger()
|
250
250
|
async def get_user_details_v0(
|
251
251
|
access_token: Annotated[str, Header()],
|
252
252
|
):
|
@@ -374,7 +374,7 @@ async def get_user_details_v0(
|
|
374
374
|
|
375
375
|
|
376
376
|
@router.patch("/update_user_app_ids/v0")
|
377
|
-
@global_object_square_logger.
|
377
|
+
@global_object_square_logger.auto_logger()
|
378
378
|
async def update_user_app_ids_v0(
|
379
379
|
access_token: Annotated[str, Header()],
|
380
380
|
app_ids_to_add: List[int],
|
@@ -535,7 +535,7 @@ async def update_user_app_ids_v0(
|
|
535
535
|
|
536
536
|
|
537
537
|
@router.post("/login_username/v0")
|
538
|
-
@global_object_square_logger.
|
538
|
+
@global_object_square_logger.auto_logger()
|
539
539
|
async def login_username_v0(body: LoginUsernameV0):
|
540
540
|
username = body.username
|
541
541
|
password = body.password
|
@@ -578,7 +578,9 @@ async def login_username_v0(body: LoginUsernameV0):
|
|
578
578
|
filters=FiltersV0(
|
579
579
|
root={
|
580
580
|
UserCredential.user_id.name: FilterConditionsV0(
|
581
|
-
eq=local_list_response_user_profile[0][
|
581
|
+
eq=local_list_response_user_profile[0][
|
582
|
+
UserProfile.user_id.name
|
583
|
+
]
|
582
584
|
)
|
583
585
|
}
|
584
586
|
),
|
@@ -742,7 +744,7 @@ async def login_username_v0(body: LoginUsernameV0):
|
|
742
744
|
|
743
745
|
|
744
746
|
@router.get("/generate_access_token/v0")
|
745
|
-
@global_object_square_logger.
|
747
|
+
@global_object_square_logger.auto_logger()
|
746
748
|
async def generate_access_token_v0(
|
747
749
|
refresh_token: Annotated[str, Header()],
|
748
750
|
):
|
@@ -833,7 +835,7 @@ async def generate_access_token_v0(
|
|
833
835
|
|
834
836
|
|
835
837
|
@router.delete("/logout/v0")
|
836
|
-
@global_object_square_logger.
|
838
|
+
@global_object_square_logger.auto_logger()
|
837
839
|
async def logout_v0(
|
838
840
|
refresh_token: Annotated[str, Header()],
|
839
841
|
):
|
@@ -925,7 +927,7 @@ async def logout_v0(
|
|
925
927
|
|
926
928
|
|
927
929
|
@router.delete("/logout/apps/v0")
|
928
|
-
@global_object_square_logger.
|
930
|
+
@global_object_square_logger.auto_logger()
|
929
931
|
async def logout_apps_v0(
|
930
932
|
access_token: Annotated[str, Header()],
|
931
933
|
body: LogoutAppsV0,
|
@@ -1018,7 +1020,7 @@ async def logout_apps_v0(
|
|
1018
1020
|
|
1019
1021
|
|
1020
1022
|
@router.delete("/logout/all/v0")
|
1021
|
-
@global_object_square_logger.
|
1023
|
+
@global_object_square_logger.auto_logger()
|
1022
1024
|
async def logout_all_v0(
|
1023
1025
|
access_token: Annotated[str, Header()],
|
1024
1026
|
):
|
@@ -1082,7 +1084,7 @@ async def logout_all_v0(
|
|
1082
1084
|
|
1083
1085
|
|
1084
1086
|
@router.patch("/update_username/v0")
|
1085
|
-
@global_object_square_logger.
|
1087
|
+
@global_object_square_logger.auto_logger()
|
1086
1088
|
async def update_username_v0(
|
1087
1089
|
new_username: str,
|
1088
1090
|
access_token: Annotated[str, Header()],
|
@@ -1197,7 +1199,7 @@ async def update_username_v0(
|
|
1197
1199
|
|
1198
1200
|
|
1199
1201
|
@router.delete("/delete_user/v0")
|
1200
|
-
@global_object_square_logger.
|
1202
|
+
@global_object_square_logger.auto_logger()
|
1201
1203
|
async def delete_user_v0(
|
1202
1204
|
body: DeleteUserV0,
|
1203
1205
|
access_token: Annotated[str, Header()],
|
@@ -1303,7 +1305,7 @@ async def delete_user_v0(
|
|
1303
1305
|
|
1304
1306
|
|
1305
1307
|
@router.patch("/update_password/v0")
|
1306
|
-
@global_object_square_logger.
|
1308
|
+
@global_object_square_logger.auto_logger()
|
1307
1309
|
async def update_password_v0(
|
1308
1310
|
body: UpdatePasswordV0,
|
1309
1311
|
access_token: Annotated[str, Header()],
|
@@ -1416,7 +1418,7 @@ async def update_password_v0(
|
|
1416
1418
|
|
1417
1419
|
|
1418
1420
|
@router.get("/validate_and_get_payload_from_token/v0")
|
1419
|
-
@global_object_square_logger.
|
1421
|
+
@global_object_square_logger.auto_logger()
|
1420
1422
|
async def validate_and_get_payload_from_token_v0(
|
1421
1423
|
token: Annotated[str, Header()],
|
1422
1424
|
token_type: TokenType = Query(...),
|
@@ -7,7 +7,7 @@ from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
|
|
7
7
|
from square_authentication.configuration import global_object_square_logger
|
8
8
|
|
9
9
|
|
10
|
-
@global_object_square_logger.auto_logger
|
10
|
+
@global_object_square_logger.auto_logger()
|
11
11
|
def encrypt(key, plaintext):
|
12
12
|
# Ensure the key length is 16, 24, or 32 bytes for AES
|
13
13
|
key = key.ljust(32)[:32].encode('utf-8')
|
@@ -31,7 +31,7 @@ def encrypt(key, plaintext):
|
|
31
31
|
|
32
32
|
return encoded_ciphertext
|
33
33
|
|
34
|
-
@global_object_square_logger.auto_logger
|
34
|
+
@global_object_square_logger.auto_logger()
|
35
35
|
def decrypt(key, encoded_ciphertext):
|
36
36
|
# Ensure the key length is 16, 24, or 32 bytes for AES
|
37
37
|
key = key.ljust(32)[:32].encode('utf-8')
|
@@ -4,7 +4,7 @@ from jwt.exceptions import ExpiredSignatureError, DecodeError, InvalidTokenError
|
|
4
4
|
from square_authentication.configuration import global_object_square_logger
|
5
5
|
|
6
6
|
|
7
|
-
@global_object_square_logger.auto_logger
|
7
|
+
@global_object_square_logger.auto_logger()
|
8
8
|
def get_jwt_payload(token, secret_key):
|
9
9
|
try:
|
10
10
|
# Decode the token and verify the signature
|
@@ -1,12 +1,10 @@
|
|
1
|
-
Metadata-Version: 2.
|
2
|
-
Name:
|
3
|
-
Version: 5.1.
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: square_authentication
|
3
|
+
Version: 5.1.5
|
4
4
|
Summary: authentication layer for my personal server.
|
5
5
|
Home-page: https://github.com/thepmsquare/square_authentication
|
6
6
|
Author: thePmSquare
|
7
7
|
Author-email: thepmsquare@gmail.com
|
8
|
-
License: UNKNOWN
|
9
|
-
Platform: UNKNOWN
|
10
8
|
Classifier: Development Status :: 3 - Alpha
|
11
9
|
Classifier: Intended Audience :: Developers
|
12
10
|
Classifier: License :: OSI Approved :: MIT License
|
@@ -20,12 +18,20 @@ Requires-Dist: bcrypt>=4.1.2
|
|
20
18
|
Requires-Dist: pyjwt>=2.8.0
|
21
19
|
Requires-Dist: requests>=2.32.3
|
22
20
|
Requires-Dist: cryptography>=42.0.7
|
23
|
-
Requires-Dist:
|
24
|
-
Requires-Dist:
|
25
|
-
Requires-Dist:
|
26
|
-
Requires-Dist:
|
21
|
+
Requires-Dist: square_commons>=1.0.0
|
22
|
+
Requires-Dist: square_logger>=2.0.0
|
23
|
+
Requires-Dist: square_database_helper>=2.0.0
|
24
|
+
Requires-Dist: square_database_structure>=2.3.1
|
27
25
|
Requires-Dist: pytest>=8.0.0
|
28
26
|
Requires-Dist: httpx>=0.27.2
|
27
|
+
Dynamic: author
|
28
|
+
Dynamic: author-email
|
29
|
+
Dynamic: classifier
|
30
|
+
Dynamic: description
|
31
|
+
Dynamic: description-content-type
|
32
|
+
Dynamic: home-page
|
33
|
+
Dynamic: requires-dist
|
34
|
+
Dynamic: summary
|
29
35
|
|
30
36
|
# square_authentication
|
31
37
|
|
@@ -45,6 +51,10 @@ pip install square_authentication
|
|
45
51
|
|
46
52
|
## changelog
|
47
53
|
|
54
|
+
### v5.1.5
|
55
|
+
|
56
|
+
- bump square_logger to >=2.0.0.
|
57
|
+
|
48
58
|
### v5.1.4
|
49
59
|
|
50
60
|
- re bug fix v5.1.3
|
@@ -152,5 +162,3 @@ pip install square_authentication
|
|
152
162
|
- initial implementation.
|
153
163
|
|
154
164
|
## Feedback is appreciated. Thank you!
|
155
|
-
|
156
|
-
|
@@ -1,17 +1,17 @@
|
|
1
1
|
square_authentication/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
2
|
square_authentication/configuration.py,sha256=i0uNtNSQd-n1rBxFM6jsIz1Wy3d090RcdTViSqHKc7Y,2973
|
3
|
-
square_authentication/main.py,sha256=
|
3
|
+
square_authentication/main.py,sha256=zP8Affuljk1m7fsRSa1WG8KP0xdcVgOvA-62bWlLe4s,1660
|
4
4
|
square_authentication/messages.py,sha256=BA9KC0vW9UD1ZXT4VneVqVNLlgdbMdsAwAgxhJISLf4,1175
|
5
5
|
square_authentication/data/config.ini,sha256=_740RvKpL5W2bUDGwZ7ePwuP-mAasr5cXXB81yq_Jv8,906
|
6
6
|
square_authentication/pydantic_models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
7
7
|
square_authentication/pydantic_models/core.py,sha256=qeNETcJv7mnRKGhATOW2bg0NlHuyzvot1dZ1b1qqhwU,610
|
8
8
|
square_authentication/routes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
9
|
-
square_authentication/routes/core.py,sha256=
|
10
|
-
square_authentication/routes/utility.py,sha256=
|
9
|
+
square_authentication/routes/core.py,sha256=nfATWJ3NWQkCe9gmMhJIh1lsdxmiCQ1OL3HoqIhFd88,57195
|
10
|
+
square_authentication/routes/utility.py,sha256=KDr8KdkT0jAGPjfP-b5XXYG7p49WU7J1FiK6oSIckQI,1779
|
11
11
|
square_authentication/utils/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
12
|
-
square_authentication/utils/encryption.py,sha256=
|
13
|
-
square_authentication/utils/token.py,sha256=
|
14
|
-
square_authentication-5.1.
|
15
|
-
square_authentication-5.1.
|
16
|
-
square_authentication-5.1.
|
17
|
-
square_authentication-5.1.
|
12
|
+
square_authentication/utils/encryption.py,sha256=WakaiEAgWpTJltxBzqOtv81_DCDKfzJqt60fWSPoNvo,2027
|
13
|
+
square_authentication/utils/token.py,sha256=t-RPBY4cYyT1ro3lkLBTOy2BeRGBfluBVBivL5DLmDg,680
|
14
|
+
square_authentication-5.1.5.dist-info/METADATA,sha256=0GDaWp1LZIJ1WGH1_r-uf0GhBgfuERwosV8hzZ8wl0s,4258
|
15
|
+
square_authentication-5.1.5.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
16
|
+
square_authentication-5.1.5.dist-info/top_level.txt,sha256=wDssVJIl9KIEJPj5rR3rv4uRI7yCndMBrvHd_6BGXQA,22
|
17
|
+
square_authentication-5.1.5.dist-info/RECORD,,
|
{square_authentication-5.1.4.dist-info → square_authentication-5.1.5.dist-info}/top_level.txt
RENAMED
File without changes
|