square-authentication 5.1.4__tar.gz → 5.1.5__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.
Files changed (23) hide show
  1. {square_authentication-5.1.4 → square_authentication-5.1.5}/PKG-INFO +27 -6
  2. {square_authentication-5.1.4 → square_authentication-5.1.5}/README.md +4 -0
  3. {square_authentication-5.1.4 → square_authentication-5.1.5}/setup.py +2 -2
  4. {square_authentication-5.1.4 → square_authentication-5.1.5}/square_authentication/main.py +1 -1
  5. {square_authentication-5.1.4 → square_authentication-5.1.5}/square_authentication/routes/core.py +15 -13
  6. {square_authentication-5.1.4 → square_authentication-5.1.5}/square_authentication/routes/utility.py +1 -1
  7. {square_authentication-5.1.4 → square_authentication-5.1.5}/square_authentication/utils/encryption.py +2 -2
  8. {square_authentication-5.1.4 → square_authentication-5.1.5}/square_authentication/utils/token.py +1 -1
  9. {square_authentication-5.1.4 → square_authentication-5.1.5}/square_authentication.egg-info/PKG-INFO +28 -7
  10. {square_authentication-5.1.4 → square_authentication-5.1.5}/square_authentication.egg-info/SOURCES.txt +2 -1
  11. {square_authentication-5.1.4 → square_authentication-5.1.5}/square_authentication.egg-info/requires.txt +1 -1
  12. square_authentication-5.1.5/tests/test_1.py +17 -0
  13. {square_authentication-5.1.4 → square_authentication-5.1.5}/setup.cfg +0 -0
  14. {square_authentication-5.1.4 → square_authentication-5.1.5}/square_authentication/__init__.py +0 -0
  15. {square_authentication-5.1.4 → square_authentication-5.1.5}/square_authentication/configuration.py +0 -0
  16. {square_authentication-5.1.4 → square_authentication-5.1.5}/square_authentication/data/config.ini +0 -0
  17. {square_authentication-5.1.4 → square_authentication-5.1.5}/square_authentication/messages.py +0 -0
  18. {square_authentication-5.1.4 → square_authentication-5.1.5}/square_authentication/pydantic_models/__init__.py +0 -0
  19. {square_authentication-5.1.4 → square_authentication-5.1.5}/square_authentication/pydantic_models/core.py +0 -0
  20. {square_authentication-5.1.4 → square_authentication-5.1.5}/square_authentication/routes/__init__.py +0 -0
  21. {square_authentication-5.1.4 → square_authentication-5.1.5}/square_authentication/utils/__init__.py +0 -0
  22. {square_authentication-5.1.4 → square_authentication-5.1.5}/square_authentication.egg-info/dependency_links.txt +0 -0
  23. {square_authentication-5.1.4 → square_authentication-5.1.5}/square_authentication.egg-info/top_level.txt +0 -0
@@ -1,18 +1,37 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: square_authentication
3
- Version: 5.1.4
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
13
11
  Classifier: Programming Language :: Python :: 3
14
12
  Classifier: Programming Language :: Python :: 3.9
15
13
  Description-Content-Type: text/markdown
14
+ Requires-Dist: uvicorn>=0.24.0.post1
15
+ Requires-Dist: fastapi>=0.104.1
16
+ Requires-Dist: pydantic>=2.5.3
17
+ Requires-Dist: bcrypt>=4.1.2
18
+ Requires-Dist: pyjwt>=2.8.0
19
+ Requires-Dist: requests>=2.32.3
20
+ Requires-Dist: cryptography>=42.0.7
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
25
+ Requires-Dist: pytest>=8.0.0
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
16
35
 
17
36
  # square_authentication
18
37
 
@@ -32,6 +51,10 @@ pip install square_authentication
32
51
 
33
52
  ## changelog
34
53
 
54
+ ### v5.1.5
55
+
56
+ - bump square_logger to >=2.0.0.
57
+
35
58
  ### v5.1.4
36
59
 
37
60
  - re bug fix v5.1.3
@@ -139,5 +162,3 @@ pip install square_authentication
139
162
  - initial implementation.
140
163
 
141
164
  ## Feedback is appreciated. Thank you!
142
-
143
-
@@ -16,6 +16,10 @@ pip install square_authentication
16
16
 
17
17
  ## changelog
18
18
 
19
+ ### v5.1.5
20
+
21
+ - bump square_logger to >=2.0.0.
22
+
19
23
  ### v5.1.4
20
24
 
21
25
  - re bug fix v5.1.3
@@ -4,7 +4,7 @@ package_name = "square_authentication"
4
4
 
5
5
  setup(
6
6
  name=package_name,
7
- version="5.1.4",
7
+ version="5.1.5",
8
8
  packages=find_packages(),
9
9
  package_data={
10
10
  package_name: ["data/*"],
@@ -18,7 +18,7 @@ setup(
18
18
  "requests>=2.32.3",
19
19
  "cryptography>=42.0.7",
20
20
  "square_commons>=1.0.0",
21
- "square_logger>=1.0.0",
21
+ "square_logger>=2.0.0",
22
22
  "square_database_helper>=2.0.0",
23
23
  "square_database_structure>=2.3.1",
24
24
  "pytest>=8.0.0",
@@ -31,7 +31,7 @@ app.include_router(utility.router)
31
31
 
32
32
 
33
33
  @app.get("/")
34
- @global_object_square_logger.async_auto_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.async_auto_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.async_auto_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.async_auto_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.async_auto_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][UserProfile.user_id.name]
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.async_auto_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.async_auto_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.async_auto_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.async_auto_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.async_auto_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.async_auto_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.async_auto_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.async_auto_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(...),
@@ -12,7 +12,7 @@ router = APIRouter(
12
12
 
13
13
 
14
14
  @router.get("/get_text_hash/v0")
15
- @global_object_square_logger.async_auto_logger
15
+ @global_object_square_logger.auto_logger()
16
16
  async def get_text_hash_v0(plain_text: str):
17
17
 
18
18
  try:
@@ -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,18 +1,37 @@
1
- Metadata-Version: 2.1
2
- Name: square-authentication
3
- Version: 5.1.4
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
13
11
  Classifier: Programming Language :: Python :: 3
14
12
  Classifier: Programming Language :: Python :: 3.9
15
13
  Description-Content-Type: text/markdown
14
+ Requires-Dist: uvicorn>=0.24.0.post1
15
+ Requires-Dist: fastapi>=0.104.1
16
+ Requires-Dist: pydantic>=2.5.3
17
+ Requires-Dist: bcrypt>=4.1.2
18
+ Requires-Dist: pyjwt>=2.8.0
19
+ Requires-Dist: requests>=2.32.3
20
+ Requires-Dist: cryptography>=42.0.7
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
25
+ Requires-Dist: pytest>=8.0.0
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
16
35
 
17
36
  # square_authentication
18
37
 
@@ -32,6 +51,10 @@ pip install square_authentication
32
51
 
33
52
  ## changelog
34
53
 
54
+ ### v5.1.5
55
+
56
+ - bump square_logger to >=2.0.0.
57
+
35
58
  ### v5.1.4
36
59
 
37
60
  - re bug fix v5.1.3
@@ -139,5 +162,3 @@ pip install square_authentication
139
162
  - initial implementation.
140
163
 
141
164
  ## Feedback is appreciated. Thank you!
142
-
143
-
@@ -17,4 +17,5 @@ square_authentication/routes/core.py
17
17
  square_authentication/routes/utility.py
18
18
  square_authentication/utils/__init__.py
19
19
  square_authentication/utils/encryption.py
20
- square_authentication/utils/token.py
20
+ square_authentication/utils/token.py
21
+ tests/test_1.py
@@ -6,7 +6,7 @@ pyjwt>=2.8.0
6
6
  requests>=2.32.3
7
7
  cryptography>=42.0.7
8
8
  square_commons>=1.0.0
9
- square_logger>=1.0.0
9
+ square_logger>=2.0.0
10
10
  square_database_helper>=2.0.0
11
11
  square_database_structure>=2.3.1
12
12
  pytest>=8.0.0
@@ -0,0 +1,17 @@
1
+ from fastapi.testclient import TestClient
2
+ from square_commons import get_api_output_in_standard_format
3
+
4
+ from square_authentication.configuration import config_str_module_name
5
+ from square_authentication.main import (
6
+ app,
7
+ )
8
+
9
+ client = TestClient(app)
10
+
11
+
12
+ def test_read_main():
13
+ response = client.get("/")
14
+ assert response.status_code == 200
15
+ assert response.json() == get_api_output_in_standard_format(
16
+ log=config_str_module_name
17
+ )