square-authentication 8.0.2__tar.gz → 9.0.0__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 (32) hide show
  1. {square_authentication-8.0.2 → square_authentication-9.0.0}/PKG-INFO +6 -1
  2. {square_authentication-8.0.2 → square_authentication-9.0.0}/README.md +5 -0
  3. {square_authentication-8.0.2 → square_authentication-9.0.0}/setup.py +1 -1
  4. {square_authentication-8.0.2 → square_authentication-9.0.0}/square_authentication/routes/core.py +10 -0
  5. {square_authentication-8.0.2 → square_authentication-9.0.0}/square_authentication.egg-info/PKG-INFO +6 -1
  6. {square_authentication-8.0.2 → square_authentication-9.0.0}/pyproject.toml +0 -0
  7. {square_authentication-8.0.2 → square_authentication-9.0.0}/setup.cfg +0 -0
  8. {square_authentication-8.0.2 → square_authentication-9.0.0}/square_authentication/__init__.py +0 -0
  9. {square_authentication-8.0.2 → square_authentication-9.0.0}/square_authentication/configuration.py +0 -0
  10. {square_authentication-8.0.2 → square_authentication-9.0.0}/square_authentication/data/config.sample.ini +0 -0
  11. {square_authentication-8.0.2 → square_authentication-9.0.0}/square_authentication/data/config.testing.sample.ini +0 -0
  12. {square_authentication-8.0.2 → square_authentication-9.0.0}/square_authentication/main.py +0 -0
  13. {square_authentication-8.0.2 → square_authentication-9.0.0}/square_authentication/messages.py +0 -0
  14. {square_authentication-8.0.2 → square_authentication-9.0.0}/square_authentication/pydantic_models/__init__.py +0 -0
  15. {square_authentication-8.0.2 → square_authentication-9.0.0}/square_authentication/pydantic_models/core.py +0 -0
  16. {square_authentication-8.0.2 → square_authentication-9.0.0}/square_authentication/pydantic_models/profile.py +0 -0
  17. {square_authentication-8.0.2 → square_authentication-9.0.0}/square_authentication/routes/__init__.py +0 -0
  18. {square_authentication-8.0.2 → square_authentication-9.0.0}/square_authentication/routes/profile.py +0 -0
  19. {square_authentication-8.0.2 → square_authentication-9.0.0}/square_authentication/routes/utility.py +0 -0
  20. {square_authentication-8.0.2 → square_authentication-9.0.0}/square_authentication/utils/__init__.py +0 -0
  21. {square_authentication-8.0.2 → square_authentication-9.0.0}/square_authentication/utils/core.py +0 -0
  22. {square_authentication-8.0.2 → square_authentication-9.0.0}/square_authentication/utils/encryption.py +0 -0
  23. {square_authentication-8.0.2 → square_authentication-9.0.0}/square_authentication/utils/token.py +0 -0
  24. {square_authentication-8.0.2 → square_authentication-9.0.0}/square_authentication.egg-info/SOURCES.txt +0 -0
  25. {square_authentication-8.0.2 → square_authentication-9.0.0}/square_authentication.egg-info/dependency_links.txt +0 -0
  26. {square_authentication-8.0.2 → square_authentication-9.0.0}/square_authentication.egg-info/requires.txt +0 -0
  27. {square_authentication-8.0.2 → square_authentication-9.0.0}/square_authentication.egg-info/top_level.txt +0 -0
  28. {square_authentication-8.0.2 → square_authentication-9.0.0}/tests/test_1.py +0 -0
  29. {square_authentication-8.0.2 → square_authentication-9.0.0}/tests/test_delete_user.py +0 -0
  30. {square_authentication-8.0.2 → square_authentication-9.0.0}/tests/test_login.py +0 -0
  31. {square_authentication-8.0.2 → square_authentication-9.0.0}/tests/test_update_profile.py +0 -0
  32. {square_authentication-8.0.2 → square_authentication-9.0.0}/tests/test_username.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: square_authentication
3
- Version: 8.0.2
3
+ Version: 9.0.0
4
4
  Summary: authentication layer for my personal server.
5
5
  Home-page: https://github.com/thepmsquare/square_authentication
6
6
  Author: thePmSquare
@@ -54,6 +54,11 @@ pip install square_authentication
54
54
 
55
55
  ## changelog
56
56
 
57
+ ### v9.0.0
58
+
59
+ - core
60
+ - **breaking change**: new mandatory parameter `app_id` in validate_and_get_payload_from_token_v0.
61
+
57
62
  ### v8.0.2
58
63
 
59
64
  - core
@@ -16,6 +16,11 @@ pip install square_authentication
16
16
 
17
17
  ## changelog
18
18
 
19
+ ### v9.0.0
20
+
21
+ - core
22
+ - **breaking change**: new mandatory parameter `app_id` in validate_and_get_payload_from_token_v0.
23
+
19
24
  ### v8.0.2
20
25
 
21
26
  - core
@@ -4,7 +4,7 @@ package_name = "square_authentication"
4
4
 
5
5
  setup(
6
6
  name=package_name,
7
- version="8.0.2",
7
+ version="9.0.0",
8
8
  packages=find_packages(),
9
9
  package_data={
10
10
  package_name: ["data/*"],
@@ -1975,6 +1975,7 @@ async def update_password_v0(
1975
1975
  @router.get("/validate_and_get_payload_from_token/v0")
1976
1976
  @global_object_square_logger.auto_logger()
1977
1977
  async def validate_and_get_payload_from_token_v0(
1978
+ app_id: int,
1978
1979
  token: Annotated[str, Header()],
1979
1980
  token_type: TokenType = Query(...),
1980
1981
  ):
@@ -2022,6 +2023,15 @@ async def validate_and_get_payload_from_token_v0(
2022
2023
  status_code=status.HTTP_400_BAD_REQUEST,
2023
2024
  detail=output_content,
2024
2025
  )
2026
+ if local_dict_token_payload["app_id"] != app_id:
2027
+ output_content = get_api_output_in_standard_format(
2028
+ message=messages["GENERIC_400"],
2029
+ log=f"app_id: {app_id} does not match with token app_id: {local_dict_token_payload['app_id']}.",
2030
+ )
2031
+ raise HTTPException(
2032
+ status_code=status.HTTP_400_BAD_REQUEST,
2033
+ detail=output_content,
2034
+ )
2025
2035
  except HTTPException as http_exception:
2026
2036
  raise
2027
2037
  except Exception as error:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: square_authentication
3
- Version: 8.0.2
3
+ Version: 9.0.0
4
4
  Summary: authentication layer for my personal server.
5
5
  Home-page: https://github.com/thepmsquare/square_authentication
6
6
  Author: thePmSquare
@@ -54,6 +54,11 @@ pip install square_authentication
54
54
 
55
55
  ## changelog
56
56
 
57
+ ### v9.0.0
58
+
59
+ - core
60
+ - **breaking change**: new mandatory parameter `app_id` in validate_and_get_payload_from_token_v0.
61
+
57
62
  ### v8.0.2
58
63
 
59
64
  - core